RAK WisBlocks
The ESP32 WisBlock core allows for Wi-Fi based connectivity using the normal WisBlock modules and baseboard.
RAK Wireless has released their ESP32 core module which allows the current ecosystem of sensors and I/O modules, while the original nRF52 LoRa core module supported LoRa and Bluetooth, the ESP32 supports Wi-Fi and Bluetooth which allows an MQTT connection to be made directly to Qubitro. We are going to use the Arduino framework for this example to use RAKs convenient Arduino package.
First, follow RAKs getting started guide to setup with the Arduino IDE, or the PlatformIO guide to use with PlatformIO, we prefer to use PlatformIO as we can use a manifest for example projects which makes it easy, but the standard Arduino IDE works just as well. Once the development environment is set up the hardware can be set up by first soldering a 1x2 pin header on the BOOT0 and GND pins of the baseboard, followed by attaching the ESP32 core module to said baseboard. Make sure to keep the jumper for the pins handy since we'll need it to upload firmware to the ESP32.
Now that everything is set up, we can go ahead and start with software, we can treat this board like any other ESP32 product, with the exception of when we want to upload new code we need to put in a jumper on those two pins we added earlier then press the reset button.

Using the Example

We wrote a basic example for the WisBlock ESP32 core where you can demo various sensors easily, it meant to provide a bare-bones getting started but posts data to Qubitro by directly connecting to the MQTT service. Get started by cloning the WisBlocks example repo which contains a 01-ESP32WiFi-Sensors folder with the example.
1
git clone https://github.com/qubitro/wisblock-sensornode-example
Copied!
Note that when using the Arduino IDE and our example, you will need to rename the main.cpp file used for PlatformIO to project_name.ino, and all libraries listed in the platformio.ini which need to be downloaded from the library browser.
Go ahead and open the project in your favorite IDE PlatformIO or Arduino, and edit the main.cpp file to enter your device and Wi-Fi credentials. For the device, credentials go into the Qubitro devices page and create a new device, once complete in the settings tab the device ID and token can be copied then pasted into the below section.
1
char ssid[] = "WiFi_ID";
2
char pass[] = "WiFi_PASSWORD";
3
4
char deviceID[] = "PASTE_DEVICE_ID_HERE";
5
char deviceToken[] = "PASTE_DEVICE_TOKEN_HERE";
6
char host[] = "broker.qubitro.com";
7
int port = 1883;
Copied!
After edit the main.h file to enable a sensor's use by removing the comment for the definition, and comment out the lines for sensors you are not using. When you compile it will make a version of the firmware just for your device and sensor choice.
1
#define SHTC3_TEMP_HUM_SENSOR
2
#define LPS22_PRESSURE_SENSOR
3
//#define OPT3001_LIGHT_SENSOR
4
//#define LIS3DH_ACCEL_SENSOR
5
//#define BEM680_ENV_SENSOR
6
//#define UBLOX_GPS
Copied!

Uploading to the ESP32 WisBlock Core

In order to properly put the ESP32 in upload mode, place a jumper on the pins we mentioned to install above and press reset. Then you can just press the upload button (If using the Arduino IDE make sure to select the board type and serial port first.), and once the upload is complete remove the jumper, and press the reset button again to start your new firmware.

Viewing the Data in Qubitro

After powering on the device with the new firmware, you should see the new device in Qubitro as connected and data flowing in. The device should be formatting a JSON document for Qubitro which you can now create widgets for and view in the data tab of a device's page.
Last modified 3mo ago