Welcome to the Pycom forum Forum
    • \[\[global:header.categories\]\]
    • \[\[global:header.recent\]\]
    • \[\[global:header.tags\]\]
    • \[\[global:header.popular\]\]
    • Login

    Explore Pybytes | Official Documentation | Report a Firmware Bug/Issue | GitHub

    How to accomplish lora.nvram_restore() ?

    Scheduled Pinned Locked Moved LoPy
    lopy nvram
    4 Posts 2 Posters 1.4k Views 2 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • J Offline
      jalperin
      last edited by

      I'm trying to understand saving & restoring lora nvram.

      In boot.py I connect to TTN, send a packet, and do "lora.nvram_save()".
      the packet is received.

      main.py is:
      from network import LoRa
      import socket
      lora = LoRa(mode=LoRa.LORAWAN)
      lora.nvram_restore()
      s = socket.socket(socket.AF_LORA, socket.SOCK_RAW)
      s.setsockopt(socket.SOL_LORA, socket.SO_DR, 3)
      s.setblocking(False)
      s.send('LoRa Continues')

      The second packet is not received.

      I've also tried lora = LoRa(). Also no success.

      Any idea what I'm missing?

      1 Reply Last reply Reply Quote 0
      • J Offline
        jalperin
        last edited by

        Update.

        comment out lora.nvram_restore() and the second message is received.

        Do I need more code or is the restore messing up?

        J 1 Reply Last reply Reply Quote 0
        • J Offline
          jcaron @jalperin
          last edited by

          @jalperin you only need to use nvram_save / nvram_restore if you use deep sleep.

          Also I'm not quite sure what's your logic for having some of the code in boot.py and some in main.py. Both are executed sequentially.

          1 Reply Last reply Reply Quote 2
          • J Offline
            jalperin
            last edited by

            Yes, thank you. I know I only need save/restore for deepsleep. But was testing it without deepsleep. Shouldn't it still work?

            Still looking for any posted example of use of save / restore.

            Yes, splitting code irrelevant if deepsleep.

            1 Reply Last reply Reply Quote 1

            Hello! It looks like you're interested in this conversation, but you don't have an account yet.

            Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

            With your input, this post could be even better 💗

            Register Login
            • 1 / 1
            • First post
              Last post

            Pycom on Twitter

            Pycom