This tutorial will show you how to set up a LoRaWAN470 gateway and nodes using the M5 BASIC core and Module LoRa (433MHz) , and communicate with TTN . The firmware is available on Burner , and users can set parameters through Burner.
Hardware list:
BASIC Host: 3 units (1 gateway, 2 nodes)
Module LoRa (433MHz): 3 units (1 gateway, 2 nodes)
ENV-II Unit: 2 units
Assemble the 433 module, ENV-II Unit, and core host, with two acting as LoRaWAN terminals and one as a LoRaWAN gateway.
Note: The Module LoRa (433MHz) needs to connect DIO1 to GPIO34
Note: The first time you burn it, you will be prompted to enter M5BurnerNVS for settings.
This will take us to the BurnerNVS setting program by clicking button B.
Essential parameters to set:
1. WIFI_SSID: WIFI SSID
2. WIFI_PASS: WIFI password
3. Keep other parameters as default.
4. After completing the settings, click the B button on the host to restart the host, completing the gateway firmware configuration.
First, open TTN ’s official website and register an account.
Note: For illustrations, see our tutorial TTN(The Things Network) .
The gateway's default server is nam1.cloud.thethings.network.
Essential parameters to set:
Gateway ID: human-readable string.
Gateway EUI: The "GW EUI" on the host screen, generated based on the MAC address, ensuring global uniqueness.
Schedule downlink late: Checked for downlink functionality.
Frequency plan: Select China 470-510MHz, FSB11.
Keep other parameters as default, successfully registering the gateway on TTN.
Create an application.
In this application, create two nodes with the network entry type OTAA
, obtaining DEVEUI
, APPEUI
, and APPKEY
for each device.
Note: For illustrations, see our tutorial TTN(The Things Network) .
Essential parameters to set:
Frequency plan: Select China 470-510MHz, FSB11.
LoRaWAN version: LoRaWAN Specification 1.0.2.
Regional Parameters version: Choose revision B.
Keep other parameters as default, successfully creating the nodes on TTN.
Open the M5burner application and burn the node firmware.
Click "info"->"burner setup" to enter the BurnerNVS setting program.
Open M5Burner to enter the BurnerNVS setting interface for configuration.
Essential parameters to set:
1. APPEUI: Generated by TTN, can be queried on TTN.
2. DEVEUI: Generated by TTN, can be queried on TTN.
3. APPKEY: Generated by TTN, can be queried on TTN.
4. Keep other parameters as default, completing the node firmware configuration.
We used the CayeneLPP library to encapsulate information, and the decoding type in TTN needs to be changed to CayeneLPP to see the data uploaded by the nodes.
After completing the above steps, the nodes will collect environmental information through the ENV-II Unit and upload it to TTN every
20 seconds, consistent with the temperature and humidity data displayed on the nodes.
We can add downlink information to the downlink queue on TTN's website, so the node will receive a downlink message after the next Uplink upload, and the data displayed on the node will be consistent with the set data.
Start page:
From top to bottom:
1. Title bar: LoRaWan470 GW
2. Status light: green flashing during normal operation, yellow during initialization
3. GW EUI: Unique ID for each gateway, generated from the MAC address
4. Freq: Listening frequency and spread factor
5. Uplink: Number of LoRa data packets uploaded by the gateway
6. Downlink: Number of LoRa data packets downloaded by the gateway
7. Recently Node: Most recent communication node address and RSSI
8. Buttons:
1. info: Access information page.
Information page:
From top to bottom:
Click "info" -> "burner setup",
When needing to connect to other gateways, just modify the frequencies of CHANNEL0 - CHANNEL8.
If needing to use ABP mode for networking, just enable ABP_ENABLE
,
Note: On the TTN ABP node management page under General settings
-> Network layer
-> Advanced MAC settings
, change Rx1 delay
to 5s
, and check the Resets frame counters
option.
If we need to use ABP mode for network entry, we simply need to enable ABP_ENABLE
,
Note: On the TTN ABP node management page under General settings
-> Network layer
-> Advanced MAC settings
, change Rx1 delay
to 5s
, and check the Resets frame counters
option.
By following these steps, the node can be configured for ABP mode entry, enabling direct communication with the network without the need for OTAA's join procedure. This simplifies the process for devices in static environments or when quick network re-connection is needed without going through the join procedure again.