Did I destroy my Lopy4 and/or my PySense2.0

  • Hallo,
    a few days ago I lost connection to my Lopy2/PySense2.0 board.
    I was playing around with Wifi MQTT connection. Sending the battery voltage every 60 seconds to adafruit.io.
    Every thing went fine until I tried to optimise the power consumption by using the go_to_sleep() funktion of the Pysense. From that moment I could not upload code to the board. Neither using atom pymakr nor ampy. I was able to do a fimware upgrade with the pycom upgrade tool but that didn't help.
    What else can I do?
    What did I possibly do wrong to destroy the board. All I did was using onboard sensors, a 3.7V, 500mAh LiPo battery and an external Wifi antenna.

    Thanks allot

  • @robert-hh Thanks alot for this quick answer!!
    The LED was active, even thought my inital code disabled the LED. It started after my first aproch updating the firmware and erasing the filesystem.
    Save booting the LoPY did not help (btw. nice button!). As metioned, only erasing the filesystem did not do it. What help in the end was checking the RESET boxes "CONFIG partiton" and "NVS partition"
    Thanks to all!

  • @Gijs Uhh! Real Nice!

  • Global Moderator

    @jcaron said in Did I destroy my Lopy4 and/or my PySense2.0:

    Safeboot of course also works, but I personally prefer pressing on a button than shorting pins :-)

    The Pysense 2.0 X has a dedicated safeboot button, right below the headers :-)

  • @Gijs Just to be more explicit, the issue is that every time the LoPy goes to sleep, USB is shut down. When it wakes up, it takes a few seconds for USB to come back up, be detected by the OS, be detected by Atom, and oooooooh it's gone back to sleep already.

    It's a good idea to add a couple of things:

    • Add a test in your code so when it wakes up, it will test if the button is pressed. If it is, don't go back to sleep.
    • Possibly add a wake up on button press.

    This way, you simply press the button to get the LoPy back in a mode where you can actually talk to it. Without the wake up, you can simply reset the LoPy while pressing the button to achieve the same effect.

    Safeboot of course also works, but I personally prefer pressing on a button than shorting pins :-)

  • Global Moderator

    The issue is probably related to the py.go_to_sleep() method call. this method shuts off the power to the board and USB connection, causing indeed the issues you are having.

    You can either do a safeboot: https://docs.pycom.io/gettingstarted/programming/safeboot/ which will stop the python code from making the module sleep, or erase the flash using the firmware update tool!


  • @siggin Is the blue heartbeat LED active? If yes, your LoPy is working. Since the upload worked, the communication should be fine too. If you are working with windows, did you check the COM port? Maybe that one changed.
    Besides that you should always be able to revive the board with a full erase using the pycom gui updater, the pycom command line updater or esptool.py. After that, you can upload the firmware again and start over.

Log in to reply

Pycom on Twitter