Currently there is no method to check if a node is really still joined to TTN or if the gateway/s in range, is/are still up and running.
The "join bit" of "mac get status" response is not reliable... indeed if the only gateway in range is stopped this bit continues to return 1 (joined). Nothing strange since the rule is fire-and-forget.
A work around could then use "mac set linkchk nnn".
This function sets the time interval for the link check process to be triggered periodically. A of ‘0’ will disable the link check process. When the time interval expires, the next application packet that will be sent to the server will include a link check MAC command. Refer to the LoRaWAN Specification V1.0 document for more information on the link check configuration.
Thanks to this command is it possible then get the number of gateways in range and the demodulation margin in dB returned on the last check.
NB: to not disobey at the TTN Fair Access Policy is in charge of those who use it to make the number of downlink stay within the limits allowed. The max value for "nnn" is 65.535 which corresponds to an interval of 18 hours about.
I've tested this method on my end node and gateway and it seems realiable, see this piece of log:
Explanation: after the classic OTAA the values returned was "-- GATEWAYS 1 - MARGIN 16" then I stopped the "ttn-pkt-fwd" service and it became "-- GATEWAYS 0 - MARGIN 255"... then restarting again "ttn-pkt-fwd" returned to be "GATEWAYS 1 - MARGIN 17".
Currently there is no method to check if a node is really still joined to TTN or if the gateway/s in range, is/are still up and running. The "join bit" of "mac get status" response is not reliable... indeed if the only gateway in range is stopped this bit continues to return 1 (joined). Nothing strange since the rule is fire-and-forget.
A work around could then use "mac set linkchk nnn".
This function sets the time interval for the link check process to be triggered periodically. A of ‘0’ will disable the link check process. When the time interval expires, the next application packet that will be sent to the server will include a link check MAC command. Refer to the LoRaWAN Specification V1.0 document for more information on the link check configuration.
Thanks to this command is it possible then get the number of gateways in range and the demodulation margin in dB returned on the last check.
NB: to not disobey at the TTN Fair Access Policy is in charge of those who use it to make the number of downlink stay within the limits allowed. The max value for "nnn" is 65.535 which corresponds to an interval of 18 hours about.
I've tested this method on my end node and gateway and it seems realiable, see this piece of log:
Explanation: after the classic OTAA the values returned was "-- GATEWAYS 1 - MARGIN 16" then I stopped the "ttn-pkt-fwd" service and it became "-- GATEWAYS 0 - MARGIN 255"... then restarting again "ttn-pkt-fwd" returned to be "GATEWAYS 1 - MARGIN 17".