Page 1 of 5

ESP01 MicroPython install

Posted: Wed Sep 21, 2016 4:11 am
by kodefoo
Hello! This is my first post. I've been doing some experimenting with an ESP01 board from Addicore (http://www.addicore.com/ESP8266-ESP-01-p/130.htm). I would like to get MicroPython running on this board if possible, but I'm running into some trouble. I've flashed the latest v1.8.4 firmware, but I can't connect to the ESP01 serially and I do not see the AP running either. The ESP01 is connected to a Windows PC via an arduino uno.

Here is what I have done.
1) Erased flash with esptool
>esptool -p COM5 erase_flash
esptool.py v1.1
Connecting...
Erasing flash (this may take a while)...

No output after the above line saying Erasing flash FYI.

2) Flashed new firmware
>esptool.py --port COM5 --baud 115200 write_flash --flash_size=8m 0 esp8266-20160909-v1.8.4.bin
esptool.py v1.1
Connecting...
Running Cesanta flasher stub...
Flash params set to 0x0020
Writing 565248 @ 0x0... 565248 (100 %)
Wrote 565248 bytes at 0x0 in 48.1 seconds (94.1 kbit/s)...
Leaving...

This seemed to work fine with no errors, but after the flash I'm getting a blue light on the ESP01 and the following output over serial.
Fatal exception (28):
epc1=0x4000228b, epc2=0x00000000, epc3=0x00000000, excvaddr=0x000000b5, depc=0x0 0000000

This repeats over and over until I power cycle the ESP01. After the power cycle the unit has the usual red light lit and will not respond to any input even after moving it out of boot loading mode.

Any suggestions would be greatly appreciated.

Thank you!

Re: ESP01 MicroPython install

Posted: Wed Sep 21, 2016 5:36 am
by rcolistete
MicroPython >= 1.8.1 for ESP8266 needs more than 512KB of flash memory, so ESP-01 doesn't work with.

AFAIK, MicroPython 1.8.0 for ESP8266 sent by email in May 3rd 2016 to ESP8266 Kickstarter supporters would work as it has 493,994 bytes. See the firmware "esp8266-2016-05-03-v1.8.bin" in my host :
http://www.robertocolistete.net/MicroPy ... 3-v1.8.bin

Re: ESP01 MicroPython install

Posted: Wed Sep 21, 2016 6:59 am
by deshipu
Actually there are ESP-01 modules with 1MB memory, on which MicroPython works just fine. But it won't fit on the 512kB ones.

Re: ESP01 MicroPython install

Posted: Wed Sep 21, 2016 8:32 pm
by jms
An alternative is to build it with unused features removed such as axtls and drivers for stuff you don't have. Study the map to work out how feasible this is with current versions.

Re: ESP01 MicroPython install

Posted: Wed Sep 21, 2016 8:36 pm
by markxr
If you have 512k flash, then there won't be enough room for a filesystem, so I suppose, we should build a version of Micropython for the ESP8266 without the filesystem and that may save enough space to fit in 512k?

Of course you then need to store your app in the scripts/ directory to be built with the image.

Re: ESP01 MicroPython install

Posted: Wed Sep 21, 2016 8:45 pm
by deshipu
The filesystem is created at first boot after flashing, and only if there is room for it, so you don't have to disable it.

Re: ESP01 MicroPython install

Posted: Thu Sep 22, 2016 2:28 am
by mcauser
+1 for making drivers configurable.

It would be great to be able to save space when compiling by toggling features you won't need, such as DHT, NeoPixel, APA102, berkeley db, etc.

eg. pfalcon's esp8266: Make APA102 driver inclusion configurable.
https://github.com/micropython/micropyt ... fc828217b6

Re: ESP01 MicroPython install

Posted: Thu Sep 22, 2016 5:29 am
by Roberthh
Even if that shounds harsh: dont't waste your time on a 512k ESP-01. Use it as it is as a modem, if you like, and get one with larger flash for MicroPython.

Re: ESP01 MicroPython install

Posted: Thu Sep 22, 2016 7:08 am
by mad474
@Roberthh: Sorry, but I don't agree. For the sake of sustainability and for the "Micro" in MicroPython I would (and will) continue to invest efforts in ESP-01 (even if the 512k version may get deprecated - I still have tons, well, tens of them in the field).

Easy feature (and size) configurability would be very much appreciated!

Re: ESP01 MicroPython install

Posted: Thu Sep 22, 2016 8:22 am
by platforma
Your best bet would be, as jms said, disabling features if you want to squeeze into the ESP-01. Good starting points are esp8266/mpconfigport.h and the Makefile of course. I agree with the need for a config tool (something similar to linux/crosstool-NG UI perhaps) but reading the Makefile should provide a good idea of what's compiled and linked into the final image, and then you can follow on and disable what you need.