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

    [SOLVED] A machine.reset() different than pushing reset

    Scheduled Pinned Locked Moved Getting Started
    reset
    12 Posts 4 Posters 4.0k Views 4 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.
    • B Offline
      BetterAuto Pybytes Beta @robert-hh
      last edited by

      @robert-hh Wouldn't machine.reset() give the same reset_cause() for both a pushbutton reset and programmatic reset? Since it says in the documentation, "machine.reset() resets the device in a manner similar to pushing the external RESET button."

      robert-hhR 1 Reply Last reply Reply Quote 0
      • robert-hhR Offline
        robert-hh @BetterAuto
        last edited by robert-hh

        @BetterAuto It seems that you are right. I used that feature on an ESP8266, and there you can use it to tell the difference between a reset caused by machine.reset() or a hard one (pushing the button).
        In the Pycom port, it tells the difference between a reset cause by Ctrl-D versus machine.reset(), push button, etc.
        I just tried both variants.

        1 Reply Last reply Reply Quote 1
        • B Offline
          BetterAuto Pybytes Beta
          last edited by

          So I gather you're saying reset_cause() on a WiPy 2.0 will say one thing after issuing machine.reset() and something different after pushing reset?

          I will test these out later if you're not sure.

          robert-hhR 1 Reply Last reply Reply Quote 0
          • robert-hhR Offline
            robert-hh @BetterAuto
            last edited by robert-hh

            @BetterAuto No. This is on an ESP8266 port of micropython.org. The ESP32 ports of pycom.io do NOT tell the difference between pushing the button snd machine.reset(). That looks inconsistent, since there seems no method to force an soft reset like Ctrl-D by software.

            1 Reply Last reply Reply Quote 1
            • B Offline
              BetterAuto Pybytes Beta
              last edited by

              Alright so how can I do this? Do I need to set a flag in the filesystem?

              1 Reply Last reply Reply Quote 0
              • B Offline
                BetterAuto Pybytes Beta
                last edited by

                I tested it on my WiPy. Pressing the reset button on the board then running machine.reset_cause() shows 0 which equals to machine.PWRON_RESET, whereas running machine.reset() gives reset_cause 2, equal to machine.WDT_RESET.

                WDT_RESET? Unexpected.

                robert-hhR 1 Reply Last reply Reply Quote 1
                • robert-hhR Offline
                  robert-hh @BetterAuto
                  last edited by robert-hh

                  @BetterAuto OK. I was testing with 1.6.12. With 1.6.13, at least there is a difference between hard reset, reset by machine.reset() and reset by Ctrl-D. I do not know whether WDT_RESET is unexpected. It is also a kind of software reset, but it might be nice to tell the difference.

                  B 1 Reply Last reply Reply Quote 1
                  • B Offline
                    BetterAuto Pybytes Beta @robert-hh
                    last edited by

                    @robert-hh Perhaps machine.reset() works by tripping the watchdog?

                    L 1 Reply Last reply Reply Quote 0
                    • L Offline
                      livius @BetterAuto
                      last edited by

                      @BetterAuto
                      Maybe - but i think better will be to distinguished this
                      PS. We have also another reset condition deep sleep

                      think about people first, then computers

                      S 1 Reply Last reply Reply Quote 0
                      • S Offline
                        Shaun @livius
                        last edited by

                        daniel said in New firmware release 1.6.12.b1:

                        Fix bug caused by machine.reset(). Used a quick WDT reset instead which actually performs a full reset of the chip.

                        1 Reply Last reply Reply Quote 3

                        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