Skip to content
/ mlr Public

Tokay ESP32 Camera + ThingsBoard Rust Demo Firmware

License

Notifications You must be signed in to change notification settings

forGGe/mlr

Repository files navigation

Rust Demo Firmware For Tokay Lite Camera

ThingsBoard dashboard

Necessary Preparation

Build Environment

The firmware is based on ESP32-IDF Rust framework. In order to install all necessary tools, proceed with following:

cargo install espup
espup install
cargo install ldproxy

Uploadcare Account

The demo firmware uses Uploadcare cloud provider as a means of images storage. To have your images uploaded, do following:

  1. Sign up to Uploadcare
  2. Obtain the public API key.

ThingsBoard Initial Configuration

ThingsBoard IoT framework is used in the demo to display the image. No other telemetry is sent for simplicity, but it's easy to extend the firmware to send more data if needed.

To leverage ThingsBoard in this demo, you need to do following:

  1. Create a free account on ThingsBoard demo server.

  2. Follow the official Getting Started guide to provision the device an obtain Device Access Token.

  3. Add a single telemetry record for the newly created ThingsBoard device. This will serve as a placeholder image. You can do it either manually in ThingsBoard UI, or by issuing a command:

    mosquitto_pub -d -q 1 -h "demo.thingsboard.io" -t "v1/devices/me/telemetry" -u "$ACCESS_TOKEN" -m '{"url":"https://placehold.co/600x400.png"}'
  4. Take doc/image_display_widget.json file and upload it to the Widget Library in your ThingsBoard UI.

  5. Create IoT dashboard and add "Image Display Widget" to it. Add more widgets if you want.

  6. At this point your dashboard could look like this:

ThingsBoard dashboard

Configure The Firmware

  1. Create a configuration file based of an example:

    cp doc/example.cfg.toml cfg.toml
  2. Modify values of cfg.toml according to previously obtained access keys. Don't forget to modify WiFi settings.

Build Firmware

As simple as:

cargo build

Upload Firmware to Device

  1. Connect the camera USB-C port to PC.

  2. Press hold PWR_ON button (SW1). Don't release the button until flashing is complete.

  3. Flash the firmware:

    cargo run
  4. Enjoy your camera uploading images every 10 seconds.

Further Reading and References

About

Tokay ESP32 Camera + ThingsBoard Rust Demo Firmware

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published