picoweb - OSError: [Errno 11] EAGAIN

Discussion about programs, libraries and tools that work with MicroPython. Mostly these are provided by a third party.
Target audience: All users and developers of MicroPython.
Post Reply
mattzz
Posts: 5
Joined: Tue Nov 13, 2018 7:50 pm

picoweb - OSError: [Errno 11] EAGAIN

Post by mattzz » Sun Dec 02, 2018 5:41 pm

Hi,

I'm not exactly sure where to post this or where to file an issue - It seems to be connected to uasyncio and/or picoweb.

I'm working on a micropython/picoweb application that is running on an esp8266 based smart socket.
After having switched to pfalcon's forks of micropython and micropython-lib I'm getting an OSError as soon as I start the the picoweb app.

Code: Select all

* Running on http://0.0.0.0:80/
Traceback (most recent call last):
  File "main.py", line 1, in <module>
  File "obi_socket/__init__.py", line 31, in <module>
  File "picoweb/__init__.py", line 298, in run
  File "uasyncio/core.py", line 155, in run_forever
  File "uasyncio/core.py", line 110, in run_forever
  File "uasyncio/__init__.py", line 251, in start_server
OSError: [Errno 11] EAGAIN
MicroPython v1.9.3-1420-gfe98742-dirty on 2018-12-02; ESP module with ESP8266
(full code is here)

I'm pretty sure this is not related to my code because also this minimalistic test of picoweb fails:

Code: Select all

MicroPython v1.9.3-1420-gfe98742-dirty on 2018-12-02; ESP module with ESP8266
Type "help()" for more information.
>>>
>>>
paste mode; Ctrl-C to cancel, Ctrl-D to finish
=== import picoweb
===
=== app = picoweb.WebApp(__name__)
===
=== @app.route("/")
=== def index(req, resp):
===     yield from picoweb.start_response(resp)
===     yield from resp.awrite("How you doin'?")
===
=== app.run(debug=True)
===
* Running on http://127.0.0.1:8081/
Traceback (most recent call last):
  File "<stdin>", line 10, in <module>
  File "picoweb/__init__.py", line 298, in run
  File "uasyncio/core.py", line 155, in run_forever
  File "uasyncio/core.py", line 110, in run_forever
  File "uasyncio/__init__.py", line 251, in start_server
OSError: [Errno 11] EAGAIN
>>>
File "uasyncio/__init__.py", line 251:

Code: Select all

   s2, client_addr = s.accept()
Any ideas why the socket is not available? Am I missing something?


Edit: The problem persists using micropython/micropython and pfalcon/micropython-lib so it points towards pfalcon/micropython-lib

pfalcon
Posts: 1155
Joined: Fri Feb 28, 2014 2:05 pm

Re: picoweb - OSError: [Errno 11] EAGAIN

Post by pfalcon » Sun Dec 02, 2018 7:50 pm

So, this doesn't provide enough info to decide what may be wrong. Especially unclear:
The problem persists using micropython/micropython and pfalcon/micropython-lib so it points towards pfalcon/micropython-lib
Why does it point to that?

Anyway, are you aware of https://github.com/micropython/micropython/pull/4322 ?

Put my branch aside for now, test the latest mainline, then if problem is there, revert that patch and test again. And if outcomes differ, report to that PR.
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/

mattzz
Posts: 5
Joined: Tue Nov 13, 2018 7:50 pm

Re: picoweb - OSError: [Errno 11] EAGAIN

Post by mattzz » Sun Dec 02, 2018 8:15 pm

Bingo.
Reverting commit 4737ff8054e84b3ccd1e7364d773a8c1d14095f5 did the trick.
(Using micropython/micropython and pfalcon/micropython-lib --- picoweb depends on ulogging which is part of pfalcon/micropython-lib)

Thanks for pointing me to https://github.com/micropython/micropython/pull/4322

I see your point that I jumped a bit early to the conclusion that the issue pointed to micropython-lib.
And again - Thank you for taking your time to reply. I will report to the PR.

Post Reply