[CN_470_510] OTAA mode join failed


#1

First thanks for your project.
I’m a newer to lorawan.
I used all the newest code.
I can seen lora-app-server log join-request accepted, but the node join failed.
the command is:
loraserver
./loraserver --net-id 010203 --band CN_470_510 --postgres-dsn postgres://loraserver_ns:loraserver_ns@localhost/loraserver_ns?sslmode=disable --db-automigrate --gw-mqtt-server tcp://127.0.0.1:1883 --log-node-frames --gw-server-jwt-secret Y301pq2kbuKbZHHlrGCsIoiMf7UJAnlEerv8OHYD93Q=

lora-app-server
./lora-app-server --postgres-dsn postgres://loraserver_as:loraserver_as@localhost/loraserver_as?sslmode=disable --db-automigrate --mqtt-server tcp://127.0.0.1:1883 --log-level 5 --jwt-secret Y301pq2kbuKbZHHlrGCsIoiMf7UJAnlEerv8OHYD93Q= --http-tls-cert server.crt --http-tls-key server.key


#2

From the network-server side, the join was accepted. Please check the error log of your gateway / packet-forwarder. Either the gateway was unable to transmit the downlink join-accept response or the node was unable to receive it (could be a firmware issue?).


#4

I try to joined twice, and the packet_forward logs:

JSON up: {“rxpk”:[{“tmst”:6428924,“chan”:5,“rfch”:0,“freq”:471.700000,“stat”:1,“modu”:“LORA”,“datr”:“SF12BW125”,“codr”:“4/5”,“lsnr”:8.0,“rssi”:-76,“size”:23,“data”:“AAEBAAAAAAAARgEtAO3mhkfdBfOqtzs=”}]}
INFO: [up] PUSH_ACK received in 84 ms
INFO: [down] PULL_RESP received :slight_smile:

JSON down: {“txpk”:{“imme”:false,“tmst”:11428924,“freq”:501.7,“rfch”:0,“powe”:14,“modu”:“LORA”,“datr”:“SF12BW125”,“codr”:“4/5”,“ipol”:true,“size”:17,“data”:“INKD5nIphMEtrpTpOxIbAmI=”}}
INFO: [down] a packet will be sent on timestamp value 11428924
TX: 20 D2 83 E6 72 29 84 C1 2D AE 94 E9 3B 12 1B 02 62
INFO: [down] PULL_ACK received in 105 ms
RX: 00 01 01 00 00 00 00 00 00 46 01 2D 00 ED E6 86 47 C1 33 8B 7A EF 44

JSON up: {“rxpk”:[{“tmst”:15678604,“chan”:5,“rfch”:0,“freq”:471.700000,“stat”:1,“modu”:“LORA”,“datr”:“SF12BW125”,“codr”:“4/5”,“lsnr”:7.8,“rssi”:-77,“size”:23,“data”:“AAEBAAAAAAAARgEtAO3mhkfBM4t670Q=”}]}
INFO: [up] PUSH_ACK received in 91 ms
INFO: [down] PULL_RESP received :slight_smile:

JSON down: {“txpk”:{“imme”:false,“tmst”:20678604,“freq”:501.7,“rfch”:0,“powe”:14,“modu”:“LORA”,“datr”:“SF12BW125”,“codr”:“4/5”,“ipol”:true,“size”:17,“data”:“IABkiuT/O3MHPEWc5n9JO3w=”}}
INFO: [down] a packet will be sent on timestamp value 20678604
TX: 20 00 64 8A E4 FF 3B 73 07 3C 45 9C E6 7F 49 3B 7C
INFO: [down] PULL_ACK received in 4 ms

I don’t know how to decode this packet.
When I used the gateway default loraserver, the node can joined successful anytime.


#5

One possible issue could be that the node expects the downlink on a different channel. The gateway things that the uplink was received on channel 5 at 471.7 MHz. However following the specification (CN470):

Calculating 471.7 MHz back following the above specification results in channel 7 (which is what LoRa Server will use as it derives the channel number from the frequency). Then for downlink:

500.3 + (channel 7 * 0.2) = 501.7 MHz

So the downlink frequency matches the JSON down. However the question is what definition is used by your node (as your gateway indicates a different channel than I expected).

Unfortunately I’m unable to verify this as I don’t have any hardware for this ISM band to test with. Hopefully this will give you some starting points for debugging.


#6

+CH: 3; 0,471500000,DR0,DR5; 1,471700000,DR0,DR5; 2,471900000,DR0,DR5;
+RXWIN1: OFF
+RXWIN2: 869525000,DR3
+DR: DR0
+DR: EU868 DR0 SF12 BW125K

I’m not quitely sure the definition, cause my english is poor


#7

I just posted the uplink and downlink channel definition for the 470 MHz ISM band, see above :wink: To request the full LoRaWAN Regional Parameters specification see: https://www.lora-alliance.org/lorawan-for-developers.


#8

I used the gateway default server, and check the log.
Interesting, the up channel and the down channel is same .
I want to change the lora-app-server code to have a try, but I cannot find out where the change channel code is.
Could you help me?


#9

You will find the channel definition here: https://github.com/brocaar/loraserver/blob/master/vendor/github.com/brocaar/lorawan/band/band_cn470_510.go


#11

I changed the down channel and the up channel to the same , now it worked.
This firmware seems did not follow the lorawan standard.
Thanks again brocaar. :kissing_closed_eyes:


#12

hi
I already connected to ttn account server with otaa method but today our devices not join to ttn. I connect ttn with abp method, packets received in gateway but don’t receive in node. i checked appeui deviceeui and appkey are correct.
I built our gateway based on TTN https://github.com/ttn-zh/ic880a-gateway/wiki
my node already connected to ttn with otaa method
and send /receive worked very well
i don’t know what did happen
please help me what is the problem?


#13

The Things Network and LoRa Server are two independent projects. For TTN support see: https://www.thethingsnetwork.org/forum/.


#14

dear brocaar
i just built gateway based on TTN https://github.com/ttn-zh/ic880a-gateway/wiki
i switch to loraserver. my server is loraserver . I already connected to loraserver with otaa method but today our devices not join to loraserver. packets received in gateway but don’t receive in node. please help me what is the problem?


#15

The logs are your friend :slight_smile:


#16

you are my friend too, i am beginner in lorawan, please help me to solve this problem.


#17

But I don’t have a crystal ball :wink: There are many things that could go wrong and to find out what exactly is going wrong, you need to look into the logs and work from there.


#18

Hi,
How chang the down channel and the up channel to the same?Thank you!


#19


I cannot connect to loraserver. When I use TTN connection, its downlink frequency is 505.3, but lorasever is not OK.


#20

The frequencies look correct to me:

  • Uplink = 486.5 = channel 81
  • Downlink = 506.9 = channel 33

Formula to get downlink from uplink channel for CN470 = 81 % 48 = 33


#21

it always fails to join successfully, but when I modify the node
#define CN470_FIRST_RX1_CHANNEL ( (uint32_t) 500300000 ) //( (uint32_t) 506700000 )
, it can join successfully very quickly. I don’t know what is wrong with the setting.