Setting up BytebeamArduino for GSM Connectivity
This guide will show you how to setup your project for GSM connectivity.
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.
In order to work with GSM Client, you need to install the following libraries,
Provisioning the device is the first step towards getting cloud connectivity at your device end. So, 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.
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 the 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.
By default, we define the Wi-Fi network interface inside the SDK and in order to work with GSM you need to define the Modem Network Interface. Follow the below steps to do so,
- Open the Arduino library's location.
- Step into BytebeamArduino\src folder.
- Open BytebeamArduinoDefines.h in your favorite text editor.
- Add Modem Network Interface instead of Wi-Fi Network Interface.
Refer below code snippet for reference,
The next step is to initialize and start bytebeam client. Refer below code snippet to do so :)
Look at the SetupClient_GSM example sketch for reference. See File > Examples > BytebeamArduino > ESP32 > SetupClient_GSM 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.