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.
mad474
Posts: 60
Joined: Sun Dec 29, 2013 7:48 pm

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

Post by mad474 » Wed Mar 09, 2016 10:14 am

NOTE: This topic discusses early access firmware provided to Kickstarter backers of the appropriate categories (whose reward description included early access to alpha releases).

In the morning mails I found the shiny new alpha release. Thanks alot! I can tell you it's a pleasure now to run longer/endless routines/loops without interruption.

I also found a few nits:

#1 Email: The howto deploy statement in the mail says
"esptool.py --port /dev/ttyUSB0 --baud 460800 write_flash --flash_size=8m 0
mp-esp8266-firmware.bin" whereas the name of the binary is "-v01" longer.

#2 After successfully flashing and evoking REPL, I receive the following output with about 20 seconds interval between the output lines:

Code: Select all

>>> chg_A3:-180
chg_A3:0
chg_A3:-180
chg_A3:0
chg_A3:-180
chg_A3:0
chg_A3:-180
chg_A3:0
After a few minutes everything looks normal.

#3 Quickref at http://micropython.org/resources/docs/e ... networking

In oder to get the useful function do_connect() to do its work I had to change line 3:

Code: Select all

- wlan = network.WLAN(wlan.STA_IF)
+ wlan = network.WLAN(network.STA_IF)
because otherwise

Code: Select all

>>> do_connect()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "<stdin>", line 3, in do_connect
NameError: local variable referenced before assignment
and adjust the indentation in lines 7 to 10.

Please stop me if this is not the favoured way to feedback.

PS: My preliminary testing setup/device is an ESP8266 ESP-01 512K (flash_id Manufacturer: c8, Device: 4013)
Last edited by mad474 on Thu Mar 17, 2016 6:53 am, edited 2 times in total.

Turbinenreiter
Posts: 288
Joined: Sun May 04, 2014 8:54 am

Re: New mp-esp8266-firmware-v01.bin on ESP8266 ESP-01 512K

Post by Turbinenreiter » Wed Mar 09, 2016 10:42 am

I can't seem to get a REPL up on my Adafruit Feather HUZZAH.

Code: Select all

plam@linx:~/Downloads$ esptool.py --port /dev/ttyUSB0 erase_flash
Connecting...
plam@linx:~/Downloads$ esptool.py --port /dev/ttyUSB0 --baud 115200 write_flash --flash_size=8m 0 mp-esp8266-firmware-v01.bin 
Connecting...
Erasing flash...
Took 1.99s to erase flash block
Wrote 451584 bytes at 0x00000000 in 43.5 seconds (83.1 kbit/s)...

Leaving...
picocom, serial, python serial.tools.miniterm - all turn up empty, no prompt. Sometimes broken chatachters: 0�~?�4�!��A$��2:���OC2�zI�$�:����:V:��К�:R)�v<�z�0�����NSs�nΌA��

What's the baudrate of the REPL?[/i]

EDIT:/
Baudrate is 115200 - specify it and it runs:

Code: Select all

plam@linx:~/Downloads$ picocom /dev/ttyUSB0 -b 115200
Let's use this thread to talk about v01 in general, if that's OK?

Most important thing to me is the I2C bus - currently it seems only writeto is implemented, is that right?

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

Re: New mp-esp8266-firmware-v01.bin on ESP8266 ESP-01 512K

Post by mad474 » Wed Mar 09, 2016 11:21 am

Turbinenreiter wrote:Let's use this thread to talk about v01 in general, if that's OK?
That's fine with me ("ESP-01" taken out of thread heading). Have to interrupt further testing till tonight, 'cos work is waiting.

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

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

Post by Damien » Wed Mar 09, 2016 1:04 pm

Great to hear that the code is working!

I updated the docs to fix the indent errors, the wlan->network typo, and include info about the baudrate of the REPL.

I2C reading is not yet implemented, sorry!

The messages you see at the start are O/S debug messages. They are sometimes useful, but can be turned off using esp.osdebug(None).

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 » Wed Mar 09, 2016 1:22 pm

