arduino-libraries / MKRWAN

An Arduino library for sending and receiving data using LoRaWAN protocol and LoRa® radios.
https://www.arduino.cc
GNU Lesser General Public License v3.0
86 stars 60 forks source link

Exchanging MAC Commands #80

Open tohlh opened 4 years ago

tohlh commented 4 years ago

Hello, I am trying out MAC commands on my MKRWAN 1310. I am currently testing it with a ChirpStack server. The MAC commands are sent with AT+SENDB=0:xx.

I started out my test with AT+SENDB=0:02, which will initialize a LinkCheckReq from the end node to the server. This is what I saw on the server page, we can clearly see that LinkCheckReq is received from the uplink:

Screenshot 2020-05-21 at 12 30 23 PM

Following the above, the server responded with a downlink of LinkCheckAns in FOpts. Screenshot 2020-05-21 at 12 30 45 PM Screenshot 2020-05-21 at 12 30 56 PM

The question is how do I receive and "see" the LinkCheckAns payload on my MKRWAN? I also tested this on firmware 1.3.0 on PR #78 .

facchinm commented 4 years ago

During normal operations, downlink messages will be received via an unsolicited message starting with +RECV (https://github.com/arduino-libraries/MKRWAN/blob/master/src/MKRWAN.h#L920). If you don't receive anything it could be that the message has only been enqueued (and another message needs to be sent in order to receive it) or the RX windows are too tight. FW 1.3.0 uses a different message to report the downlink but the rationale is the same. Hope it helps!