Hi,
I flashed esp8266-20160809-v1.8.3.bin to my esp8266-01.
When I boot the esp8266 now I get an error (full output below):
Traceback (most recent call last):
File "boot.py", line 5, in <module>
File "webrepl.py", line 6, in <module>
File "websocket_helper.py", line 1
SyntaxError: invalid syntax
Can somebody please tell me what the problem is? A syntax-error in boot.py?
I just flashed the .bin-file. I used the --verify-option and got an OK.
It seems I cannot use machine.xxx objects. Webrepl seems not to be working too.
I executed
>>> esp.check_fw()
size: 558748
md5: 66cd5e59c4f2236a5bc3b7c97789adc3
False
That function unfortunately is not documented in https://docs.micropython.org/en/latest/ ... y/esp.html but 'False' is probably bad?
Thank you!
Output at boot:
�������������������������������������������������������������
�������������������������������������������������������������
�������������������������������������������������������������
�������������������������������������������������������������
�������������������������������������������������������������
�������������������������������������������������������������
�������������������������������������������������������������
�������������������������������������������������������������
�������������������������������������������������������������
�������������������������������������������������������������
������������������������������������������l)
h, v = [x.strip() for x in l.split(b":", 1)]
if DEBUG:
print((h, v))
if h == b'Sec-WebSocket-Key':
webkey = v
if not webkey:
raise OSError("Not a websocket request")
if DEBUG:
print("Sec-WebSocket-Key:", webkey, len(webkey))
d = hashlib.sha1(webkey)
d.update(b"258EAFA5-E914-47DA-95CA-C5AB0DC85B11")
respkey = d.digest()
respkey = binascii.b2a_base64(respkey)[:-1]
if DEBUG:
print("respkey:", respkey)
sock.send(b"""\
HTTP/1.1 101 Switching Protocols\r
Upgrade: websocket\r
Connection: Upgrade\r
Sec-WebSocket-Accept: """)
sock.send(respkey)
sock.send("\r\n\r\n")
# Very simplified client handshake, works for MicroPython's
# websocket server implementation, but probably not for other
# servers.
def client_handshake(sock):
cl = sock.makefile("rwb", 0)
cl.write(b"""\
GET / HTTP/1.1\r
Host: echo.websocket.org\r
Connection: Upgrade\r
Upgrade: websocket\r
Sec-WebSocket-Key: foo\r
\r
""")
l = cl.readline()
# print(l)
while 1:
l = cl.readline()
if l == b"\r\n":
break
# sys.stdout.write(l)
Traceback (most recent call last):
File "boot.py", line 5, in <module>
File "webrepl.py", line 6, in <module>
File "websocket_helper.py", line 1
SyntaxError: invalid syntax
could not open file 'main.py' for reading
MicroPython v1.8.3-10-g2401581 on 2016-08-09; ESP module with ESP8266
Type "help()" for more information.
>>>
SyntaxError at boot with esp8266-20160809-v1.8.3.bin
- pythoncoder
- Posts: 5956
- Joined: Fri Jul 18, 2014 8:01 am
- Location: UK
- Contact:
Re: SyntaxError at boot with esp8266-20160809-v1.8.3.bin
False is indeed bad and indicates that the firmware image is invalid. Does your device have sufficient flash to accommodate it?
Peter Hinch
Index to my micropython libraries.
Index to my micropython libraries.
-
- Posts: 35
- Joined: Tue Aug 09, 2016 6:56 pm
Re: SyntaxError at boot with esp8266-20160809-v1.8.3.bin
I had the same error when I switched from some older version of 1.8.2 to 1.8.3. I was also using something different at that time, not esptool. Cleaning flash and flashing the image with esptool solved the problem for me, so try running these 2 commands first (and replace the name of the image if needed):
Code: Select all
esptool.py --port COM3 erase_flash
esptool.py --port COM3 --baud 460800 write_flash --flash_size=8m 0 esp8266-20160809-v1.8.3-release.bin
Re: SyntaxError at boot with esp8266-20160809-v1.8.3.bin
Fortunately, everything is documented in troubleshooting section: http://docs.micropython.org/en/latest/e ... n-problemsThat function unfortunately is not documented in https://docs.micropython.org/en/latest/ ... y/esp.html but 'False' is probably bad?
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/
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/
Re: SyntaxError at boot with esp8266-20160809-v1.8.3.bin
My ESP8266 should have 512KB. The 1.8.3.bin-file has 558,8KB, so maybe it is to large.
I now flashed 1.8.2.bin which is 507,6KB. It seems to be working so far...
I now flashed 1.8.2.bin which is 507,6KB. It seems to be working so far...