Learn how to set up and utilize the Bytebeam ESP-RS SDK on any ESP32 board with this comprehensive document. Get step-by-step instructions on provisioning the device, integrating the Bytebeam client into your project, and building and flashing.
This section provides step by step instructions on how to set up and start using the Bytebeam ESP-RS SDK . This SDK can be used with any ESP32 board. The only requirements are WiFi and a working internet connection.
bytebeam-esp-rs requires device_config.json file in SPIFFS partition. We provide a tool for provisioning device.
Copy
Ask AI
$ git clone https://github.com/bytebeamio/bytebeam-esp-rs-sdk.git$ cd bytebeam-esp-rs-sdk/tools/provision
Download the device configuration JSON file from Bytebeam cloud by following the Provisioning a Device guide and place it inside the provision project with the name device_config.jsonYou can use cargo espflash to build the project and flash it.Connect your ESP board using USB and run the following command inside provision project :
NOTE: If you want to use custom partition table for your application, please replace partitions.csv file provided in provision projectYou will see a log line with “Provisioning Done” message! You can then terminate it and move on to next step.
Add bytebeam-esp-rs as a dependency in your Cargo.toml
Copy
Ask AI
cargo add bytebeam-esp-rs
This will add an entry in your Cargo.toml like:
Copy
Ask AI
[dependency]bytebeam-esp-rs = "0.1.0"
Now you can start using Bytebeam client in your project
Copy
Ask AI
/* other imports */use bytebeam_esp_rs::ByteBeamClient;fn main() -> anyhow::Result<()> { /*... Setup esp for Rust Connect to internet and initialize SNTP/NTP to sync time ...*/ let bytebeam_client = ByteBeamClient::init()?; // use bytebeam_client here!}
NOTE: Use the same partitions.csv that you used for provisioning! If you didn’t use a custom table, you can download and use partitions.csv from the provision app!