Module Integration Guides
Arduino

Setting up BytebeamArduino for GSM Connectivity

9min

This guide will show you how to setup your project for GSM connectivity.

Step 1. Getting the SDK

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.

Document image


Now you should be able to see the SDK in the Arduino IDE. See Sketch > Include Library > BytebeamArduino within the Arduino IDE.

Document image


You can also look for example sketches that comes along with the SDK. See File > Examples > BytebeamArduino within the Arduino IDE.

Document image


Step 2. Getting the GSM Client Dependencies

In order to work with GSM Client, you need to install the following libraries,

Step 3. Device Provisioning

Provision device with device config data

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:

Document image


Follow the below steps to provision your device:

  1. Download the device configuration JSON file from Bytebeam cloud by following the Provisioning a Device guide.
  2. 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.
  3. Open SPIFFS Provisioning example sketch as per your choice of the file system. See File > Examples > BytebeamArduino > Provisioning > SPIFFSProvisioning within the Arduino IDE.
  4. Paste the copied content to the deviceConfigWriteStr char array, Refer below code snippet to do so.
  5. Setup the ESP32 board configurations and Hit the Upload button.
  6. Watch out the Serial logs for the provisioning status.
JSON


Step 4. Defining GSM Network Interface

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,

C++


Step 5. Initialize and Start Bytebeam Client

The next step is to initialize and start bytebeam client. Refer below code snippet to do so :)

C++


Look at the SetupClient_GSM example sketch for reference. See File > Examples > BytebeamArduino > ESP32 > SetupClient_GSM within the Arduino IDE.

Document image


Step 6. Build and Flash Application

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.