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

    WiPy shutting down after a few hours

    Scheduled Pinned Locked Moved WiPy 2&3
    solarbatterywipy
    9 Posts 3 Posters 1.4k Views 3 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
      jmpratt
      last edited by

      I'm experiencing a strange problem. I have a WiPy 2.0 power from a 12V USB adapter that is connected to the load terminals of a solar charge controller. I have a solar panel and 7.4 AHr battery connected to the charge controller. The battery has never dipped below 50% charge (12.2 volts displayed on charge controller). The code in main.py reads data from soil and air sensors via an SDI-12 interface board every five minutes then sends it to ThingSpeak (https://thingspeak.com/channels/451589). I use a "while True" statement as the main loop in my code.

      The problem is the WiPy shuts down every few hours. It doesn't restart until I hit the reset button on the board or Ctrl-D from the REPL in ATOM. ATOM is able to connect to the WiPy after the board stops sending data.

      If the power to the board drops enough to shutdown the board, shouldn't it restart the main.py code again once power is restored? What would cause the board to stop executing main.py but maintain connection to ATOM?

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

        @jmpratt You say that you read the sensor every five minutes. How dop you determine that interval?
        And if you wait long enough (a few hours), does the transmission resume?

        J 1 Reply Last reply Reply Quote 0
        • J Offline
          jmpratt @robert-hh
          last edited by

          @robert-hh The code sleeps for 300 seconds between readings. I've waited 12 hours and the code has not resumed.

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

            @jmpratt So you are calling sleep(300).

            J 1 Reply Last reply Reply Quote 0
            • J Offline
              jmpratt @robert-hh
              last edited by

              @robert-hh Yes.

              J 1 Reply Last reply Reply Quote 0
              • J Offline
                jmarcelino @jmpratt
                last edited by

                @jmpratt
                Can I ask why/what you call a shutdown?

                Actually the MicroPython interpreter must be running if it catches Ctrl-D from Atom.

                Maybe the board just dropped off WiFi?

                J 1 Reply Last reply Reply Quote 0
                • J Offline
                  jmpratt @jmarcelino
                  last edited by

                  @jmarcelino I don't think it's dropping wifi. The heartbeat LED won't be flashing when it stops sending data.

                  Shouldn't the WiPy boot back up when power is restored?

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

                    @jmpratt The heartbeat LED also stops flashing if your code is in a tight busy loop like:
                    while True:
                    pass
                    I do not know what happens in a brownout condition. The CPU and it's I/O can run on slightly lower voltage than the analog section including WiFi. That may cause the WiFi to lock up. But since you have pretty large battery, I still would assume some kind software issues.

                    J 1 Reply Last reply Reply Quote 1
                    • J Offline
                      jmpratt @robert-hh
                      last edited by

                      @robert-hh The hearbeat LED flashes when the board and code are working properly. If I notice that the data is not updating, I'll go look at the board and the heartbeat LED won't be flashing. I'll hit the reset button on the board and everything will work normally again.

                      I think I'll setup an identical rig but power the USB power port from a variable DC supply. Then I can turn the voltage down and see what happens.

                      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