Setting up BytebeamArduino SDK
This section provides step by step instructions on how to set up and start using BytebeamArduino
This guide assumes that you are using ESP32 development board for this integration and the same instructions will work for ESP8266.
You can install the SDK via Arduino Library Manager. We recommend installing the latest version of the SDK for this integration. Follow the below steps to install the SDK
Open the Arduino Library Manager and search for the bytebeam keyword. The BytebeamArduino SDK will pop up. Go ahead select the latest version (say 1.0.1) and hit the install button.
Now you should be able to see the SDK in the Arduino IDE. See Sketch > Include Library > BytebeamArduino within the Arduino IDE.
You can also look for example sketches that comes along with the SDK. See File > Examples > BytebeamArduino within the Arduino IDE.
Before you get started with the BytebeamArduino you need to provision your device. Each device has its own config file which needs to be flashed into its file system. When you call the begin method our SDK will look for this device config data and use that in order to establish the secure connection with the remote device at the cloud end.
For this integration we will go with the default configurations. If you want to change the configuration, check out the Advanced SDK Configurations guide.
Note: On ESP32 we use SPIFFS by default but if you are using ESP8266 you should use LITTLEFS by default
Before getting ahead make sure you have the SPIFFS file system partition. For this you can select the partition table setting under Tools section. See Tools > Partition Scheme within the Arduino IDE.
Follow the below steps to provision your device:
- Download the device configuration JSON file from Bytebeam cloud by following the Provisioning a Device guide.
- After downloading the config file, open it in your favourite text editor and format the json document. Once done copy the formatted json document to the clipboard.
- Open SPIFFS Provisioning example sketch as per your choice of file system. See File > Examples > BytebeamArduino > Provisioning > SPIFFSProvisioning within the Arduino IDE.
- Paste the copied content to the deviceConfigWriteStr char array, Refer below code snippet to do so.
- Setup the ESP32 board configurations and Hit the Upload button.
- Watch out the Serial logs for the provisioning status.
The next step is to initialize and start bytebeam client. Refer below code snippet to do so:
Look at the SetupClient example sketch for reference. See File > Examples > BytebeamArduino > ESP32 > SetupClient within the Arduino IDE.
You can build and flash your application as usual with the Arduino IDE, just setup your board configurations and hit the upload button within the Arduino IDE.