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
ernitron
Posts: 89
Joined: Fri Jun 03, 2016 5:53 pm
Location: The Netherlands

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

Post by ernitron » Fri Nov 11, 2016 6:06 pm

Read the whole thread (twice). Read the two pull requests mentioned (https://github.com/micropython/micropython/pull/2510 and https://github.com/micropython/micropython/pull/2564). I am a little confused so forgive me if I missed something.

1. I have almost the same problem of @kfricke with my applications. Frequent reboots and frequent wifi connections that will lead to flash consumption (I wasn't even fully aware of that!)

2. I voted for the change and also to change documentation to warn the users they can damage the device with the default persistent behaviour of the network API.

3. I understand the maintainers' point of view and do not want to push them in a hell of a maintenance storm.

I just cannot get why adding two more API like in the following excerpt is not a viable solution:

Code: Select all

    sta_if = network.WLAN(network.STA_IF)
    if not sta_if.isconnected():
        sta_if.active_current(True) # do not save in Flash
        sta_if.connect_current(ssid, pwd) 
The new _current APIs do not save on Flash. [ Was this the solution proposed by @deshipu? ]

In my case that would solve my problem at the cost of changing a couple of lines of application code.
At the same time I would document the new API and warn the users of the potential damage of the default implementation.

What am I missing here?

Disclaimer: I understand perfectly the pressure of the maintainers to stick to the KS project goals and not being diverted from priorities. So please consider my post only a way to better understand this issue. Thanks

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 » Sat Nov 12, 2016 9:05 pm

deshipu wrote:
kfricke wrote:For the records: 50 hours into discussion and 19 vs 0 votes in favor of the PR.
Yay, only 981 to go, good luck.
I would have thought a change should be made unless 500-1000 people vote against it, not the other way round. It's not like everything else wasn't implemented from scratch and we consulted the documentation to use anyway.

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 » Sun Nov 13, 2016 4:03 pm

I did just push an update for the PR for 1.8.6

User avatar
deshipu
Posts: 1388
Joined: Thu May 28, 2015 5:54 pm

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

Post by deshipu » Sun Nov 13, 2016 5:18 pm

The sad truth is that you won't even get fifty votes, either yes or no, for the simple fact that there aren't so many people in the whole world who care. Out of the fifteen hundred people who took part in the Kickstarter, 99% just read about it on some blog or social media, thought it's a good idea, clicked the button and promptly forgot about the whole thing. When the binary was released, they maybe flashed it to their board, saw it works, nodded sagely, and then flashed back NodeMCU or their Arduino sketch that they worked on, and never looked back. Almost nobody *actually* uses MicroPython on the ESP8266 for doing actual project -- except for the people on this forum who already voiced their opinion. And it will stay like this for a while, until much, much, *much* more work is done, and not on things like the database or making it run on even smaller boards.

A while ago I ran a contest on Hackaday.io -- a pretty big community of makers -- for doing something -- anything -- with the MicroPython on ESP8266. The goal was to encourage people to give it a try. You know how many people submitted projects that actually used it? Six. Within a month. That's how many users you *actually* have. Unless something big happens or the project changes how it is run, I doubt you will get to hundred users within two years from now.

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 » Sun Nov 13, 2016 6:34 pm

deshipu wrote:The sad truth is ...
You know that your and my opinions regarding this are not that far appart. But "the truth" is a thing i can not tell for others.
I do simply keep on with this approach and do not really care how many are voting unless it has the current balance.

In the meantime i did also enhance the PR a little as suggested in the PR comments on Github:
  • Also saves the interface states to flash when requested.
  • Rename the methods a little for consistency
  • Add a method to read and write the configuration for auto connect on startup. This is just another newly exposed method from the ESP SDK

Lysenko
Posts: 62
Joined: Wed Aug 17, 2016 1:21 pm

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

Post by Lysenko » Sun Nov 13, 2016 6:47 pm

deshipu wrote:The sad truth is that you won't even get fifty votes, either yes or no, for the simple fact that there aren't so many people in the whole world who care.
The reason there are no opposing votes even though I oppose breaking patches is that I consider the vote a false dichotomy: there is a third way.

But you are also right that I don't care: the ESP8622 is a bad choice for a battery powered wireless sensor node (CC2650, for example, is a far better part for that). The ESP8622 is far too power hungry, as is WiFi itself in most use cases. Consequently I would never encounter this problem as I would only use an 8622 in scenarios where flash burn would take over a decade to become an issue.

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 » Mon Nov 14, 2016 8:32 am

Hereby I see this poll as closed. The reason is that I just did realize that Paul did moderate my initial post (summary at the top). I do not like the fact that an instance is picking the words for me. This is not my poll and probably has never been.

But based on the fact that I have already a forked repository containing the things i do need, is enough for me. Up to now this was my try to help the development of MicroPython. Paul said differently, but again he is not my mouth!.

I will still hang around here and try to be a constructive part of the community, but have better things to to in my spare time than getting kidded by anyone, when trying to contribute. Good luck to everyone trying to give constructive feedback to people who do not want any.

User avatar
pythoncoder
Posts: 5956
Joined: Fri Jul 18, 2014 8:01 am
Location: UK
Contact:

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

Post by pythoncoder » Mon Nov 14, 2016 9:32 am

There are a several possible reasons for the low number of votes. Some may not feel confident that they understand the issues. Others may be using the device in ways where re-writes are rare. Many may feel daunted by the length and occasional animosity of the debate. On the positive side, I'd suggest that those who have voted do care, can cope with the slings and arrows, and have taken time to appreciate the technical issues.
Peter Hinch
Index to my micropython libraries.

pfalcon
Posts: 1155
Joined: Fri Feb 28, 2014 2:05 pm

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

Post by pfalcon » Mon Nov 14, 2016 10:10 am

kfricke wrote:Hereby I see this poll as closed.
Sorry, but this poll doesn't belong to you, but to MicroPython ESP8266 community (first steps in self-governance).
The reason is that I just did realize that Paul did moderate my initial post (summary at the top). I do not like the fact that an instance is picking the words for me. This is not my poll and probably has never been.
torwag contacted me expressing your concern of this. I invited him to be a referee on this matter, in particular, invited to edit the poll (but I argued my point). I'm sorry if he chose my point rather than yours. I'm really astonished that in less than week we collected so many votes, all unanimous. That shows we're on right track overall.
But based on the fact that I have already a forked repository containing the things i do need, is enough for me.
That's how it usually happens with open-source projects - everyone cares only about their own stuff, and only maintainers have to care about everyone.
Up to now this was my try to help the development of MicroPython. Paul said differently, but again he is not my mouth!.
I said it before, say it again now: the change is good in nature, would be done anyway eventually. My only concern is that everyone was ready for it: users and maintainers. Hence the poll - it will take some time (months!) so everybody will be ready (and people who'll manage to miss it, will be referred to it to see the very clear voting pattern).
I will still hang around here and try to be a constructive part of the community, but have better things to to in my spare time than getting kidded by anyone, when trying to contribute. Good luck to everyone trying to give constructive feedback to people who do not want any.
You were offered to wear maintainer's shoes, and you gave up after a week. Just imagine what the maintainers endure week after week, month after month, year after year. Recently, the pressure has become really enormous. Dozen of people, each reciting "constructive feedback" without listening to each other is no longer a constructive feedback overall. Please be ready to step back and have some patience.
Awesome MicroPython list
Pycopy - A better MicroPython https://github.com/pfalcon/micropython
MicroPython standard library for all ports and forks - https://github.com/pfalcon/micropython-lib
More up to date docs - http://pycopy.readthedocs.io/

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 » Mon Nov 14, 2016 10:53 am

We are all working in respect of the community, that is for sure. I do not count contributing in "commits on github", "grep -r <author> docs/* | wc -l" or the like, but in commitment and helping and assisting the community. Even you should be able to see that i do work with stuff the community did create. I am just a stupid user of the things you and others do create, that is for sure.

Regarding this poll and what i am really angry about is the fact that my name is attached to my posts, including the top post. So as long this is my name tag and portrait attached to it, this is my poll. Like it or not, moderate by commenting in posts of yours and act accordingly to forum workflows. But *NEVER* put words in my mouth and let them look like mine.That is what you seem to not understand.

Do not blame us for being busy. You by yourself did set the timelines, so blame yourself.

You do partially get paid from my 40 pounds for the ESP8266 kickstarter. I do know that i am only one of many. But I imagine to be one of the few to open their mouths when they see unfair and suggestive treatment.

P.S.: I do not want your shoes and never asked for them!

Post Reply