I've got a fatal exception running import boot_ and os.listdir('/'). Wouldn't you prefer to see ESP related issues on github instead of this subforum?
Quick log:

Code: Select all

>>> import boot_
# mkfs ran here first time
>>> import os
readblocks(2, 3ffef6a0(4096))
>>> os.listdir('/')
Fatal exception 28(LoadProhibitedCause):
epc1=0x4024bd01, epc2=0x00000000, epc3=0x00000000, excvaddr=0x0000001c, depc=0x00000000

 ets Jan  8 2013,rst cause:1, boot mode:(1,2)

davidb24v
Posts: 3
Joined: Mon Mar 03, 2014 4:32 pm

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

Post by davidb24v » Wed Mar 09, 2016 5:42 pm

Just tried a Wemos D1 and the experience so far has been extremely positive.

The instructions in the email were spot on - just had to substitute the correct port and file name and it flashed straight away.

I initially guessed that the on-board USB wasn't on UART0 so connected up an FTDI board and that worked fine. I was wrong and could have saved some time, the on-board USB just works.

I followed the on-line docs and connected to my AP without any problem.

So, you can add Wemos D1 to the list of devices if it isn't already on there. Have got a couple of D1 mini boards on order so will try one of those when they arrive.

Great work! I have to say it's very nice to see results from a Kickstarter campaign so quickly.

Dave

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

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

Post by Damien » Wed Mar 09, 2016 6:01 pm

platforma wrote:I've got a fatal exception running import boot_ and os.listdir('/'). Wouldn't you prefer to see ESP related issues on github instead of this subforum?
Try simply os.listdir() without the slash. It should work. For now just pretend that the filesystem is relative only and never put a leading slash in your names.

Please continue to post bugs here for now, thanks!

hjm
Posts: 5
Joined: Sat Mar 05, 2016 12:42 pm

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

Post by hjm » Wed Mar 09, 2016 6:35 pm

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?

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

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

Post by profra » Wed Mar 09, 2016 8:37 pm

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?

Code: Select all

from machine import Pin
import neopixel

pin = Pin(0, Pin.OUT)   # set GPIO0 to output to drive NeoPixels
np = NeoPixel(pin, 8)   # create NeoPixel driver on GPIO0 for 8 pixels
np[0] = (255, 255, 255) # set the first pixel to white
np.write()              # write data to all pixels
r, g, b = np[0]         # get first pixel colour
neopixel.demo(np)       # run a demo
2 hours later problem solved... correction of source code

Code: Select all

from machine import Pin
import neopixel

pin = Pin(0, Pin.OUT)   # set GPIO0 to output to drive NeoPixels
np = neopixel.NeoPixel(pin, 8)   # create NeoPixel driver on GPIO0 for 8 pixels
np[0] = (255, 255, 255) # set the first pixel to white
np.write()              # write data to all pixels
r, g, b = np[0]         # get first pixel colour
neopixel.demo(np)       # run a demo
Also be careful... WEMOS D1 mini has another numbering of pins on board than ESP8266 chip
Last edited by profra on Wed Mar 09, 2016 11:39 pm, edited 4 times in total.

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

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

Post by Frida » Wed Mar 09, 2016 9:21 pm

On a esp8266-01
One Wire works with my snippet.

Code: Select all

from machine import Pin
import onewire
import time

ow = onewire.OneWire(Pin(0))
ds = onewire.DS18B20(ow)
roms = ds.scan()
print('roms',roms)

while 1:
	a = ds.start_measure()
	time.sleep_ms(1750)
	for rom in roms:
		print(ds.get_temp(rom))
		
And the output.

Code: Select all

24.6875
24.6875
24.6875
24.625
24.625
24.625
24.5625
24.5625
24.5625
24.5
2
help() seems not to eksist.

Code: Select all

PYB: soft reboot
could not find module 'boot'
MicroPython v1.5.2-395-g5f6d12c on 2016-03-08; ESP module with ESP8266
Type "help()" for more information.
>>> help()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
NameError: name 'help' is not defined
>>> dir()
['__name__']
Yes Frida is my watchdog!

Locked