New *early access* mp-esp8266-firmware-vXY.bin on ESP8266

All ESP8266 boards running MicroPython.
Official boards are the Adafruit Huzzah and Feather boards.
Target audience: MicroPython users with an ESP8266 board.
Damien
Site Admin
Posts: 647
Joined: Mon Dec 09, 2013 5:02 pm

Re: New mp-esp8266-firmware-v01.bin on ESP8266

Post by Damien » Wed Mar 09, 2016 9:49 pm

hjm wrote:Just out of curiosity, the 'pyb' module methods of PyBoard and the 'machine' methods of ESP8266 are syntactically different even if referring to same functions. E.g. 'i2c.send()' of PyBoard's pyb vs 'i2c.writeto()' of ESP8266's machine. Is there a specific reason for this?
We are switching over to a new hardware API that should be general enough to cover all the different boards that MicroPython can run on. This new API uses the "machine" module, and the I2C (and SPI, etc) methods are called different things and have different behaviour (to make them more consistent and general). The pyboard also has the "machine" module but does not (yet) implement all of the new API.

Damien
Site Admin
Posts: 647
Joined: Mon Dec 09, 2013 5:02 pm

Re: New mp-esp8266-firmware-v01.bin on ESP8266

Post by Damien » Wed Mar 09, 2016 9:50 pm

profra wrote:I can confirm that with WEMOS D1 mini were no problems... installation, WLAN, ST, AP... everything OK.
Trying NeoPixel got an error.... NameError: name 'NeoPixel' is not defined.
Any advice?
Instead of NeoPixel, use neopixel.NeoPixel.

Photon Peddler
Posts: 7
Joined: Tue Jul 08, 2014 5:30 pm
Location: Connecticut, USA

Re: New mp-esp8266-firmware-v01.bin on ESP8266

Post by Photon Peddler » Thu Mar 10, 2016 2:40 am

Hi, Damien.

I programmed a cheap ESP-01 module from MCM with the binary you sent. It works great!

A question: It seems that MicroPython stores the ESSID and password somewhere, so that the module can reconnect after a reset. Is there a way to erase this information, so that I don't leak the network name and password when loaning the module to someone else?

User avatar
platforma
Posts: 258
Joined: Thu May 28, 2015 5:08 pm
Location: Japan

Re: New mp-esp8266-firmware-v01.bin on ESP8266

Post by platforma » Thu Mar 10, 2016 12:21 pm

Photon Peddler wrote: A question: It seems that MicroPython stores the ESSID and password somewhere, so that the module can reconnect after a reset. Is there a way to erase this information, so that I don't leak the network name and password when loaning the module to someone else?
That's an interesting question, I don't think you will be "leaking" the ssid/pwd. I don't believe this feature exists yet. It is probably possible to erase the whole flash sector where the config is stored in flash using esp.flash_erase(). As for the API, it might be useful to have a call similar to wlan.forget() or wlan.persistent(False) or something rather. Forgetting can be done with SDK:

Code: Select all

wifi_softap_set_config()
and set the config to NULL.

For station mode, there are similar calls in the SDK:

Code: Select all

wifi_station_set_config_current(); // I believe will not store the station config
wifi_station_set_auto_connect(0); // prevent from connecting
I might be wrong with all this though! :)

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

Re: New mp-esp8266-firmware-v01.bin on ESP8266

Post by deshipu » Fri Mar 11, 2016 1:23 pm

The firmware is great and so far runs very well. I had it crash on me when I used os.listdir() right after creating the filesystem (by importing boot_), but I suppose that this is the result of some buffering. I'm especially happy about the I2C functionality, even though it's write only so far, because it allows me to control other boards using micropython.

