Device network connection status

When I use the SX1262, how should I know first that my device exited the gateway. For example, the gateway is out of power, or the gateway is malfunctioning.
What I know now is that I can send an AT command LinkCheck message to determine the status of the network connection, but I want to know it first, just like WiFi. Is there a way?

Without some effort you don’t. LoRaWAN is a broadcast system where your node shouts and ALL gws in range hear and pass on the nodes message to the NS. What you worry about is has your node lost its session on the NS. Nodes do not connect to gws……this is not WiFi….they connect to the network. If you look at your device/application data on the TTN console the expanded metadata will show all gws that hear that message. Your gw view in the console will also show if your gw hears the node. If no messages get through then you worry about the operation of the device. If gw view shows no messages it’s a node problem most of the time….even a foreign or unconnected node will show as traffic. If message appears on gw but not in application or device view then it’s usually a session or ‘connection’ issue with the node on the network - check keys etc. If no message on gw view but data appears in device or application view the other gws are carrying the load for you and likely there is a problem with your gw….check it’s connected to NS ok and is powered, has internet connection, etc.

….there are other subtleties and variations to worry about but that covers 90% of overview fault finding ime.

First, please don’t add your questions on to a different topic - we are all volunteers and we answer when we can - double posting causes confusion and you may find we don’t answer either of them, so rather than speeding things up, it could slow things down.

They don’t and you can’t:

Devices transmit, gateways hear - there is no ‘connection’ between them.

As such there is no way that a device can know that it is transmitting and not being heard.

This is why overlapping coverage of gateways is a good idea and that the LinkCheck MAC command exists.

The LoRaWAN Alliance best practises doc TR007 lays out a recommended scheme. Bear in mind that a LinkCheck generates a downlink response which will stop the gateway from hearing other devices uplinks whilst it is transmitting and the Fair Use Policy limits you to 10 a day.

However, as the LinkCheck sends back the number of gateways and the best margin, a device can also use some local intelligence to decide how paranoid it should be about connectivity - if it’s being heard by two or more gateways with a healthy margin and that’s been consistent, then it’s probably OK to extend the time between checks.

On the other hand, if you are trying to design a level of failsafe in to the whole LoRaWAN scheme, you are not the first and you are likely to make a tangled mess of your firmware because you will be trying to do things that LoRaWAN was not designed for - which is low power / long range sensors with an expectation of around 10% packet loss due to local RF issues and no guarantee on timescales for deliverability in either direction.

If there is an alarm raised due to the sensor reading being out of norm, then by all means get a little bit more proactive with uplinks with the expectation of an acknowledgement from your backend and escalate from there.

The best you can do if you want to ensure zero data loss is to store data on device and have a mechanism for requesting missing data. But if the device is in an area that does suffer significant RF issues, you probably need to rethink your choice of data transport.

Have you read the Learn section as suggested 3 days ago - like the double posting, the volunteers may choose to wait for you to learn the basics before answering more questions.

1 Like

Sorry, I’m in a bit of a hurry. I did my best to study, but the progress was a bit slow.

I want to bake a cake but I don’t have time to read the instructions. So I ask questions but because I haven’t read the instructions I don’t understand the answers because the equipment I need & the settings are all new to me.

It is not possible to implement LoRaWAN at the level of using MAC commands until you have at least got the basics under your belt. Even then most developers won’t code LinkCheck requests in to their firmware, so you are trying to run before you can crawl.