micropython-nanoweb
micropython-nanoweb copied to clipboard
Slight syntax difference breaks example.py on the Pico W
The example.py file does not run correctly on a Pico W because the sys.implementation
function returns _mpy which does not match the current value being returned... mpy. Not sure how this should be handled.
Not sure it is a Nanoweb related problem.
Could you send an example ?
As an absolute novice in this area I can't contribute any more than the fact that today I have also been trying to run the example on Pico W and I'm also seeing 'mpy' errors, e.g.:
Task exception wasn't retrieved
future: <Task> coro= <generator object 'handle' at 20025020>
Traceback (most recent call last):
File "uasyncio/core.py", line 1, in run_until_complete
File "nanoweb.py", line 153, in handle
File "nanoweb.py", line 108, in generate_output
File "
The current implementation of MicroPython on the Pico W seems to expect _mpy instead of mpy in the sys.* library, as per the MicroPython docs
Change "sys.implementation.mpy" to "sys.implementation._mpy" on line 73 of example.py and it all works fine for me on the Pico W without exceptions, and displays and updates the system info as it should.