I have one question, however. I noticed that the modules saved on the internal filesystem are not available until you do "import boot_". That's understandable. However, I also noticed the "could not find module 'boot'" message, even when I have the "boot.py" file created. My guess is that it can't run it precisely because the filesystem is not mounted... So, is there any way of having our own code run on startup now? I'm in a chicken-and-egg situation now, as I would like to put "import boot_" in "boot.py" to have it run on startup, but "boot.py" won't be run without importing "boot_" first...

profra
Posts: 39
Joined: Sat Jan 03, 2015 12:23 am

Re: New mp-esp8266-firmware-v01.bin on ESP8266

Post by profra » Fri Mar 11, 2016 2:36 pm

Damien wrote:
profra wrote:I can confirm that with WEMOS D1 mini were no problems... installation, WLAN, ST, AP... everything OK.
Trying NeoPixel got an error.... NameError: name 'NeoPixel' is not defined.
Any advice?
Instead of NeoPixel, use neopixel.NeoPixel.
Yes , I found it after a while , please correct it on the website...

User avatar
thoralt
Posts: 11
Joined: Wed Jul 02, 2014 11:22 am
Location: Germany

Re: New mp-esp8266-firmware-v01.bin on ESP8266

Post by thoralt » Sun Mar 13, 2016 9:09 am

deshipu wrote:So, is there any way of having our own code run on startup now? I'm in a chicken-and-egg situation now, as I would like to put "import boot_" in "boot.py" to have it run on startup, but "boot.py" won't be run without importing "boot_" first...
I second that. Do we have the possibility to run own python code on startup or is this not yet implemented? Does anyone know?

To the developers: Thank you for all the work! This is an awesome project! I couldn't resist throwing in some coins at Kickstarter :)

Thoralt

mpymike
Posts: 10
Joined: Mon May 26, 2014 5:48 am

Re: New mp-esp8266-firmware-v01.bin on ESP8266

Post by mpymike » Mon Mar 14, 2016 4:32 am

I've been programming a bunch of ESP01s of dubious quality...
A couple of them gave me this boot_ error.

Code: Select all

MicroPython v1.5.2-395-g5f6d12c on 2016-03-08; ESP module with ESP8266
Type "help()" for more information.
>>> import esp
>>> esp.osdebug(None)
>>>
>>>
>>> import boot_
ioctl(1, 0)
ioctl(5, 0)
readblocks(0, 3ffeef60(4096))
readblocks(0, 3ffef150(4096))
ioctl(1, 0)
ioctl(5, 0)
readblocks(0, 3ffef2b0(4096))
ioctl(1, 0)
ioctl(5, 0)
readblocks(0, 3ffef3c0(4096))
FAT filesystem appears to be corrupted. If you had important data there, you
may want to make a flash snapshot to try to recover it. Otherwise, perform
factory reprogramming of MicroPython firmware (completely erase flash, followed
by firmware programming).

FAT filesystem appears to be corrupted. If you had important data there, you
may want to make a flash snapshot to try to recover it. Otherwise, perform
factory reprogramming of MicroPython firmware (completely erase flash, followed
by firmware programming).

...repeats every 5secs...
Sometimes if I reflash it cleans it up, othertimes not.

mad474
Posts: 60
Joined: Sun Dec 29, 2013 7:48 pm

Re: New mp-esp8266-firmware-v01.bin on ESP8266

Post by mad474 » Mon Mar 14, 2016 10:36 am

mpymike wrote:I've been programming a bunch of ESP01s of dubious quality...
A couple of them gave me this boot_ error.
For 3 out of 3 ESP-01 with Manufacturer: c8, Device: 4013 I can confirm that error on running import boot_.
And 3 out of 3 ESP-01 with Manufacturer: e0, Device: 4014 go through "import boot_" flawlessly.

mpymike
Posts: 10
Joined: Mon May 26, 2014 5:48 am

Re: New mp-esp8266-firmware-v01.bin on ESP8266

Post by mpymike » Mon Mar 14, 2016 2:55 pm

How do you find out what the manufacturer and device codes are?

Locked