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

    FiPy Hangs after Deepsleep - LED stays on

    Scheduled Pinned Locked Moved FiPy
    7 Posts 2 Posters 72 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.
    • C Offline
      Cees_Meijer
      last edited by

      This is a follow-up on my post where I assumed that the problem was caused by random 'Guru meditation errors'. Closer monitoring showed that this was not the case. It does actually reboot after such an event, but occasionally completely hangs without any error message.
      It is worth noting too that the same software , with the same peripherals and power supply has been running fine on a GPy for several months without a glitch.
      The FiPy just every once in while stopped completely and could only be restarted after a hard reset or power cycle. Then I noticed that the blue LED was always ON when the system crashed, so I started to suspect the heartbeat routine. And indeed, switching this off seems to solve the problem. I disabled the 'heartbeat on boot', and just manually blink the LED once (on medium intensity) when the system starts up. Now I also ran a test, with the same software, on a standard PyCom development board, and here it does not seem to happen. So it is probably related to the the wiring and power supply of the peripheral board.
      Given the fact that it does not happen on a GPy makes me think that the FiPy is not just simply a GPy with LTE modem, but there is a small difference in the way the LED is connected (different decoupling capacitors?) or power routing on the board. But since the design and schematics of the boards is as secret as the Coca-Cola formula, I'll probably never know.

      1 Reply Last reply Reply Quote 0
      • C Offline
        Cees_Meijer
        last edited by

        As I'm not allowed to edit the post anymore, I decide to add my findings here:

        The board contains a MAX3227 RS-232 driver, which is powered from the 3.3 V connection on the FiPy. When the deepsleep ends, I enable the MAX3227 and this probably causes a short power surge to the 3.3V line since it starts up the internal charge-pumps to generate the + and - 5V. And when this start-up aligns with the first blink of the LED, the FiPy hangs.

        1 Reply Last reply Reply Quote 0
        • G Offline
          Gijs
          last edited by Gijs

          Is this solution working for you? Or do you believe it is a firmware bug?
          Let me know!
          Gijs

          C 1 Reply Last reply Reply Quote 0
          • C Offline
            Cees_Meijer @Gijs
            last edited by

            @Gijs I think it's a hardware thing. It looks like the 3.3V is critical when the system comes back from deepsleep, and the switching of the LED can cause a reset. I have done some intense testing over the weekend, and it looks like switching the heartbeat off solves my problem for now. I did notice though that the FiPy which is running just the software on a standard development board does not suffer from the complete, unrecoverable stop, but it does do an occasional full reset. So I do think there could be a potential problem with the FiPy hardware.

            1 Reply Last reply Reply Quote 0
            • C Offline
              Cees_Meijer
              last edited by

              Another observation (I do not know where else to post them..)
              The FiPy does hang when running on a standard development board, only it happens less often. This time it happened after two days. So I must conclude there is something wrong with the hardware of the FiPy ! And the workaround is to disable the heartbeat !

              1 Reply Last reply Reply Quote 0
              • G Offline
                Gijs
                last edited by

                Hi,
                Ill do some research around this issue. Can you perhaps provide how you get this issue to occur. I've tried several things but cannot get the heartbeat to occur concurrently with with waking up the module from deepsleep
                Best,
                Gijs

                C 1 Reply Last reply Reply Quote 0
                • C Offline
                  Cees_Meijer @Gijs
                  last edited by Cees_Meijer

                  @Gijs : This is the essence of my program:

                  import time
                  from machine import Pin
                  
                  # Read a value from the NVS
                  def get_value(key='',default=0, min =0, max =0):
                      try:
                          val = pycom.nvs_get(key)
                      except:
                          #print("Error while reading from internal storage ["+key+"]")
                          val = default
                      if min != max:
                          if val < min:
                              val=min
                          if val > max:
                              val = max
                      return val
                  
                  def TxDriverPower(on_off=True):
                      if on_off == ON:
                          print("Tx ON")
                          rx_driver_disable.value(1)
                      else:
                          print("Tx OFF")
                          rx_driver_disable.value(0)
                  
                  try:
                      time.sleep(0.5)
                      print("Wake up ["+ str(machine.wake_reason()[0]) + "] - Reset [" +str(machine.reset_cause()) +"]")
                      location_ID= get_value('ID',0)
                      NBIOT = get_value('NBIOT',1, 0, 1)
                      
                      tx_driver_enable = Pin('P22', mode=Pin.OUT)
                      rx_driver_disable = Pin('P21', mode=Pin.OUT)
                      TxDriverPower(ON)   ## Switch ON the MAX3227 RS232 Driver chip
                      
                      #IF IT CRASHES, IT NEVER GETS BEYOND THIS POINT
                  #
                  # READ A SENSOR,  SEND DATA THROUGH LTE ETC.
                  #
                    
                      print("TEST: Go to DEEPSLEEP ! 300 seconds")
                      machine.deepsleep(( 300 )*1000)
                  
                  # End of Main loop
                  except Exception:  # Any uncaught exception will trigger a reset
                      print("Error in program:"+ str(sys.exc_info()[0]) + str(sys.exc_info()[1]) )
                      time.sleep(1)
                      machine.reset()
                  
                  

                  Of course there is much more going on, but if it crashes it is always shortly after the waking from deepsleep. When the FiPy is connected to the MAX3227 (which is enabled in the TxDriverPower(ON) function) it crashes about once every 10-50 measurement cycles. With the FiPy just mounted in the development board (nothing connected) it crashed after about two days.
                  After disabling the heartbeat, I had 4 systems running for 3 days now without a problem.

                  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