picoweb error when client connect

All ESP32 boards running MicroPython.
Target audience: MicroPython users with an ESP32 board.
Post Reply
amirfh
Posts: 2
Joined: Sun Nov 18, 2018 10:34 pm

picoweb error when client connect

Post by amirfh » Mon Feb 25, 2019 9:59 am

need help pls :

INFO:picoweb:30.000 <HTTPRequest object at 3ffc3590> <StreamWriter <socket>> "GET /"
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "<string>", line 903, in <module>
File "/lib/picoweb/__init__.py", line 298, in run
File "/lib/uasyncio/core.py", line 161, in run_forever
File "/lib/uasyncio/core.py", line 136, in run_forever
File "/lib/uasyncio/__init__.py", line 60, in remove_writer
TypeError: function takes 2 positional arguments but 3 were given

User avatar
pythoncoder
Posts: 3503
Joined: Fri Jul 18, 2014 8:01 am
Location: UK
Contact:

Re: picoweb error when client connect

Post by pythoncoder » Mon Feb 25, 2019 10:26 am

I think you have mismatched versions of firmware and uasyncio. If you are running the official firmware, the version of uasyncio on PyPi will not run. You need to replace __init__.py and core.py in the uasyncio directory with those from the official micropython-lib.

The code on PyPi is only guaranteed to work with Paul Sokolovsky's fork of the firmware.
Peter Hinch

GHPS
Posts: 1
Joined: Thu Mar 14, 2019 8:21 pm

Re: picoweb error when client connect

Post by GHPS » Thu Mar 14, 2019 8:36 pm

>I think you have mismatched versions of firmware

You perfectly nailed it - as always.

Now it's easy to get picoweb working again - just copy the two files

https://github.com/micropython/micropyt ... o/uasyncio
https://github.com/micropython/micropyt ... io/core.py

to /lib/uasyncio

>The code on PyPi is only guaranteed to work

The most important messages were en passant:
1) The is a difference between pypi and the github repo.
The upip installer will _not_ take the github version.
2) Just recently there was split in the micropython community.

User avatar
pythoncoder
Posts: 3503
Joined: Fri Jul 18, 2014 8:01 am
Location: UK
Contact:

Re: picoweb error when client connect

Post by pythoncoder » Sat Mar 16, 2019 7:27 am

It is very unfortunate and causes a lot of needless confusion. @Damien has a solution but hasn't yet pushed it to the MicroPython repo.
Peter Hinch

Post Reply