Uplink DHT11 Data and Display on OLED Display
In this project, you will use the Antares Workshop Shield on the Lynx-32 Antares Development Board module. The Antares Workshop Shield contains temperature, humidity (DHT11), relay, LED and push button sensors. You will monitor the temperature and humidity according to the specified interval period. The results of the data sent by the sensor can be monitored through the Antares console.

Prerequisites
The required materials follow the General Prerequisites on the previous page. If you have not prepared the requirements on that page, then you can visit the following page.
General Prerequisites ESP32 LoRaThe additional materials specific to this project are as follows.
Shield Workshop Antares
SSD1306 0.96inch 128x64 pixel OLED module based on I2C.

DHT11 Library. This documentation uses DHT11 Sensor Library version 1.4.4.
OLED display library. This documentation uses Adafruit_SSD1306 version 2.5.7.
Follow These Steps
1. Launch the Arduino IDE application
2. Opening Sample Programme
Here is the programme code of the UPLINK_DHT11_OLED_CLASS_A example.
Here is the programme code of the UPLINK_DHT11_OLED_CLASS_C example.
3. Set LoRaWAN Parameters in Antares
On the Antares Device console page, set LoRa by pressing the Set LoRa button as shown below.

Input LoRaWAN parameters with Lora Device Class A, Activation Mode ABP, ABP Parameters Inherit as shown below.
Don't forget to save (copy) the Network Session Key and Application Session Key parameters before clicking Set LoRa to facilitate the next process.

Make sure your antares account has an active LoRa package.
Input LoRaWAN parameters with Lora Device Class C, Activation Mode ABP, ABP Parameters Inherit as shown below.
Don't forget to save (copy) the Network Session Key and Application Session Key parameters before clicking Set LoRa to facilitate the next process.

Make sure your antares account has an active LoRa package.
4. Set LoRaWAN Parameters in Programme Code
Change the LoRaWAN ABP parameters in the following variables *devAddr , *nwkSkey and *appSKey. Adjust to the parameters in the Antares console.

If you forgot to save *nwkSkey and *appSKey in the previous step then look at the accesskey in your antares account then follow the following format.
5. Compile and Upload Program
Connect the Lynx-32 Development Board to your computer and make sure the Communication Port is read.

Set up the Lynx-32 Board by clicking Tools > Board > ESP32 Arduino in the Arduino IDE, then make sure the board used is the ESP32 Dev Module. Select the port according to the communicaion port that is read (in this case COM4). The result will look like the following picture.

After all the setup is complete, upload the programme by pressing the arrow icon as shown below. Wait for the compile and upload process to finish.

If the programme upload is successful, it will look like the following image.

After uploading the programme, you can view the serial monitor to debug the programme. The serial monitor icon is shown in the following image.

Set the serial baud rate to 115200 and select BothNL & CR. The result will look like the following image.

Make sure the serial baud rate matches the value defined in the programme code. If the serial baud rate is not the same between the programme code and the serial monitor, the ASCII characters will not be read properly.
6.OLED Display Results
Next you can look at the OLED display connected to the Antares Shield Workshop. The result is as shown in the following image.

7. Check Data in Antares
After uploading the programme successfully, then open the device antares page and see if the lora data has been successfully sent.


Last updated