How are the disconnection events triggered for LoRaWAN gateways?

0

Hi!

According to the documentation, IoT Core supports publishing messages to notify you of connection status events for LoRaWAN gateways.

My question is: what is the criteria to trigger a "disconnect" event? Does IoT Core somehow periodically ping the gateway, or is there a timeout based on the last uplink message received from any IoT device sending data through the gateway?

Thank you in advance for your response

asked a year ago340 views
1 Answer
0
Accepted Answer

Hi. The Basic Station LNS protocol uses WebSocket as the transport protocol: https://lora-developers.semtech.com/build/software/lora-basics/lora-basics-for-gateways/?url=tcproto.html.

WebSocket is a connection-oriented protocol. For graceful closing of the connection, there is a closing handshake: https://datatracker.ietf.org/doc/html/rfc6455#section-1-4. You can see this implemented in Basic Station here: https://github.com/lorabasics/basicstation/blob/ba4f85d80a438a5c2b659e568cd2d0f0de08e5a7/src/net.c#L639. If Basic Station shuts down, it will send this handshake, causing AWS IoT Core for LoRaWAN to detect the disconnection immediately.

For less graceful situations, such as sudden power loss, WebSocket has the ping-pong mechanism: https://datatracker.ietf.org/doc/html/rfc6455#section-5-5-2. Here is where Basic Station will send a pong if it receives a ping from the LNS: https://github.com/lorabasics/basicstation/blob/ba4f85d80a438a5c2b659e568cd2d0f0de08e5a7/src/net.c#L577-L592.

It takes ~2 minutes to detect disconnection if I cut power to my gateway.

profile pictureAWS
EXPERT
Greg_B
answered a year ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions