This guide will instruct you to create a DIY LoRaWAN node using ESP32, RFM95 module and RadioLib.

  • The guide is applicable to all ESP32 variant and RFM95 module with minor difference.
  • The guide uses ESP32 Dev Module and RFM95 for 915/923Mhz.
  • The node will support LoRaWAN 1.1.0, Class A and uplink/downlink feature. LoRaWAN 1.0.x is still backward supported. Class B and C are not supported yet.
  • Product link: ESP32 and RFM95. AIThinker Ra01/02/01h is supported too.
  • Source code: From Easy LoRaWAN.

ESP32 Dev Module:

HopeRF RFM95

AI-Thinker ra01/02/01h

Step 1: To wire LoRa module to ESP32 as below

  •  LORA_SS              25 // Must have pull up resistor
  •  LORA_SCK           18 // Default SCK for VSPI in ESP32
  •  LORA_MOSI         23 // Default MOSI for VSPI in ESP32
  •  LORA_MISO         19 // Default MISO for VSPI in ESP32
  •  LORA_DIO0          26
  •  LORA_DIO1          35
  •  LORA_DIO2          34
  •  LORA_RESET       27

Step 2: Install softwares and libraries

  • To install Arduino IDE at here
  • To add Arduino support for ESP32: here
  • To install UART driver: Check section B2 here

Step 3: To import RadioLib library

Step 4: To download source code at the top of the guide

Step 5: To modify GPIOs  to fit your board wiring in config.h

  • To use SX1276 for EU868, US915, AU915, AS923, AS923_2, AS923_3 and AS923_4
  • To use Sx1278 for CN470

Step 6: To change your JOIN_EUI, APP_KEY, NWK_KEY and Region

Step 7: Upload the code to the node

Step 8: To configure your gateways and LoRaWAN server

Step 9: After step 8, you can see the node sending uplink data to server and receiving downlink data from the server.

Enjoy.

4.5 2 votes
Article Rating
Subscribe
Notify of
guest
10 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
Kevin

Hi,
Do you have some guides to create a DIY LoRaWAN node using STM32 board?
Thanks a lot.

Jon

Will this DIY node work with my RAK gateway and Dragino gateway?
Thanks in advance.

Mark

Does this code work with LoRaWAN 1.0.x?
Thanks a lot.

Johnson

Thanks alot for the guides.
The OTAA is working great.

Logan

Why my downlinks are pending a while in server before getting downloaded to the LoRaWAN node?
Thanks.

Want to explore LoRaWAN?

Subscribe Easy LoRaWAN Cloud to try all guides and visualize data from your LoRaWAN nodes.
Only 1 USD/month.