Is there a way to quit an active lora session??



  • Hey guys!
    I'm developing a lopy4 + pysense node (which will be moving) to transmit with a nano gateway over OTAA using LoRaWAN.

    my question is.... when is in range (lora session active) and goes out of range it continues to send messages as the session remains active....

    So, is there anyway to update the lora.has_joined() value or to quit the session that was on when it was in range??

    Thank you



  • If you are saving the session information to nvram then you can use the lora.nvram_erase() to remove them, then you'll need to do a join to be able to send more data.

    Andrew



  • @morrison note that contrary to other wireless technologies, a device usually does not know if it’s “in range”. There are usually no beacons from the gateway, and as @robert-hh pointed out, normally little downstream traffic.

    Actually, even receiving something from a gateway does not mean the gateway will receive what you send: since they are often on different frequencies, data rate and/or power settings, links can be quite asymmetric.

    LoRaWAN is pretty much “I send and I hope someone gets it”. Note that conversely, you could very well have the same frame received by many different gateways at the same time.



  • @morrison As soon as you know that you are out of range you can call lora.nvram_save() and quit transmitting. If you want to recover, call lora.nvram_restore().
    The questions, how can you tell whether the device is out of range.
    You can use confirmed messages to tell, whether still messages arrive. Those messages will be repeated by the Lora software stack until a confirmation arrives, and the callee can tell success or failure. But most providers allow a limited amount of downlink messages only. We are talking of 10. Although in my TTN gateway I see nodes with thousands of downlink messages per day, despite that limit.



  • @robert-hh said in Is there a way to quit an active lora session??:

    here is no session concept besides local states. Once in a lifetime or at least rarely the communication keys are established and the transaction counter is set to 0. That is done via the OTAA protocol or manually via ABP. The in internal state of being joined also tells, that the keys and counter are loaded in the software stack. This data is to be stored in with lora.nvram_save() before you finish communication and restored with lora.nvram_restore(). After that, lora.has_joined() will return True. No need to rejoin e.g. by OTAA.

    So what do you suggest i do when the node leaves range of the gateaway and it keeps sending messages nowhere because lora.has_joined is set to True??



  • @morrison In Lora there is no session concept besides local states. Once in a lifetime or at least rarely the communication keys are established and the transaction counter is set to 0. That is done via the OTAA protocol or manually via ABP. The in internal state of being joined also tells, that the keys and counter are loaded in the software stack. This data is to be stored in with lora.nvram_save() before you finish communication and restored with lora.nvram_restore(). After that, lora.has_joined() will return True. No need to rejoin e.g. by OTAA.


Log in to reply
 

Pycom on Twitter