Setting up Bytebeam ESP IDF SDK
This section provides step by step instructions on how to set up and start using the Bytebeam ESP IDF SDK . This SDK can be used with any ESP32 board. The only requirements are WiFi and a working internet connection.
Clone bytebeam-esp-idf-sdk using a Git client bytebeam-esp-idf-sdk
This repository consists of three folders:
- src: This folder contains source code for various functions that can be used by applications for interacting with Bytebeam platform.
- examples: This folder contains few example projects showing how you can use the SDK.
- provisioning: Application to push device config data to file system of device (say 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 Provisioning a Device guide.
- After downloading the config file, rename it to the device_config.json
- Step into config_data folder within the provisioning project and place device_config.json file within this folder i.e Replace the file if it is already there.
- Launch the ESP-IDF terminal and run the following command's.
Once the device is provisioned, integrate the bytebeam-esp-idf-sdk into your existing ESP project:
- Open top-level CMakeLists.txt from your ESP project in an editor.
- Add bytebeam-esp-idf-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 project for reference.
- Open project-level CMakeLists.txt from your ESP project in an editor.
- Add bytebeam-esp-idf-sdk component to your project PRIV_REQUIRES
To connect your ESP device to Bytebeam cloud and exchange data, you need to configure wifi and partition settings. Follow the below steps to configure your project :)
Launch the ESP-IDF terminal and run the following command's.
- 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
![Document image Document image](https://images.archbee.com/KgoQSkw-NkQJykt01OVJo/Z1NN6EorQCXLFgmG3fEUo_screenshot-2022-09-26-230138.png?format=webp)
![Document image Document image](https://images.archbee.com/KgoQSkw-NkQJykt01OVJo/KjuOQCLH-5NrpIIr0L7Kl_screenshot-2022-09-26-230628.png?format=webp)
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.
![Document image Document image](https://images.archbee.com/KgoQSkw-NkQJykt01OVJo/Y5EmnyHstku1FOr87us5__custompartition.png?format=webp)
![Document image Document image](https://images.archbee.com/KgoQSkw-NkQJykt01OVJo/u7X_ohLKqti_vkYWbR10v_cutomparitionname.png?format=webp)
Note: With above partition table selected, flash size of 4MB or more is recommended.
The next step is to initialhe below code to do so:
Look at the setup_client example app for reference.
You can build and flash your application as usual with idf.py .