“ESP32 + LoRa” Preparation & Config Parameters
Arduino IDE. How to install please click here.
This library must work with Heltec WiFi_Kit_series Arduino development framework. Installation manual please refer to here.
A gateway already connected a LoRa server.
We provided a ESP32 LoRaWAN library, which migration from the LoRaMac-node library:
Choose one of the following method to install this library:
download a zip file from GitHub using the “Download ZIP” button and install it using the IDE (“Sketch” -> “Include Library” -> “Add .ZIP Library…”
clone this git repository into your sketchbook/libraries folder.
For more information, see https://www.arduino.cc/en/Guide/Libraries.
No matter what LoRa management platform is used, DevEui, AppKey, etc. parameters are must needed. And ensure that it is consistent with the relevant settings on the server.
The following parameters are essential for OTAA mode:
DevEui – Mote device IEEE EUI (big endian), 8 bytes;
AppEui – Application IEEE EUI (big endian), 8 bytes;
AppKey – AES encryption/decryption cipher application key, 16 bytes;
The following parameters are essential for ABP mode:
NwkSKey – AES encryption/decryption cipher network session key, 16 bytes;
AppSKey – AES encryption/decryption cipher application session key, 16 bytes;
DevAddr – Device address on the network (big endian), uint32_t;
Choose an example from menu
File -- Examples -- ESP32_LoRaWAN -- OTAA.
The LoRaWAN relevant parameters are in the
.ino file, fix it in the code directly.
Choose Frequency Band
There are some options in the Arduino Tools menu:
Board, Upload Speed, CPU Frequency, Core Debug Level, PSRAM are ESP32 chip’s normal option, just keep default. Special notice the
LoRaWan Region and
LoRaWan Debug Level:
LoRaWan Region – LoRaWAN protocol region definition, strictly follow LoRaWAN™ 1.0.2 Regional Parameters rB;
LoRaWan Debug Level – Messages printed via serial.
None – Default;
Freq – Uplink/downlink frequency;
Freq && DIO – Uplink/downlink frequency and DIO interrupt information;
Freq && DIO && PW – Uplink/downlink frequency, DIO interrupt information and low power status.
LORAWAN_DEVEUI – LoRaWAN Device EUI generate method
CUSTOM – Defined by the user in the DevEui array of the code, 8 bytes;
Generate By ChipID – Generated according to the Chip ID of the chip. Selecting this option will override the setting in the DevEui array in the code.
Print too much messages may cause the system unstable.