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.
rpr
Posts: 99
Joined: Sat Oct 27, 2018 5:17 pm

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

Post by rpr » Sat Jan 30, 2021 3:33 am

dhylands wrote:
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
It works great. Thanks very much.

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 » Sat Jan 30, 2021 12:42 pm

dhylands wrote:
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
Thank you Dave for your advice. I downloaded rshell from the pico branch from your Github site. I found where the rshell package lives on my Windows 10 PC and I replaced the original rshell folder with your new updated rshell. I repeated the exercise of trying to copy a reasonable sized micropython file (5KB) from my Windows 10 PC to the Raspberry Pi Pico dev board and it worked!!!
Thank you for all your help.
Regards Frank

JumpZero
Posts: 54
Joined: Mon Oct 30, 2017 5:54 am
Location: Arcachon - France

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

Post by JumpZero » Sun Jan 31, 2021 5:48 pm

dhylands wrote:
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
+1
rshell works with the pico
Thank you very much

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 » Wed Feb 03, 2021 10:16 am

+1
I was able to use rshell on Windows with the Pico using the same trick than @fmentiplay to make that change permanent.
I am looking forward to seeing someone figure out if it is a problem with flow control thus allowing rshell to work with the Pico without the current tweak.

I also tried to use mpr on Windows but without success. Maybe @Roberthh knows if mpr works on Windows as he contributed to its code with some improvements related to Windows?

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 » Wed Feb 03, 2021 10:29 am

As far as I recall I did not do anything special. It just worked. I can try again later today day. I use Windows only rarely, just for comparison. Most of the time I'm on Linux.

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 » Wed Feb 03, 2021 10:33 am

Ohh thanks that would be nice.
Most of the time I use wsl but as recently I switched to wsl 2, I just figured out that it doesn't support serial coms yet.
I might switch back to wsl 1 if I cannot make mpr work on Windows.

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 » Wed Feb 03, 2021 1:55 pm

I just tested it with Window 10 and it just works. I can open repl, I can copy files in and out. Example

python mpr.py connect COM6 repl # open repl. You may have to push Ctrl-B to get it
python mpr.py connect COM6 ls # list files
python mpr.py connect COM6 cp sample.py :sample.py # copy file to the device
python mpr.py connect COM6 cp :sample.py sample.py # copy file from the device
python mpr.py connect COM6 mount . # mount the local directory of the PC under /remote on the board and enter repl.

Here the device is attached to COM6. The device name is case sensitive, and you have to specify the right one. There are shortcuts in mpr.py for device names. So you can make your life easier.
Once in repl, you can push Ctrl-D to make a warm start without affecting the connection.

On my windows 10 I have set the terminal window to support VT100 commands. See: https://stackoverflow.com/questions/516 ... t100-codes

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 » Wed Feb 03, 2021 11:21 pm

Thanks @Roberthh for all those explanations: it is the perfect little tutorial I was looking for!!
It works great indeed! Especially after setting the terminal window to support VT100 commands thanks to your link.

A problem I have with my french keyboard though is the impossibility to type `Ctrl-]` as `]` is obtained by pressing `Ctrl+Alt+)`, but this is not related to mpr.

oclyke
Posts: 18
Joined: Tue Mar 19, 2019 4:55 am

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

Post by oclyke » Thu Feb 04, 2021 5:38 am

hey everyone, Dave pointed me this way after discussing a related issue. using the 'pico' branch worked wonders for me but i also found the -a/--ascii option to be crucial. cheers!

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 » Thu Feb 04, 2021 6:41 am

A problem I have with my french keyboard though is the impossibility to type `Ctrl-]` as `]` is obtained by pressing `Ctrl+Alt+)`
I faced the same challenge and tried all possible Ctrl-Key combination on my German Keyboard, which uncovered teh combination 'Ctrl +' as sending Ctrl-]. If the location of the key matters, it may be Ctrl-$ on a french keyboard.

Post Reply