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

    Sipy crashes when attempting to initialise Sigfox twice.

    Scheduled Pinned Locked Moved Issues & Bugs
    sipysigfoxbug
    3 Posts 1 Posters 1.2k 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.
    • A Offline
      aevraewrvaervea
      last edited by

      Has anyone tried to execute the following line from the documentation twice:

      sigfox = Sigfox(mode=Sigfox.SIGFOX, rcz=Sigfox.RCZ4)

      The first time I do it, everything is fine and I can carry on setting up Sigfox and send a message. But if I accidentally execute this line again without resetting the board, e.g., by clicking run in Pymakr, the board crashes shortly afterwards. I say "shortly" because if I include some print statements after the line, 2 or 3 of them will get executed before it locks up. The only way out is to reset the board. I have the latest firmware and latest Pymakr.

      My current workaround is to put this line in boot.py so it is very unlikely I will accidentally execute it twice between resets.

      A 1 Reply Last reply Reply Quote 0
      • A Offline
        aevraewrvaervea @aevraewrvaervea
        last edited by

        @aevraewrvaervea Having done more investigation, the type of reset I do before next calling this line is critical. The following are effective and do not result in any crashes:

        Power cycling (unplugging and plugging USB connector).
        Pushing reset button on PCB.
        machine.deepsleep(1).

        The following initially appear to cause a successful reset but will result in the board crashing the next time the above line is executed:

        Typing CTRL-D in Pymakr.
        machine.reset().

        Which is rather interesting as I thought machine.reset() was a proper hard-reset but for some reason isn't as "hard" as machine.deepsleep(1). This makes machine.deepsleep(1) the much more preferable command to use when trying to hard-reset a remote system via the REPL.

        1 Reply Last reply Reply Quote 0
        • A Offline
          aevraewrvaervea
          last edited by

          The latest firmware, 1.6.12.b1 has fixed this issue for machine.reset(). Typing CTRL-D in Pymakr still causes a crash but that is manageable by testing for machine.SOFT_RESET before attempting to set up Sigfox and if true, do a machine.reset() or machine.deepsleep(1) first.

          1 Reply Last reply Reply Quote 0

          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