Avoid flash wearing by altering behavior originally introduced by Espressif (the inventor of the ESP8266)

All ESP8266 boards running MicroPython.
Official boards are the Adafruit Huzzah and Feather boards.
Target audience: MicroPython users with an ESP8266 board.

Would you like to make good-intended, but backward-incompatible changes to WiFi setup?

Poll ended at Sun Jan 08, 2017 7:55 am

Yes, I think this change is good, even though it's backward-incompatible and will confuse some users. We'll get thru it.
36
100%
No, I don't think this change is sound technically or that making backward-incompatible changes of such scale is good.
0
No votes
 
Total votes: 36

User avatar
dhylands
Posts: 3195
Joined: Mon Jan 06, 2014 6:08 pm
Location: Peachland, BC, Canada
Contact:

Re: Avoid flash wearing by altering behavior originally introduced by Espressif (the inventor of the ESP8266)

Post by dhylands » Thu Nov 10, 2016 5:33 pm

Lysenko wrote:
dhylands wrote:So the last time a password was written was in Aug, over 3 months ago, even though my laptop has been rebooted several times. The first file "Blue-Heron" is the SSID I normally connect to, and it hasn't changed since I installed 16.04.
OK, but what do you get if you use -lu instead?
That will show the last time the file was "read", which doesn't relate to this discussion.

User avatar
Frida
Posts: 38
Joined: Sat Jan 30, 2016 2:20 pm
Location: Middelfart, Denmark

Re: Avoid flash wearing by altering behavior originally introduced by Espressif (the inventor of the ESP8266)

Post by Frida » Thu Nov 10, 2016 6:23 pm

An extract from Espruino with Javascript, where we have wifi.save()

Code: Select all

var wifi = require("Wifi");
wifi.connect("my-ssid", {password:"my-pwd"}, function(ap){ console.log("connected:", ap); });
wifi.stopAP();

You may want to add wifi.setDHCPHostname("espruino"). Once you're happy with your connection, you can use wifi.save() to persist it, so you don't have to reconnect each time you reset your ESP8266.
Yes Frida is my watchdog!

User avatar
marfis
Posts: 189
Joined: Fri Oct 31, 2014 10:29 am
Location: Zurich / Switzerland

Re: Avoid flash wearing by altering behavior originally introduced by Espressif (the inventor of the ESP8266)

Post by marfis » Thu Nov 10, 2016 7:30 pm

+1
should esp.save_config be renamed to wifi.save_config?
esp.save_config sounds a bit general to me.

Other than that that proposal sounds good! Thanks for your effort.

User avatar
kfricke
Posts: 342
Joined: Mon May 05, 2014 9:13 am
Location: Germany

Re: Avoid flash wearing by altering behavior originally introduced by Espressif (the inventor of the ESP8266)

Post by kfricke » Thu Nov 10, 2016 8:23 pm

I did place it inside the esp module, because it is only specific to this platform.

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

Re: Avoid flash wearing by altering behavior originally introduced by Espressif (the inventor of the ESP8266)

Post by mcauser » Thu Nov 10, 2016 9:32 pm

My $0.02: If a seeming small change can reduce e-waste and shipping pollution, that's a win for the environment.

markxr
Posts: 62
Joined: Wed Jun 01, 2016 3:41 pm

Re: Avoid flash wearing by altering behavior originally introduced by Espressif (the inventor of the ESP8266)

Post by markxr » Thu Nov 10, 2016 10:55 pm

Oh dear. (I posted the bug that started this. Sorry.)

I really, really, didn't plan on starting this "Holy War".

Please take a chill pill (or two).

For my part, I'd be happy with any reasonable solution which allows connecting / disconnecting without wearing the flash. If it's backwards-compatible, great, if not, great as well.

Mark

woodat
Posts: 20
Joined: Wed Feb 17, 2016 9:24 pm

Re: Avoid flash wearing by altering behavior originally introduced by Espressif (the inventor of the ESP8266)

Post by woodat » Thu Nov 10, 2016 10:59 pm

Just finished reading through all pages of this post and am left with a question: given there's no technical reason against it, was there anything wrong with the compromise solution proposed? If I read all this correctly, the suggestion was implementing a save_config() with an optional boolean to allow the original behaviour (pfalcon's desire) but at the same time provide the optional non-write functionality that 100% of the active readers on this forum (thus far) also seem to desire?

How does that break anyone's experience or backward compatibility?

jknuteson
Posts: 1
Joined: Thu Apr 10, 2014 4:09 pm

Re: Avoid flash wearing by altering behavior originally introduced by Espressif (the inventor of the ESP8266)

Post by jknuteson » Fri Nov 11, 2016 1:14 am

I think it essential to address this issue because many if not most applications will use deepsleep to reduce power consumption, and if its use ultimately causes hardware failure in a relatively short lifespan, then the ESP8266-micropython combination is not a valid choice of platform.

User avatar
Roberthh
Posts: 1452
Joined: Sat May 09, 2015 4:13 pm
Location: Rhineland, Europe

Re: Avoid flash wearing by altering behavior originally introduced by Espressif (the inventor of the ESP8266)

Post by Roberthh » Fri Nov 11, 2016 7:38 am

given there's no technical reason against it, was there anything wrong with the compromise solution proposed?
Hello Woodat. Without knowing the details, I assume that even that implementation requires a change in the esp-sdk toolchain, if possible at all, which then would have to be maintained. And that's what Paul want to avoid, I guess.

User avatar
kfricke
Posts: 342
Joined: Mon May 05, 2014 9:13 am
Location: Germany

Re: Avoid flash wearing by altering behavior originally introduced by Espressif (the inventor of the ESP8266)

Post by kfricke » Fri Nov 11, 2016 8:10 am

Nö Robert, the suggested changes in my pull request do only use official API calls. It changes only the two (or maybe three) year old default behaviour of the ESP8266. Those additional API methods have been introduced with a early version 1.0 and are still present in the 2.0 SDK. What pfalcon wants to avoid is the additional support he feats from that change.

Post Reply