rshell cp command not working on Raspberry Pi Pico with MicroPython installed

Discussion about programs, libraries and tools that work with MicroPython. Mostly these are provided by a third party.
Target audience: All users and developers of MicroPython.
fmentiplay
Posts: 7
Joined: Fri Feb 14, 2020 12:10 am

rshell cp command not working on Raspberry Pi Pico with MicroPython installed

Post by fmentiplay » Thu Jan 28, 2021 7:59 am

Hello All
I am running MicroPython on the new Raspberry Pi Pico. I am trying to use rshell to copy files from my Windows 10 PC to the Raspberry Pi Pico.
PS C:\Users\xxxxl> rshell -p com14 -b 115200 --buffer-size 512 -> this works fine
C:\Users\xxxxx> ls /pyboard
pico_hello.py pico_i2c_scan.py pico_oled.py ssd1306.py
C:\Users\xxxxx> cd Documents/
I can copy from the raspberry pi Pico to the PC
C:\Users\xxxxx/Documents> cp /pyboard/ssd1306.py test07.py -> this works fine
If I try to copy from PC to Raspberry Pi Pico it times out with an error
C:\Users\xxxxx/Documents> cp test07.py /pyboard/test07.py -> this times out with errors
The final line of the Error output is ...
"rshell.pyboard.PyboardError: timeout waiting for first EOF reception"
Any help would be gratefully received.
Regards Frank

User avatar
sebi
Posts: 48
Joined: Tue Mar 29, 2016 9:36 pm
Location: France

Re: rshell cp command not working on Raspberry Pi Pico with MicroPython installed

Post by sebi » Thu Jan 28, 2021 9:07 am

Have you seen the other threads on the forum relative to the rp2? viewtopic.php?f=21&t=9646
I think people encounter similar issues and there is some work being done to fix such issues.

User avatar
dhylands
Posts: 3821
Joined: Mon Jan 06, 2014 6:08 pm
Location: Peachland, BC, Canada
Contact:

Re: rshell cp command not working on Raspberry Pi Pico with MicroPython installed

Post by dhylands » Fri Jan 29, 2021 6:47 am

My RPi pico board showed up.

I'm able to copy some files (like these 2 from the README.md: https://github.com/dhylands/upy-example ... aster/pico) but I was unable to copy the pwm_fade.py exampls from the ports/rp2/examples directory.

I'm not sure exactly what's going on, but I'm going to guess that it has something to do with either the USB driver or an interaction with writing to the filesystem and USB.

User avatar
Roberthh
Posts: 3667
Joined: Sat May 09, 2015 4:13 pm
Location: Rhineland, Europe

Re: rshell cp command not working on Raspberry Pi Pico with MicroPython installed

Post by Roberthh » Fri Jan 29, 2021 6:59 am

mpr works fine. Maybe you could compare it with what rshell implements.

fmentiplay
Posts: 7
Joined: Fri Feb 14, 2020 12:10 am

Re: rshell cp command not working on Raspberry Pi Pico with MicroPython installed

Post by fmentiplay » Fri Jan 29, 2021 9:54 am

dhylands wrote:
Fri Jan 29, 2021 6:47 am
My RPi pico board showed up.

I'm able to copy some files (like these 2 from the README.md: https://github.com/dhylands/upy-example ... aster/pico) but I was unable to copy the pwm_fade.py exampls from the ports/rp2/examples directory.

I'm not sure exactly what's going on, but I'm going to guess that it has something to do with either the USB driver or an interaction with writing to the filesystem and USB.
Hello Dave
I believe that you are the actual author of rshell. Thank you for taking the time to attempt to answer my question. I am honoured. To give a bit more information I connected the Pi Pico board to my Raspberry Pi 4 machine and repeated the exercise with the same result. i.e. using rshell cp command can copy from Pi Pico board to Raspberry Pi 4 but cannot copy from Raspberry Pi 4 to Pi Pico board. Using Thonny version 3.3.3 copying works both ways on both Windows 10 PC and Raspberry Pi 4. I would prefer to use rshell so hopefully a solution can be found.
Regards Frank
I am keen for rshell to work

fmentiplay
Posts: 7
Joined: Fri Feb 14, 2020 12:10 am

Re: rshell cp command not working on Raspberry Pi Pico with MicroPython installed

Post by fmentiplay » Fri Jan 29, 2021 10:00 am

Roberthh wrote:
Fri Jan 29, 2021 6:59 am
mpr works fine. Maybe you could compare it with what rshell implements.

Hello Robert
Thank you for offering your thoughts. Excuse my ignorance but is MPR similar to rshell?
I tried to find it on the net without success. Could you please give me a bit of info about mpr?
Much appreciated
Regards Frank

User avatar
sebi
Posts: 48
Joined: Tue Mar 29, 2016 9:36 pm
Location: France

Re: rshell cp command not working on Raspberry Pi Pico with MicroPython installed

Post by sebi » Fri Jan 29, 2021 10:03 am

Robert will tell you more, but mpr is a tool that has not been merged yet to the main branch: https://github.com/micropython/micropython/pull/6375
From what I have understood, it works the other way round than classical tools such as rshell: allowing you to mount your raspberry Pi 4 project directory onto the raspberry Pi pico.

User avatar
Roberthh
Posts: 3667
Joined: Sat May 09, 2015 4:13 pm
Location: Rhineland, Europe

Re: rshell cp command not working on Raspberry Pi Pico with MicroPython installed

Post by Roberthh » Fri Jan 29, 2021 10:25 am

You're right. It is not in the master branch yet, which is a pity, because is works so well. But it follows pyboard.py, which also works well for copying data in and out, connecting to repl and running scripts. Only mpr is a little bit easier to use (fewer keystrokes).
edit: About pyboard.py, see http://docs.micropython.org/en/latest/r ... rd.py.html

User avatar
dhylands
Posts: 3821
Joined: Mon Jan 06, 2014 6:08 pm
Location: Peachland, BC, Canada
Contact:

Re: rshell cp command not working on Raspberry Pi Pico with MicroPython installed

Post by dhylands » Fri Jan 29, 2021 7:02 pm

When I comment out all of the file operations then copying files from the host to the pico then rshell doesn't hang.

So this tells me that the problem is most likely related to the filesystem, or an interaction between the filesystem and USB.

User avatar
dhylands
Posts: 3821
Joined: Mon Jan 06, 2014 6:08 pm
Location: Peachland, BC, Canada
Contact:

Re: rshell cp command not working on Raspberry Pi Pico with MicroPython installed

Post by dhylands » Sat Jan 30, 2021 1:01 am

I have a version of rshell that works for me (at least better than the released version). It can be found on the pico branch of https://github.com/dhylands/rshell

If you checkout the git repository you can use the ./r.py script to run rshell from your local github tree. The changes I made are here:
https://github.com/dhylands/rshell/comm ... 5243f50589

and there is also a change here to auto recognize the Pico for connecting:
https://github.com/dhylands/rshell/comm ... b22b25d4d3

and I've filed an issue in micropython repo:
https://github.com/micropython/micropython/issues/6816

Post Reply