tsaarni / esp32-micropython-webcam

ESP32-CAM webcam with MicroPython
Apache License 2.0
148 stars 33 forks source link

Uasynco #3

Closed Lennyz1988 closed 3 years ago

Lennyz1988 commented 5 years ago

I cannot get it to work. Probably because the latest version is now 1.5.4. The previous workaround does not work anymore.

Traceback (most recent call last): File "boot.py", line 16, in File "webcam.py", line 42, in run File "/lib/picoweb/init.py", line 299, in run File "/lib/uasyncio/core.py", line 163, in run_forever File "/lib/uasyncio/core.py", line 129, in run_forever File "/lib/uasyncio/init.py", line 31, in add_reader TypeError: function expected at most 3 arguments, got 4

Any idea how I can solve this?

Lennyz1988 commented 5 years ago

I manged to fix it by using a different Micropython fork. We currently need to use the Falcon build of Micropython. Apparently Pfalcon also wrote Picoweb. I forked the Falcon build and added your changes.

https://github.com/Lennyz1988/micropython.

I made a ready to flash working build.

https://github.com/Lennyz1988/micropython/releases/tag/v1

tsaarni commented 5 years ago

Thanks @Lennyz1988!

Actually I had somehow overlooked that Picoweb is not targeting standard Micropython, sorry for not realizing that.

Although Picoweb with asyncio support is nice, there is not much that the webcam use case can benefit from. So I'm wondering, maybe other web server should be used or since this is just one request, just enough HTTP support could be implemented inline directly with just sockets. That would allow basing on standard Micropython fork, if that is preferred. I don't have any long term goals with this project though, it is just for a personal need / curiosity...