Setting up Bytebeam ESP SDK
This section provides step by step instructions on how to set up and start using the Bytebeam ESP SDK . This SDK can be used with any ESP32 board. The only requirements are WiFi and a working internet connection.
Clone esp-bytebeam-sdk using a Git client
This repository consists of three folders:
- components: This folder contains the bytebeam_esp_sdk as a component that you can add to your project.
- example: A sample project showing how you can use the SDK.
- provisioning_app: Application to push device config data to SPIFFS.
Each device needs a configuration file to connect to Bytebeam. Download the configuration file and flash it to SPIFFS by following the below steps:
- Download the device configuration JSON file from Bytebeam cloud by following the guide.
- After downloading the config file, rename it to the device_config.json
- Create a folder by name config_data within the provisioning project and place device_config.json file within this folder.
- Open ESP-IDF terminal and navigate to the provisioning project.
- Clear the entire flash once by running the following command
- . Once flash is erased, build and flash provisioning application by running the following command
Once the device is provisioned, integrate the esp-bytebeam-sdk into your existing ESP project:
- Open top-level CMakeLists.txt from your ESP project in an editor.
- Add bytebeam-esp-sdk component to your project by setting EXTRA_COMPONENT_DIRS
This command needs to be after the cmake_minimum_required() command. Look at the example folder for reference.
To connect your ESP device to Bytebeam cloud and exchange data, you need to configure wifi and partition settings. To do this, open the ESP-IDF terminal, go to your project directory, and run idf.py menuconfig to open the Config menu. Then, follow these steps:
- Configure Wi-Fi/Ethernet settings by selecting Example Connection Configuration option.
- Enter your WiFi SSID and Password.
- Press ESC to exit out of the menu
This is required for implementing Over the air updates. The below steps partition your ESP flash into two app partitions and one partition for storing the device config file.
- Copy examples_partition.csv file from example project and paste it into your ESP project.
- Open menuconfig and select Partition Table option.
- Select Custom partition table CSV option from the available options and press ESC button.
- Set the name of Custom partition table CSV to partitions_example.csv and press ESC button.
Note: With above partition table selected, flash size of 4MB or more is recommended.
The next step is to initialize and start bytebeam client. Add the below code to do so:
Look at app_main.c from example project for reference.
You can build and flash your application as usual with idf.py .