things4u / ESP-1ch-Gateway

Version 6 of the single channel gateway
MIT License
370 stars 149 forks source link

OTAA Not Working #102

Open QuiteFranklyy opened 3 years ago

QuiteFranklyy commented 3 years ago

I am having an issue with registering devices using OTAA. On the server I see the join request being processed and accepted, as seen here. It also sends the downlink back to the gateway. image The gateway appears to be forwarding the downlink message on to the device as well, as seen below:

v txLoraModem hi:: micr=212.664967, tmst=212.966142, wait=301175, freq=923300000, sf=10, bw=244, powe=27, crc=0, imme=0, iiq=40, prea=0, rfch=0, ncrc=1, size=33, strict=0, a=ba:90:5c:c3: datal=0 data= [ ]
v txLoraModem lo:: , size=33, old=[ 20 c3 5c 90 ba c4 cf ac ed c2 31 1f 99 f7 3d ff ca 3c 26 29 5a 49 d9 52 72 7d ed 01 f5 8b 15 4f b9 ]
v PULL_RESP:: token=512, size=0, IP=52.65.242.31, port=1700, prot=2, mics=317109821
v txLoraModem hi:: micr=317.111503, tmst=317.155887, wait=44384, freq=923300000, sf=10, bw=244, powe=27, crc=0, imme=0, iiq=40, prea=0, rfch=0, ncrc=1, size=33, strict=0, a=40:b6:2d:45: datal=0 data= [ ]
v txLoraModem lo:: , size=33, old=[ 20 45 2d b6 40 7c 43 d7 c8 9f bf bd 20 db 6d 41 15 d6 94 ff ce 15 cb c6 6f 52 2d 46 ba 21 da 6a 5b ]
v OK, stateMachine TXDONE: rcvd=317.600824, done= 0.445020
v PULL_RESP:: token=768, size=0, IP=52.65.242.31, port=1700, prot=2, mics=515445809
v txLoraModem hi:: micr=515.447486, tmst=515.755932, wait=308446, freq=923300000, sf=10, bw=244, powe=27, crc=0, imme=0, iiq=40, prea=0, rfch=0, ncrc=1, size=33, strict=0, a=88:fb:1e:b8: datal=0 data= [ ]
v txLoraModem lo:: , size=33, old=[ 20 b8 1e fb 88 dd 8e 53 2c e2 6e 9e e6 87 97 0b 69 15 bc f0 71 6d 03 75 54 42 81 fd 3c cb 48 cb ee ]
v OK, stateMachine TXDONE: rcvd=516.200819, done= 0.444979

However the device itself is not receiving the join accept message. Once it receives a join accept message, it starts sending data. However it just continually sends join requests, indicating it is not receiving the join accept message.

I have tried adjusting the frequency and spreading factor, the defaults did not work (916.8 MHz and SF9) and the above configuration (923.3 MHz and SF10) also did not work.

I am wondering if it is a timing issue regarding the join request window, I have modified the RX1 delay to be 5000 milliseconds, but this did not fix the issue.

I am aware of ABP however it is not feasible for this project.

If anyone has managed to get OTAA working I would be very interested in knowing how.

Cheers.

IoTThinks commented 3 years ago

I haven't tried OTAA with this library. And I would like to know if anyone is able to do OTAA with this library too.

However, I believe OTAA needs minimum of two frequencies (AS923) or even three frequencies (EU433...) or even more for US915.

May be the LoRaWAN receives the join-request from frequency OTAA 1 from node and sends back the Join-accept to gateway to node via OTAA 2. So the Join-accept message will be missed.

May be you can check if the server sends back in another frequency (OTAA 2)?