Presto: ImportError: no module named '_thread'

Threading isn’t supported on the Presto? WTH?

I noticed this the other day. It looks like threading is disabled in the board defintion. I think changing that to (1), recompiling, and putting the new firmware on the board would then enable threading to at least import, even if it doesn’t fully work.

I would be interested in knowing whether it’s not been enabled for a specific reason.

[Edit to add] I don’t fully understand the C++ code, but I’m getting the impression one core is dedicated to running the screen. There are calls to the pico_sdk’s multicore code in presto.cpp. It might be that core0 runs user-supplied MicroPython while core1 is occupied with running the display, ambient LEDs, and perhaps other functions. That would definitely explain disabling threading.

I think they need to grab core1 to drive the display.


MPY: soft reboot
MicroPython feature/presto-wireless, presto v0.0.6 on 2025-01-08; Presto with RP2350

Type "help()" for more information.

>>> %Run -c $EDITOR_CONTENT

MPY: soft reboot
malloc self
set fb pointers
m_new_class(ST7701...
launch core1
launched core1
core1 returned

────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
Traceback (most recent call last):
  File "<stdin>", line 75, in <module>
  File "presto.py", line 81, in update
  File "touch.py", line 65, in poll
KeyboardInterrupt: 
>
MPY: soft reboot
signal core1
core1 returned
MicroPython feature/presto-wireless, presto v0.0.6 on 2025-01-08; Presto with RP2350

Type "help()" for more information.

>>> 

The display is great so, “Something gained and something lost …”

Tried switching to asyncio vs threads for my project, but aiohttp also isn’t supported. Guess I’m stuck with requests in a blocking loop for now.