website logo
BlogPlansAbout UsCareersLogin
⌘K
Introduction
Getting started on Bytebeam Cloud
Concepts
Projects
Streams
Device Shadow
Device Metadata
Actions
Module Integration Guides
ESP32
Linux
Console Guides
Devices
Device Metadata
Streams
Actions
Dashboards
Users
Roles
Release Notes
R2 01-Feb-2023
R1 19-Jan-2023
Docs powered by archbee 
25min

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.

Step 1. Integrate Bytebeam SDK with an ESP project

Clone Bytebeam ESP SDK

Clone esp-bytebeam-sdk using a Git client

Shell
|

This repository consists of three folders:

  1. components: This folder contains the bytebeam_esp_sdk as a component that you can add to your project.
  2. example: A sample project showing how you can use the SDK.
  3. provisioning_app: Application to push device config data to SPIFFS.

Provision device with device config data

Each device needs a configuration file to connect to Bytebeam. Download the configuration file and flash it to SPIFFS by following the below steps:

  1. Download the device configuration JSON file from Bytebeam cloud by following the Provisioning a Device guide.
  2. After downloading the config file, rename it to the device_config.json
  3. Create a folder by name config_data within the provisioning project and place device_config.json file within this folder.
  4. Open ESP-IDF terminal and navigate to the provisioning project.
  5. Clear the entire flash once by running the following command
Shell
|
  1. . Once flash is erased, build and flash provisioning application by running the following command
Shell
|

Add Bytebeam ESP SDK to the CMake Build System of ESP project

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
CMakeLists.txt
|

This command needs to be after the cmake_minimum_required() command. Look at the example folder for reference.

Step 2. Configure Hardware

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 Wifi/Ethernet

  1. Configure Wi-Fi/Ethernet settings by selecting Example Connection Configuration option.
  2. Enter your WiFi SSID and Password.
  3. Press ESC to exit out of the menu
Document image
Document image

Configure Partition table settings

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.

  1. Copy examples_partition.csv file from example project and paste it into your ESP project.
  2. Open menuconfig and select Partition Table option.
  3. Select Custom partition table CSV option from the available options and press ESC button.
  4. Set the name of Custom partition table CSV to partitions_example.csv and press ESC button.
Document image
Document image

Note: With above partition table selected, flash size of 4MB or more is recommended.

Step 3: Initialize and start bytebeam client

The next step is to initialize and start bytebeam client. Add the below code to do so:

C++
|

Look at app_main.c from example project for reference.

Step 4: Build and Flash application

You can build and flash your application as usual with idf.py .

Shell
|
Updated 28 Dec 2022
Did this page help you?
Yes
No
UP NEXT
Pushing data to Bytebeam
Docs powered by archbee 
TABLE OF CONTENTS
Step 1. Integrate Bytebeam SDK with an ESP project
Clone Bytebeam ESP SDK
Provision device with device config data
Add Bytebeam ESP SDK to the CMake Build System of ESP project
Step 2. Configure Hardware
Configure Wifi/Ethernet
Configure Partition table settings
Step 3: Initialize and start bytebeam client
Step 4: Build and Flash application