Page 4 of 8

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

Posted: Thu Nov 10, 2016 5:33 pm
by dhylands
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.

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

Posted: Thu Nov 10, 2016 6:23 pm
by Frida
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.

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

Posted: Thu Nov 10, 2016 7:30 pm
by marfis
+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.

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

Posted: Thu Nov 10, 2016 8:23 pm
by kfricke
I did place it inside the esp module, because it is only specific to this platform.

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

Posted: Thu Nov 10, 2016 9:32 pm
by mcauser
My $0.02: If a seeming small change can reduce e-waste and shipping pollution, that's a win for the environment.

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

Posted: Thu Nov 10, 2016 10:55 pm
by markxr
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

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

Posted: Thu Nov 10, 2016 10:59 pm
by woodat
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?

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

Posted: Fri Nov 11, 2016 1:14 am
by jknuteson
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.

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

Posted: Fri Nov 11, 2016 7:38 am
by Roberthh
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.

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

Posted: Fri Nov 11, 2016 8:10 am
by kfricke
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.