Lolin board erase everything from flash

All ESP8266 boards running MicroPython.
Official boards are the Adafruit Huzzah and Feather boards.
Target audience: MicroPython users with an ESP8266 board.
Post Reply
lazarvgd
Posts: 29
Joined: Sun May 20, 2018 8:57 am

Lolin board erase everything from flash

Post by lazarvgd » Mon Jan 14, 2019 9:51 am

Hi there, I am using a NodeMCU Lolin board to control my home heater. The problem is that I had electricity problems due to maintenance in my street. What I have found is that the board has stopped working. When I entered to the serial monitor to see what are the outputs of the board, I have found that board is empty, no files were there. I used ampy to get a list of all available files, but instead of file names I got this :

Code: Select all

/. /. /. /. /. /. /. /. /. /.
So I realized that the board erased the code from flash due to frequent power loses. Does anybody has any idea how to put the board in some kind of sleep of safety shutdown mode when power is lost?

Thanks

tylersuard
Posts: 9
Joined: Mon Jan 21, 2019 4:09 pm

Re: Lolin board erase everything from flash

Post by tylersuard » Mon Jan 21, 2019 4:22 pm

The board is so tiny, it wouldn't surprise me if it had no such function. A good idea might be to hook it up to a cell phone charger battery. I bought one for my Rpi and it keeps the thing powered for 3 days on one charge.

It would be best if the cell phone charger battery has both an in port and an out port. That way, your ESP will run off wall power when there is no outage, and will run off battery power when there is an outage.

Hope that helps!

lazarvgd
Posts: 29
Joined: Sun May 20, 2018 8:57 am

Re: Lolin board erase everything from flash

Post by lazarvgd » Mon Jan 21, 2019 10:07 pm

tylersuard wrote:
Mon Jan 21, 2019 4:22 pm
The board is so tiny, it wouldn't surprise me if it had no such function. A good idea might be to hook it up to a cell phone charger battery. I bought one for my Rpi and it keeps the thing powered for 3 days on one charge.

It would be best if the cell phone charger battery has both an in port and an out port. That way, your ESP will run off wall power when there is no outage, and will run off battery power when there is an outage.

Hope that helps!
Thanks buddy, I am trying to finish real thing with this board but did not expext to get this kid of error. Currently I am running arduino pro mini with rtc to turn of my heater in flat.

But will try to make this board more resilient.

Once again, thanks :)

User avatar
mcauser
Posts: 413
Joined: Mon Jun 15, 2015 8:03 am

Re: Lolin board erase everything from flash

Post by mcauser » Thu Jan 24, 2019 3:01 am

Could you add a few 5.5V super capacitors acting as a battery/ups and monitor the voltage on the analog pin and flick a relay to power down the device once the voltage drops below a threshold? The relay would be wired normally open, and you'd have to bypass it to boot, but once booted, hold it closed until you wish to power off the device.

If you're going to all that effort, might be easier to just use one of those cheap power bricks (containing an 18650 lithium battery and charging circuitry). Power the ESP8266 through the power brick and the mains plug keeps it charged and a power outage will draw from the battery until it's restored.

esptool.py erase_flash will completely wipe the broken filesystem, which is restored when you run the next deploy / write_flash.
I've corrupted a few filesystems by just using poor quality old usb cables. Easily fixed.

lazarvgd
Posts: 29
Joined: Sun May 20, 2018 8:57 am

Re: Lolin board erase everything from flash

Post by lazarvgd » Wed Feb 13, 2019 6:56 pm

Hi there,

It is not problem that board is erased but the thing that is unreliable. I used the board to control my heater in flat. In case that something goes wrong with board I can set flat on fire. Now I am using arduino and rtc just to be sure.

But nevertheless I like this board and would like to use it with micropython since it is much easier to pare the data and other features of high level language.

I will try to attach some battery to keep board powered in case power is lost.

Thanks :)

User avatar
mcauser
Posts: 413
Joined: Mon Jun 15, 2015 8:03 am

Re: Lolin board erase everything from flash

Post by mcauser » Wed Feb 13, 2019 9:13 pm

If you are worried about fire from a heater that is left on from a crashed board, I’d add a separate failsafe independent circuit which can sever the power in an emergency. Something as simple as an attiny + temp sensor + relay.

Or maybe the all in one W1209 board. But it only has a small relay, so you’d need to chain a bigger one that can handle the power requirements of your heater.
https://s.click.aliexpress.com/e/c93Np2ff

Always build in redundancy when building systems with cheap parts from China :)

flywire
Posts: 22
Joined: Wed Jan 02, 2019 7:08 am

Re: Lolin board erase everything from flash

Post by flywire » Sat Mar 02, 2019 8:45 am

mcauser wrote:
Thu Jan 24, 2019 3:01 am
...esptool.py erase_flash will completely wipe the broken filesystem, which is restored when you run the next deploy / write_flash.
I've corrupted a few filesystems by just using poor quality old usb cables. Easily fixed.
esptool.py erase all flash before writing (single command)

Post Reply