Raspberry pi pico rp2
gide2578 opened this issue ยท 6 comments
python version: Python 3.9.5
jupyter_upydevice_kernel version: 0.0.4
I'm successfully using jupyter_upydevice_kernel with pyboard stm32 and ESP32 but having issues with Raspberry pi pico.
For example :
[1] %serialconnect /dev/ttyACM1
** Serial connected **
/dev/ttyACM1
MicroPython v1.15 on 2021-04-18; Raspberry Pi Pico with RP2040
Type "help()" for more information.
[2] import uos
[3] uos.uname()
(sysname='rp2', nodename='rp2', release='1.15.0', version='v1.15 on 2021-04-18 (GNU 10.2.0 MinSizeRel)', machine='Raspberry Pi Pico with RP2040')
works fine but :
[4] import uos
uos.uname()
in the same cell ends with a busy kernel...
Tested with Micropython rp2 1.13, 1.14 and 1.15.
Thanks for your help !
Hi @gide2578 unfortunately, I don't have a raspberry pi pico to test and see what is wrong.
However given that this works
[2] import uos
[3] uos.uname()
but this doesn't
[4] import uos
uos.uname()
I suspect something is wrong with the output affecting the line termination \n
or \r
characters
Could you try something like this?
[4] import uos; uos.uname()
If that doesn't work
You may want to use upydevice (develop branch if possible)
to debug the cause.
>>> from upydevice import Device
>>> pyb = Device('/dev/tty.usbmodem387E386731342', init=True)
>>> pyb.wr_cmd('import uos;uos.uname()', follow=True)
(sysname='pyboard', nodename='pyboard', release='1.15.0', version='v1.15-155-g62f75376d on 2021-05-28', machine='PYBLITEv1.0 with STM32F411RE')
>>> pyb.raw_buff
b"import uos;uos.uname()\r\n(sysname='pyboard', nodename='pyboard', release='1.15.0', version='v1.15-155-g62f75376d on 2021-05-28', machine='PYBLITEv1.0 with STM32F411RE')\r\n>>> "
Thank you very much for your answer,
[4] import uos; uos.uname()
works fine so the line termination characters may be the issue.
I'm still trying to debug with upydevice but with no result so far...
ImportError: cannot import name 'Device' from 'upydevice' (/usr/local/lib/python3.9/dist-packages/upydevice/__init__.py)
In [1]: from upydevice import SERIAL_DEVICE
In [2]: pyb = SERIAL_DEVICE('/dev/ttyACM0')
In [3]: pyb.wr_cmd('import uos;uos.uname()', follow=True)
(sysname='rp2', nodename='rp2', release='1.15.0', version='v1.15 on 2021-04-18 (GNU 10.2.0 MinSizeRel)', machine='Raspberry Pi Pico with RP2040')
In [4]: pyb.raw_buff
Out[4]: b"import uos;uos.uname()\r\n(sysname='rp2', nodename='rp2', release='1.15.0', version='v1.15 on 2021-04-18 (GNU 10.2.0 MinSizeRel)', machine='Raspberry Pi Pico with RP2040')\r\n>>> "
I think I found the bug, thanks for the report. ๐
So install upydevice
develop branch with $ pip install git+https://github.com/Carglglz/upydevice.git@develop
It should fix the multiline cell problem. ๐
The multiline cell problem is solved ! ๐
Thank you very much for your help, upydevice is by far the best micropython kernel !