My Huzzah feather works like a charm so far. Just flashed the v3 alpha and took some time to poke around...
The block device now shows up a little more descriptive (using dir(bdev)), or I did learn some more details by implementing my own file based block device in the Unix port as a practice.
The previous content of my flash filesystem did show up as previously seen and the simple test module is able to import as usual.
The introduction to the WebREPL did also work flawlessly for the initial walk around.
One difference i can see is what is being printed onto the serial REPL and the WebREPL. Please check esp.meminfo at the end of the session. The command got repeated from the WebREPL and the UART REPL, always showing the whole truth only on the UART REPL.
Let me provide you with the whole transcript for completeness:
WebREPL:
Code: Select all
Welcome to MicroPython!
Connected
>>> dir()
['webrepl2', '__name__', 'builtins', 'uos', 'bdev', 'vfs']
>>> dir(builtsins)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
NameError: name 'builtsins' is not defined
>>> dir(builtins)
['__build_class__', '__import__', '__repl_print__', 'bool', 'bytes', 'bytearray'
, 'dict', 'enumerate', 'filter', 'float', 'frozenset', 'int', 'list', 'map', 'me
moryview', 'object', 'property', 'range', 'reversed', 'set', 'str', 'super', 'tu
ple', 'type', 'zip', 'classmethod', 'staticmethod', 'Ellipsis', 'abs', 'all', 'a
ny', 'bin', 'callable', 'chr', 'dir', 'divmod', 'eval', 'exec', 'getattr', 'seta
ttr', 'globals', 'hasattr', 'hash', 'hex', 'id', 'isinstance', 'issubclass', 'it
er', 'len', 'locals', 'max', 'min', 'next', 'oct', 'ord', 'pow', 'print', 'repr'
, 'round', 'sorted', 'sum', 'BaseException', 'ArithmeticError', 'AssertionError'
, 'AttributeError', 'EOFError', 'Exception', 'GeneratorExit', 'ImportError', 'In
dentationError', 'IndexError', 'KeyboardInterrupt', 'KeyError', 'LookupError', '
MemoryError', 'NameError', 'NotImplementedError', 'OSError', 'OverflowError', 'R
untimeError', 'StopIteration', 'SyntaxError', 'SystemExit', 'TypeError', 'Unicod
eError', 'ValueError', 'ZeroDivisionError', 'open']
>>> vfs.listdir()
['desd.py']
>>> d = open('desd.py', 'r')
>>> d.readlines()
readblocks(7, 3fff29d0(4096))
['print(2*2)']
>>> import desd
readblocks(2, 3fff3210(4096))
readblocks(7, 3fff3560(4096))
4
>>> import esp
>>> dir(esp)
['__name__', 'osdebug', 'sleep_type', 'deepsleep', 'flash_id', 'flash_read', 'fl
ash_write', 'flash_erase', 'neopixel_write', 'freemem', 'meminfo', 'SLEEP_NONE',
'SLEEP_LIGHT', 'SLEEP_MODEM', 'STA_MODE', 'AP_MODE', 'STA_AP_MODE']
>>> import machine
>>> dir(machine)
['__name__', 'mem8', 'mem16', 'mem32', 'freq', 'reset', 'unique_id', 'Timer', 'P
in', 'PWM', 'ADC', 'UART', 'I2C', 'SPI']
>>> esp.meminfo()
sp: 0x3ffff850
>>> esp.meminfo()
sp: 0x3ffff850
>>> esp.meminfo()
sp: 0x3ffff850
>>>
One the UART REPL i did the following:
Code: Select all
>>> dir()
['__name__', 'builtins', 'uos', 'bdev', 'vfs']
>>> dir(bdev)
['__init__', '__module__', 'ioctl', 'SEC_SIZE', '__qualname__', 'NUM_BLK', 'read blocks', 'START_SEC', 'writeblocks', 'blocks']
>>> bdev.blocks
64
>>> bdev.SEC_SIZE
4096
>>> bdev.START_SEC
160
>>> bdev.NUM_BLK
64
>>> vfs.listdir()
['desd.py']
>>> dir(vfs)
['mkfs', 'open', 'listdir', 'mkdir', 'remove', 'rename']
>>> import webrepl2
Bind address info: [(2, 1, 0, '', ('0.0.0.0', 8080))]
<socket state=2 timeout=-1 incoming=3fff62f8 remaining=0>
b'GET / HTTP/1.1\r\n'(b'Host', b'192.168.188.57:8080')
(b'Connection', b'Upgrade')
(b'Pragma', b'no-cache')
(b'Cache-Control', b'no-cache')
(b'Upgrade', b'websocket')
(b'Origin', b'file://')
(b'Sec-WebSocket-Version', b'13')
(b'User-Agent', b'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/49.0.2623.112 Safari/537.36')
(b'Accept-Encoding', b'gzip, deflate, sdch')
(b'Accept-Language', b'de-DE,de;q=0.8,en-US;q=0.6,en;q=0.4')
(b'Sec-WebSocket-Key', b'5Vxe1X0RNBwP+yGG3+qlzw==')
(b'Sec-WebSocket-Extensions', b'permessage-deflate; client_max_window_bits')
b'5Vxe1X0RNBwP+yGG3+qlzw==' 24
b'6}\x07\x1bQ\xc7\xe4z\x98\xff\xe0\xa2\xd2\xce\x87\xaf\xa1\x8c\xf04'
b'Nn0HG1HH5HqY/+Ci0s6Hr6GM8DQ='
b'HTTP/1.1 101 Switching Protocols\r\nUpgrade: websocket\r\nConnection: Upgrade\r\nSec-WebSocket-Accept: Nn0HG1HH5HqY/+Ci0s6Hr6GM8DQ=\r\n\r\n'
Connected
>>> dir()
['webrepl2', '__name__', 'builtins', 'uos', 'bdev', 'vfs']
>>> dir(builtsins)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
NameError: name 'builtsins' is not defined
>>> dir(builtins)
['__build_class__', '__import__', '__repl_print__', 'bool', 'bytes', 'bytearray', 'dict', 'enumerate', 'filter', 'float', 'frozenset', 'int', 'list', 'map', 'memoryview', 'object', 'property', 'range', 'reversed', 'set', 'str', 'super', 'tuple', 'type', 'zip', 'classmethod', 'staticmethod', 'Ellipsis', 'abs', 'all', 'any', 'bin', 'callable', 'chr', 'dir', 'divmod', 'eval', 'exec', 'getattr', 'setattr', 'globals', 'hasattr', 'hash', 'hex', 'id', 'isinstance', 'issubclass', 'iter', 'len', 'locals', 'max', 'min', 'next', 'oct', 'ord', 'pow', 'print', 'repr', 'round', 'sorted', 'sum', 'BaseException', 'ArithmeticError', 'AssertionError', 'AttributeError', 'EOFError', 'Exception', 'GeneratorExit', 'ImportError', 'IndentationError', 'IndexError', 'KeyboardInterrupt', 'KeyError', 'LookupError', 'MemoryError', 'NameError', 'NotImplementedError', 'OSError', 'OverflowError', 'RuntimeError', 'StopIteration', 'SyntaxError', 'SystemExit', 'TypeError', 'UnicodeError', 'ValueError', 'ZeroDivisionError', 'open']
>>> vfs.listdir()
['desd.py']
>>> d = open('desd.py', 'r')
>>> d.readlines()
readblocks(7, 3fff29d0(4096))
['print(2*2)']
>>> import desd
readblocks(2, 3fff3210(4096))
readblocks(7, 3fff3560(4096))
4
>>> import esp
>>> dir(esp)
['__name__', 'osdebug', 'sleep_type', 'deepsleep', 'flash_id', 'flash_read', 'flash_write', 'flash_erase', 'neopixel_write', 'freemem', 'meminfo', 'SLEEP_NONE', 'SLEEP_LIGHT', 'SLEEP_MODEM', 'STA_MODE', 'AP_MODE', 'STA_AP_MODE']
>>> import machine
>>> dir(machine)
['__name__', 'mem8', 'mem16', 'mem32', 'freq', 'reset', 'unique_id', 'Timer', 'Pin', 'PWM', 'ADC', 'UART', 'I2C', 'SPI']
>>> esp.meminfo()
data : 0x3ffe8000 ~ 0x3ffe83e8, len: 1000
rodata: 0x3ffe83f0 ~ 0x3ffe8e4c, len: 2652
bss : 0x3ffe8e50 ~ 0x3fff5780, len: 51504
heap : 0x3fff5780 ~ 0x3fffc000, len: 26752
sp: 0x3ffff850
>>> esp.meminfo()
data : 0x3ffe8000 ~ 0x3ffe83e8, len: 1000
rodata: 0x3ffe83f0 ~ 0x3ffe8e4c, len: 2652
bss : 0x3ffe8e50 ~ 0x3fff5780, len: 51504
heap : 0x3fff5780 ~ 0x3fffc000, len: 26752
sp: 0x3ffff850
>>> esp.meminfo()
data : 0x3ffe8000 ~ 0x3ffe83e8, len: 1000
rodata: 0x3ffe83f0 ~ 0x3ffe8e4c, len: 2652
bss : 0x3ffe8e50 ~ 0x3fff5780, len: 51504
heap : 0x3fff5780 ~ 0x3fffc000, len: 26752
sp: 0x3ffff850
>>>
Sadly i do have little spare time besides my day job these days, so more tests must be delayed until next weekend...