Memory loses all data when the battery is empty



  • I often have problems when I let my Wipy with board us battery run down and then reconnect it to USB/battery or AC adapter, it loses all stored data and then only flashes blue. Does anyone know this problem?



  • Thank You



  • @Wolli01 No 1: You should upgrade to a recent firmware and use the littlefs file system. That is built be more safe against file corruption upon power failure.

    You can measure the Vin voltage with the built-in ADC. If you use the expansion board, VBatt is connected to P16 via a voltage divider. The division factor depends on the expansion board model, but you have to tell anyhow the ADC read-back value at which the battery is low. At that point you must close all files. Unfortunately, the is no "power off and stay off" mechanism implemented. So you have to do something like that in your code. There is little 100% reliable I can think of. It will be complicated by the fact, that the battery will recover a little one it is less used, and the power capability depends on the temperature. But at least you can avoid any file operations if the battery voltage is low.
    File operations of the firmware during boot are out of reach for your code.



  • How can you turn it off in a controlled way?
    I have also had it when I disconnect the usb cable from the board (without an internal battery) that the data is also gone.
    Like some kind of short circuit



  • It loses the whole program what was on it. Afterwards it is like in the delivery state. The blue light shines in the cycle. All data is gone. This does not always happen but a few times. So an example:
    The program runs days, weeks excellent over a USB power supply. Then I pull the power plug and let it run on the internal Lipo battery until it is empty. If I then take the board and connect it to power, it happens in between that suddenly all data are gone.
    Chip-Release: 1.18.3 Version: v1.8.6-849-e0915e1 on 2019-10-06 Board: 1.1.2

    Translated with www.DeepL.com/Translator (free version)



  • @Wolli01 What do you mean with "looses all data"?

    Is the file system empty at that point?
    Which file system do you use, LFS or FAT?

    AFAIK, brown out protection is not implemented. So you have to do that in your code. ESP32 works fine down to 3V. So you can switch off your device at that point in a controlled manner.



Pycom on Twitter