Problem with uasyncio running picoweb - TypeError: function takes 2 positional arguments but 3 were given
Posted: Sat Feb 02, 2019 8:40 am
Hi,
I am trying to launch a picoweb on micropython 1.10 with stocked uasyncio on my esp8266 board. I upload picoweb by ading them to the compiled package: micropython -m upip install -p modules picoweb
an then compiling and uploading the firmware to the board.
Everything works good until I try to launch any picoweb example, let's take this simple one: https://github.com/pfalcon/picoweb/blob ... webapp2.py
The only change is:
app.run(debug=True)
to
app.run(debug=True, host=station.ifconfig()[0])
The program starts with no issues but upon receiving first connection from the client I get:
Traceback (most recent call last):
File "main.py", line 46, in <module>
File "picoweb/__init__.py", line 298, in run
File "uasyncio/core.py", line 161, in run_forever
File "uasyncio/core.py", line 136, in run_forever
File "uasyncio/__init__.py", line 60, in remove_writer
TypeError: function takes 2 positional arguments but 3 were given
MicroPython v1.10 on 2019-02-02; ESP module with ESP8266
Type "help()" for more information.
Not sure how to move forward, any hints?
EDIT: pulled in the latest and greatest picoweb from https://github.com/pfalcon/picoweb and still get the same issue but captured some additional info:
* Running on http://192.168.0.87:8081/
INFO:picoweb:211.000 <HTTPRequest object at 3fff29b0> <StreamWriter <socket state=3 timeout=0 incoming=3fff95c8 off=23>> "GET /squares"
ERROR:picoweb:211.000 <HTTPRequest object at 3fff29b0> <StreamWriter <socket state=3 timeout=0 incoming=0 off=0>> ImportError("no module named 'utemplate'",)
Traceback (most recent call last):
File "picoweb/__init__.py", line 203, in _handle
File "main.py", line 37, in squares
File "picoweb/__init__.py", line 246, in render_template
File "picoweb/__init__.py", line 241, in _load_template
ImportError: no module named 'utemplate'
Traceback (most recent call last):
File "main.py", line 41, in <module>
File "picoweb/__init__.py", line 298, in run
File "uasyncio/core.py", line 161, in run_forever
File "uasyncio/core.py", line 136, in run_forever
File "uasyncio/__init__.py", line 60, in remove_writer
TypeError: function takes 2 positional arguments but 3 were given
MicroPython v1.10 on 2019-02-02; ESP module with ESP8266
Type "help()" for more information.
I am trying to launch a picoweb on micropython 1.10 with stocked uasyncio on my esp8266 board. I upload picoweb by ading them to the compiled package: micropython -m upip install -p modules picoweb
an then compiling and uploading the firmware to the board.
Everything works good until I try to launch any picoweb example, let's take this simple one: https://github.com/pfalcon/picoweb/blob ... webapp2.py
The only change is:
app.run(debug=True)
to
app.run(debug=True, host=station.ifconfig()[0])
The program starts with no issues but upon receiving first connection from the client I get:
Traceback (most recent call last):
File "main.py", line 46, in <module>
File "picoweb/__init__.py", line 298, in run
File "uasyncio/core.py", line 161, in run_forever
File "uasyncio/core.py", line 136, in run_forever
File "uasyncio/__init__.py", line 60, in remove_writer
TypeError: function takes 2 positional arguments but 3 were given
MicroPython v1.10 on 2019-02-02; ESP module with ESP8266
Type "help()" for more information.
Not sure how to move forward, any hints?
EDIT: pulled in the latest and greatest picoweb from https://github.com/pfalcon/picoweb and still get the same issue but captured some additional info:
* Running on http://192.168.0.87:8081/
INFO:picoweb:211.000 <HTTPRequest object at 3fff29b0> <StreamWriter <socket state=3 timeout=0 incoming=3fff95c8 off=23>> "GET /squares"
ERROR:picoweb:211.000 <HTTPRequest object at 3fff29b0> <StreamWriter <socket state=3 timeout=0 incoming=0 off=0>> ImportError("no module named 'utemplate'",)
Traceback (most recent call last):
File "picoweb/__init__.py", line 203, in _handle
File "main.py", line 37, in squares
File "picoweb/__init__.py", line 246, in render_template
File "picoweb/__init__.py", line 241, in _load_template
ImportError: no module named 'utemplate'
Traceback (most recent call last):
File "main.py", line 41, in <module>
File "picoweb/__init__.py", line 298, in run
File "uasyncio/core.py", line 161, in run_forever
File "uasyncio/core.py", line 136, in run_forever
File "uasyncio/__init__.py", line 60, in remove_writer
TypeError: function takes 2 positional arguments but 3 were given
MicroPython v1.10 on 2019-02-02; ESP module with ESP8266
Type "help()" for more information.