JaapBraam / LoRaWanGateway

A LoRaWan Gateway in LUA
MIT License
223 stars 74 forks source link

Node doesn't receive ack back #20

Closed mexcool closed 7 years ago

mexcool commented 7 years ago

Hello,

I have the gateway up and running. It is forwarding the packets sent by the node to the TTN server and I can see them in the console. However, it seems that when the node sends a confirmed packet, the ack coming from the server does not reach the node. I can see that the gateway receives and apparently forwards the ack. I have also tried to simulate a downlink from the TTN console and seems to be working. I can't really see if what the gateway forwards is the simulated packet or something else because it is encrypted. Nevertheless, the address of the node is correct in both case. But I can't see the node receiving anything back (looking at the serial port of the node).

This is the output of the gateway:

rxpk 0142aa00600194f42f10187b message {"rxpk":[{"rssi":-42,"stat":1,"modu":"LORA","rfch":1,"tmst":2060746683,"datr":"SF7BW125","lsnr":9,"time":"2017-03-09T06:54:13.361317Z","codr":"4/5","data":"gGcZAiaA8AAB//oKi+EvV/YMaUY=","freq":903.900,"chan":0,"size":20}]} length 234

txpk {"txpk":{"imme":false,"tmst":2061746683,"freq":923.3,"rfch":0,"powe":20,"modu":"LORA","datr":"SF7BW500","codr":"4/5","ipol":true,"size":13,"data":"YGcZAiYgiQABNX0/eg=="}}

txpk_ack {"txpk_ack":{"error":"NONE"}}

transmitPkt 11626 6461 -1 923300000 112 144 2 64 20 13

And this is from the node:

215627791: TXMODE, freq=903900000, len=20, SF=7, BW=125, CR=4/5, IH=0 Packet queued Device addresss is: 637671783 215693479: RXMODE_SINGLE, freq=923300000, SF=7, BW=500, CR=4/5, IH=0 215756338: RXMODE_SINGLE, freq=923300000, SF=9, BW=125, CR=4/5, IH=0 215896595: EV_TXCOMPLETE (includes waiting for RX windows) Setting next callback 215902911: engineUpdate, opmode=0x800

I am using the LMIC-Arduino library developed by Matthijs Kooijman. Since I am not sure whether I'm doing something wrong on the gateway side or node side, I will also post this on his repo.

Thanks!

Asier

mexcool commented 7 years ago

It was a node problem. I had to make a little bit bigger the receive window by adding

// Let LMIC compensate for +/- 1% clock error LMIC_setClockError(MAX_CLOCK_ERROR * 1 / 100);

Thanks and sorry for the trouble!