Firmware Setup Guide

Table of content

1. Install PlatformIO

  • It is suggested to use VS Code IDE for the development. Follow the guide in PlatformIO IDE for VSCode to install PlatformIO Extension with VS Code IDE.
  • If you are using another IDE, please check here for the installation instructions.

2. Install ESP32 Framework

  • We are using Espressif 32 Plafrorm with Arduino framework. The first time you build the project, this will be downloaded automatically with the other required packages, tools, and libraries.

3. Prepare config.h

  • Once you set up the repository, you need to copy the ‘src/config/config_sample.h’ file and create ‘src/config/config.h’.
  • Next, open the ‘config.h’ file and fill in the below definitions with the MQTT Broker you are using.
#define MQTT_SERVER "192.168.8.1"
#define MQTT_PORT 1883
#define MQTT_CLIENT "Robot"
#define MQTT_USERNAME "mqtt_username"
#define MQTT_PASSWORD "mqtt_password"
  • Fill in the below definitions with the credentials of the WiFi network you are using.
#define WIFI_SSID "wifi_SSID"
#define WIFI_PASS "wifi_password"

4. Build and Upload

  • You can use the Build button in the IDE or use the below command in the terminal to build the firmware.
pio build
  • You can use the Upload button in the IDE or use the below command in the terminal to build the firmware and upload it to the development board.
  • Usually, PlatformIO will automatically identify the COM port that the robot is connected to.
  • You need to use an external USB to UART converter to upload the firmware into the Arduino Pro Mini boards.
pio run --target upload 
  • If you are getting an error like ‘Failed to connect to ESP32: Timed out… Connecting…’, you need to hold down the BOOT button in the development board, and press the Upload button in the IDE. After you see the ‘Connecting…‘ message in the IDE, you can release the BOOT button.