“ESP32 + LoRa” 节点准备和配置参数



  1. Install Arduino IDE. How to install please click here.

  2. Install Heltec ESP32 series Arduino development framework. Installation manual please refer to here.

  3. Install Heltec_ESP32 Library.

  4. An ESP32 + LoRa node.

  5. High quality USB cable.


  1. Connect the development board to the computer through USB data cable.

  2. Open the Arduino and in the Tools option, select the appropriate Board, Port.

  1. In Tools option, Board, Upload Speed, CPU Frequency, Core Debug Level, PSRAM are ESP32 chip’s normal option, just keep default. Special notice the LoRaWan Region, LoRaWan Debug Level, LoRaWANDEVEUI.

  • LoRaWan Region – 严格遵守LoRaWAN 协议区域定义LoRaWAN™ 1.0.2 Regional Parameters rB;

  • LoRaWan Debug Level** – 通过串行端口打印的消息.

    • None –默认;

    • Freq – 上/下行频率;

    • Freq && DIO – 上/下行链路频率和DIO中断信息;

    • Freq && DIO && PW – 上/下行链路频率,DIO中断信息和低功耗状态.


    • CUSTOM – 由用户在DevEui数组中定义的代码,8个字节

    • Generate By ChipID –根据芯片的Chip ID生成,选择此选项将覆盖代码中DevEui数组中的设置.

  1. Follow the path shown below to open the LoraWAN demo code.

  1. Fill in DevEu AppEui AppKey in the following figure in the red box in the example format, which will be used in the website registration.

  • 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;


This example uses the OTAA pattern as an example, and for the differences in the ABP pattern, please refer to this link: ABP mode

  1. Effective load is here.



  1. Other relevant parameters are in the .ino file, You can come back to it after you know lorawan well.

  2. Click Upload to upload the code.