Micropython V1.14 Problem

All ESP32 boards running MicroPython.
Target audience: MicroPython users with an ESP32 board.
Post Reply
joker12
Posts: 3
Joined: Mon Feb 08, 2021 9:19 pm

Micropython V1.14 Problem

Post by joker12 » Mon Feb 08, 2021 9:28 pm

Hi,

I've been using Micropython v1.13 for some time and use webrepl to program the board using Thonny v3.3.3.
This is the code in my boot.py:

import esp
esp.osdebug(None)
import network
wlan = network.WLAN(network.STA_IF)
wlan.active(True)
wlan.connect('xxxxx', 'xxxxx')
wlan.isconnected()
import webrepl
webrepl.start()


I uploaded Micropython v1.14 and set it up the same way and enabled webrepl. The board crashes when it reaches wlan.active(True).

Has anyone else had a problem with the new version?

I reverted back to 1.13 and everything is fine again.

marcidy
Posts: 26
Joined: Sat Dec 12, 2020 11:07 pm

Re: Micropython V1.14 Problem

Post by marcidy » Wed Feb 10, 2021 9:01 pm

I'd would be helpful if you add details of the crash from the console.

And if the debug level doesn't impact the crash, I'd suggest raising it.

If it's a brownout, you need to provide more power.

joker12
Posts: 3
Joined: Mon Feb 08, 2021 9:19 pm

Re: Micropython V1.14 Problem

Post by joker12 » Thu Feb 11, 2021 12:23 am

Thanks for the reply.
I've installed version 1.14 on 3 ESP32's.

Tried running webrepl in Thonney with the following result on each one:

WebREPL connected
>>>
Exception in thread Thread-1:
Traceback (most recent call last):
File "D:\Users\xxx\AppData\Local\Programs\Thonny\lib\site-packages\websockets\protocol.py", line 827, in transfer_data
message = await self.read_message()
File "D:\Users\xxx\AppData\Local\Programs\Thonny\lib\site-packages\websockets\protocol.py", line 910, in read_message
return frame.data.decode("utf-8") if text else frame.data
UnicodeDecodeError: 'utf-8' codec can't decode byte 0x80 in position 0: invalid start byte

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "D:\Users\xxx\AppData\Local\Programs\Thonny\lib\threading.py", line 926, in _bootstrap_inner
self.run()
File "D:\Users\joker\AppData\Local\Programs\Thonny\lib\threading.py", line 870, in run
self._target(*self._args, **self._kwargs)
File "D:\Users\xxx\AppData\Local\Programs\Thonny\lib\site-packages\thonny\plugins\micropython\webrepl_connection.py", line 54, in _wrap_ws_main
loop.run_until_complete(self._ws_main())
File "D:\Users\xxx\AppData\Local\Programs\Thonny\lib\asyncio\base_events.py", line 587, in run_until_complete
return future.result()
File "D:\Users\xxx\AppData\Local\Programs\Thonny\lib\site-packages\thonny\plugins\micropython\webrepl_connection.py", line 66, in _ws_main
await asyncio.gather(self._ws_keep_reading(), self._ws_keep_writing())
File "D:\Users\xxx\AppData\Local\Programs\Thonny\lib\site-packages\thonny\plugins\micropython\webrepl_connection.py", line 123, in _ws_keep_writing
await self._ws.send(payload)
File "D:\Users\xxx\AppData\Local\Programs\Thonny\lib\site-packages\websockets\protocol.py", line 555, in send
await self.ensure_open()
File "D:\Users\xxx\AppData\Local\Programs\Thonny\lib\site-packages\websockets\protocol.py", line 812, in ensure_open
raise self.connection_closed_exc()
websockets.exceptions.ConnectionClosedError: code = 1006 (connection closed abnormally [internal]), no reason


It looks like something in Thonny is broken by the new version.

Power is fine.

I then reinstall version 1.13 and it always works:

WebREPL connected
>>> MicroPython v1.13 on 2020-09-02; ESP32 module with ESP32
Type "help()" for more information.
>>>

bertel
Posts: 27
Joined: Tue Feb 09, 2021 3:55 pm
Location: Tokyo

Re: Micropython V1.14 Problem

Post by bertel » Fri Feb 12, 2021 11:13 am

Thonny 3.3.3:

Code: Select all

Initializing Wifi
WebREPL daemon started on ws://192.168.73.69:8266
Started webrepl in normal mode
network config: ('192.168.73.69', '255.255.255.0', '192.168.73.1', '192.168.73.1')
Free mem: 3.90155 MB
Flash size: 16.0 MB
Free flash: 13.98828 MB
MicroPython v1.14-13-gdf85e4881-dirty on 2021-02-12; ESP32 module (spiram) with ESP32
Type "help()" for more information.

User avatar
aivarannamaa
Posts: 117
Joined: Fri Sep 22, 2017 3:19 pm
Location: Estonia
Contact:

Re: Micropython V1.14 Problem

Post by aivarannamaa » Wed Feb 17, 2021 11:28 am

Joker, this problem has been reported at https://github.com/micropython/micropython/issues/6912.

Next Thonny version (hopefully released by the end of this week) will include a work-around.
Aivar Annamaa
https://thonny.org

User avatar
aivarannamaa
Posts: 117
Joined: Fri Sep 22, 2017 3:19 pm
Location: Estonia
Contact:

Re: Micropython V1.14 Problem

Post by aivarannamaa » Thu Feb 18, 2021 8:52 am

Thonny 3.3.4 is now released, including the work-around regarding the WebREPL issue in MicroPython 1.14:
https://github.com/thonny/thonny/releases/tag/v3.3.4
Aivar Annamaa
https://thonny.org

User avatar
aivarannamaa
Posts: 117
Joined: Fri Sep 22, 2017 3:19 pm
Location: Estonia
Contact:

Re: Micropython V1.14 Problem

Post by aivarannamaa » Tue Feb 23, 2021 8:09 am

A regression was introduced in Thonny 3.3.4 (object evaluation in the REPL gave too short capped repr-s). A fix is now published in 3.3.5: https://github.com/thonny/thonny/releases/tag/v3.3.5
Aivar Annamaa
https://thonny.org

joker12
Posts: 3
Joined: Mon Feb 08, 2021 9:19 pm

Re: Micropython V1.14 Problem

Post by joker12 » Sun Mar 07, 2021 10:19 pm

Thanks for the update. I now know I'm sane?

Post Reply