Description

For LoRaWAN devices, there are two join network methods can be chosen to join network:

  • ABP : Fixed Device Address, Networks Session Key will be burned to device when they leave factory. Node packets can be decoded by multiple network server if multiple network servers are configured with correct node information.
  • OTAA : Dynamic Device Address, Networks Session Key will be generated every time sensor join network, and only one network server which has all correct information to decode the packet content from sensor. So for many usage scenario, OTAA is safer choice than ABP. When using OTAA method, user need confirm whether sensor has joined network successfully, to ensure all data packets can be received and decoded by correct Network server.


Milesight gateway has embedded network server and support above method, all nodes which are conform to standard LoRaWAN protocol can activate (also called “join network”) to it. This guide, we will discuss how to troubleshoot when a LoRaWAN node fails to activate to Milesight gateway built-in network server.


Solution

Tip 1. Go to Packet Forwarder > General and Network server > General, to check that Embedded NS has been enable

Access to gateway web GUI and go to Network Server > Packets to check whether here are sensor packets received by gateway. If not, check below settings.

Tip 2. Check if you fill in correct device EUI to gateway.

Tip 3. Check LoRaWAN signal between node and gateway.

  • Ensure that the distance between node and Milesight gateway are reasonable (≤10km in rural areas, ≤2km in city) and all antennas of gateway have installed correctly as user guide.
  • Ensure you select correct antenna mode in Packet Forwarder -> Radios page, especially when you use external antennas.


Tip 4. Check whether the frequency plan and frequency settings of gateway and node are matched.

Go to Milesight gateway web GUI: Packet Forwarder > Radios, and sensor frequency channel settings interface, to compare all frequency plan and frequency channels are same.

Note: 

1) All frequencies of gateway should cover all sensor frequency channels to ensure gateway can receive all packet sent from any one frequency of node.

2) If node is AU915 but gateway is US915, the gateway cannot detect and receive the uplink packet from the sensor, no matter it’s the join request or sensor data. Please modify the node frequency to US915.

3) If the regional frequency of gateway is AU915, US915, or CN470. Please modify the channel index to more smaller range (8-15) to match gateway default 8 channel frequency.

If there are uplinks seen in gateway web GUI Network Server > Packets page, check uplink packet type.

Tip 5. If packets are JnReq type, which mean that both gateway and sensor frequency settings are correct. Please follow this guide to check whether device information (especially application key) are all correct.

When application key is incorrect, the gateway would not generate any session key here.


Tip 6. If all packets are JnReq and JnACC type, go to Network Server > Gerneral > Channel Plan Setting to delete the Channel Mask, Save & Apply it, then reboot sensor to check once more.


Tip 7. Expand sensor node receive delay time or change spreading factor to make it receive join accepts from gateway. Take Milesight UC11xx controller as example,

1) Change Receive Dealy1=2000 ms, Receive Dealy2=3000 ms.

2) Check if the value of RX2 Datarate is same as Spread Factor



Tip 8. SSH to gateway via root account to change downlink window to RX2.

root@ROUTER:/mnt/mmcblk0p1/log# vi /mnt/mmcblk0p1/lora-server/etc/loraserver/loraserver.json
        "network_settings": {
            "installation_margin": 10,
            "join_delay": 5,
            "rx1_delay": 1,
            "rx1_dr_offset": 0,
            "rx2_dr": -1,
            "rx2_frequency": -1,
            "disable_mac_commands": false,
            "rx_window_auto": true, #### Change this to “false”to use RX2 to send downlink packets.
            "enabled_uplink_channels": [], 
            "extra_channels": [

root@ROUTER:/mnt/mmcblk0p1/log# /etc/init.d/loraserver stop
root@ROUTER:/mnt/mmcblk0p1/log# /etc/init.d/loraserver strat


Tip 9. Enable the Debug option in Maintenance->Log->Log settings. After runnning a few minutes, download the full log for deeper check.


Trouble shooting Examples:

Here are some common examples and the possible reasons for your reference.

1.  Appkey is Error

If you type incorrect app key, lora-gateway-adapter.log will show below logs:

time="2021-09-29T12:04:57+10:00" level=info msg="mqtt/gateway: receive uc error msg" payload="{\"applicationID\":\"1\",\"applicationName\":\"cloud\",\"deviceName\":\"6414B10371250025\",\"devEUI\":\"24e124414b103712\",\"type\":\"JoinError\",\"error\":\"AppKey Error\",\"time\":\"\"}" topic=application/1/device/24e124414b103712/error
time="2021-09-29T12:04:57+10:00" level=warning msg="received error msg" error="AppKey Error" type=JoinError 


2. Receive Windows not Match

If here are related device log file available, and here is related “timeout” error information like below, please change your sensor receive window settings or gateway downlink windows.


[13:57:21.789]IN¡û¡ô=====..\..\public\Ursalink\LoRaWAN\radio\sx1276.c SX1276OnTimeoutIrq:1530 1
[13:57:22.259]IN¡û¡ôenter OnJoinedPacketTimerEvent 310...


[2021-09-09 13:45:57.287]# RECV ASCII>
######===== MLME-Confirm ====######

STATUS     :RX 1 timeout

IsTxTimeoutTimerRunning:false

######===== JOIN FAILED ====######