Building and Flashing Firmware

This page describes how to setup a process to build and flash custom firmware for Tokay Lite cameras.

Necessary Preparations

First and foremost, you need to clone the Tokay Lite firmare repository. The repositry can be found on GitHub: https://github.com/maxlab-io/tokay-lite-sdk and be cloned as follows:

1git clone https://github.com/maxlab-io/tokay-lite-sdk.git

The firmware requires a couple of submodules to be updated, so you need to proceed with cloning them as well:

1cd tokay-lite-sdk
2git submodule update --init --recursive

The firmware is based on ESP-IDF framework, so in order to proceed with builds, the ESP-IDF framework must be either locally installed or used directly from Docker images.

It is recommended to use Docker, since it reduces the dependency mess. However, if you still want to install ESP-IDF locally, skip the Docker installation section and jump right to building firmware locally guide

Build and Flash Trought Docker

Building Firmware

  1. Make sure the repository is cloned and step into the root directory of it:

    1cd tokay-lite-sdk
    
  2. Proceed with building the firmware using Docker image:

    1docker run -it --rm -v $PWD:/project -w /project espressif/idf:v5.0 idf.py build -C webserver
    

Flashing Firmware

  1. Before flashing Tokay Lite, assure that USB-C is connected.

  2. Hold the PWR button to wakeup the device. The firmware will open the USB port using the built-in USB-CDC interface of ESP32-S3.

  3. If you're on Linux, check that /dev/ttyACM* USB port is showing up in the system:

    1
    2ls -l /dev/ttyACM*
    3
    4crw-rw----+ 1 root root 166, 0 May  4 20:57 /dev/ttyACM0
    
  4. Run the following command, replacing <TTY-USB-PATH> with the tty path discovered during previous step.

    1docker run -it --device=<TTY-USB-PATH>:/dev/ttyACM0 --rm -v $PWD:/project -w /project espressif/idf:v5.0 idf.py flash -C webserver
    

    The flashing should succeed now.

Build and Flash Using Local ESP-IDF Installation

Setup ESP-IDF

The Tokay Lite firmware is compatible only with v5.0 of ESP-IDF. Make sure you install correct version!

In order to isntall ESP-IDF, please follow the official Espressif guide.

You also need to be familiar about building and developing projects using ESP-IDF tools, so it is stronly advised to complete the Build Your First Project Guide

After ESP-IDF installation is complete, return back and proceed with following steps.

Building And Flashing Firmware

  1. Make sure the repository is cloned and step into the root directory of it:

    1cd tokay-lite-sdk
    
  2. Build the firmware directly using idf.py:

    1idf.py build -C webserver
    

Flashing Firmware

  1. Before flashing Tokay Lite, assure that USB-C is connected.

  2. Hold the PWR button to wakeup the device. The firmware will open the USB port using the built-in USB-CDC interface of ESP32-S3.

  3. If you're on Linux, check that /dev/ttyACM* USB port is showing up in the system:

    1
    2ls -l /dev/ttyACM*
    3
    4crw-rw----+ 1 root root 166, 0 May  4 20:57 /dev/ttyACM0
    
  4. Run the following command, replacing <TTY-USB-PATH> with the tty path discovered during previous step.

    1idf.py -p <TTY-USB-PATH> flash -C webserver
    

    The flashing should succeed now.

Next Steps

  1. Once flashed, press and hold the PWR button for 3 seconds and notice the tokay-lite WiFi access point showing up.

  2. Connect to the tokay-lite WiFi access point and point your browser to http://tokay-lite.local page to .

The hostname tokay-lite.local is resolvable only if mDNS discovery is enabled on your device. Usually that's the case on mainstream systems, but if your host system lacks mDNS support, use following address:

http://192.168.4.1

  1. Supply your WiFi network credentials and press the Submit button. The camera will connect to your local network.

    Assuming your host and the camera are on the same network, you can access the Tokay web dashboard through the same http://tokay-lite.local link.

Troubleshooting

This section is in progress