LoRa nvram state

  • I am making a device, which will use lora.nvram_restore() and lora.nvram_save(). My device will move alot, so it will send lora packets using different lora stations.
    Does lora.nvram_save and restore commands save state for one station only? Or will my device be able to send packets even if it is far far away from the last place and station?

  • @jcaron Thanks a lot!

  • @Sudosu132 In LoRaWAN, there is no state involving gateways, except for the very short time between an uplink and the associated downlink (and that's on the gateway, not on the device).

    All state between transmissions (frame counters, ACKs, channels, settings...) only involves the end-device and the network server (LNS).

    Even without moving your device at all, transmissions from your device could be received by multiple gateways, and this could change from one transmission to the next based on local interference and other environmental conditions. It's the LNS which will sort all of this out. The gateway just forwards what it receives, and the end-device has no idea what gateway it is talking to (it just blindly sends data and hopes a gateway will be able to receive it). Even for confirmed packets, it's the LNS which will trigger sending the ACK (in the case the same packet is received through several gateways, it will be the one picking which gateway sends the ACK).

    So yes, you can save state, go to sleep, and restore it later in a different place, as long as there is (at least) one gateway which can receive the packets and is connected to the same network, it should all work.

    Note that this is based on a network using the same frequency plan and settings in all locations, which it should.

  • I mean if I use my device in New York for example and then it does lora.nvram_save and deepsleeps until it is in California and then does lora.nvram_restore and sends packets. Will it work? Or has the device to be in the same place all the time to make save and restore commands to work?

  • Global Moderator

    Im not exactly sure what you mean here..
    The lora.nvram_save() can be used before (for example) deepsleep, to save the current OTAA credentials and packet number to name a few, in the nvram, so that they can be restored after waking up by using lora.nvram_restore().

Log in to reply

Pycom on Twitter