ImportError: no module named 'uwebsocket'

RP2040 based microcontroller boards running MicroPython.
Target audience: MicroPython users with an RP2040 boards.
This does not include conventional Linux-based Raspberry Pi boards.
Post Reply
aroca
Posts: 5
Joined: Sun May 03, 2020 12:39 am

ImportError: no module named 'uwebsocket'

Post by aroca » Sun Feb 13, 2022 11:46 am

Hello,

I am trying to build MicroPython v1.18 with WebREPL and Ethernet for the WIZnet W5100S-EVB-Pico. My starting point is this repository: https://github.com/Wiznet/RP2040-HAT-MicroPython.

The build works fine and Ethernet works. Next, I tried to add WebREPL support by adding this line to the manifest file:

include("$(MPY_DIR)/extmod/webrepl/manifest.py")

The build also works and webrepl is available, however, there are 2 issues:

The first:

>>>
MPY: soft reboot
MicroPython v1.18-10-g5db278f1d-dirty on 2022-02-12; Raspberry Pi Pico with RP20
Type "help()" for more information.
>>> import webrepl
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "webrepl.py", line 5, in <module>
ImportError: no module named 'uwebsocket'

>>> help('modules')
__main__ math uasyncio/stream ure
_boot micropython ubinascii uselect
_onewire neopixel ucollections usocket
_rp2 network uctypes ussl
_thread onewire uerrno ustruct
_uasyncio rp2 uhashlib usys
builtins ssd1306 uheapq utime
cmath uarray uio uzlib
dht uasyncio/__init__ ujson webrepl
ds18x20 uasyncio/core uos webrepl_setup
framebuf uasyncio/event upip websocket_helper
gc uasyncio/funcs upip_utarfile
machine uasyncio/lock urandom
Plus any modules on the filesystem

I verified the compilation process and the file moduwebsocket.c is compiled and linked during the compilation process. I verified the builds for ESP32 and ESP8266 and moduwebsocket.c seems to be compiled and linked in a similar way. However, on the ESP32 and ESP8266 uwebsocket appears when I run the command help('modules').

Manifest files are the same for the ESP32, ESP8266 and RPI Pico.

The other issue is a minor detail:

>>> import webrepl_setup
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "webrepl_setup.py", line 67
SyntaxError: invalid syntax

Any help will be great. Having WebREPL over ethernet on the Raspberry Pi Pico would be very nice.

best regards and thanks!

Rafael

Post Reply