rshell issue

The official pyboard running MicroPython.
This is the reference design and main target board for MicroPython.
You can buy one at the store.
Target audience: Users with a pyboard.
Post Reply
smhodge
Posts: 86
Joined: Tue Jan 22, 2019 2:16 am
Location: Kirkland, WA, USA

rshell issue

Post by smhodge » Thu Sep 03, 2020 2:05 am

I have a pyboard that the SD part of it is toast, I think. Not the card itself but probably the driver or reader or something. At any rate I decided to check it out again so I did a full (not quick) format of a 16GB card and a mass erase/firmware re-install (v1.12 on a v1.1 pyboard) and then opened an rshell connection to it. The attached file is a screen capture of what I got after I did an "ls" on both /sd and /flash.

It only lists /flash as a root directory. That agrees with /sd being toast.

The files on /flash are also what you would expect for a board that just had the firmware re-installed, but /sd (despite not being listed as a root directory) lists a file that rshell had found (correctly) on another, pyboard on which /sd works just fine, a board that I had been using rshell with just prior to doing these tests. Somehow rshell displayed this old file that has absolutely nothing to do with the board I was now using it with. I know it is not that other board (with the real /sd/cos.log file on it) because of the COM port number.

I've suspected this for a while but this is the first time it is so obvious: sometimes rshell displays files that don't really exist on the target.

Any ideas what is going on?
Attachments
rshell.jpg
rshell.jpg (36.6 KiB) Viewed 2348 times

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

Re: rshell issue

Post by dhylands » Thu Sep 03, 2020 3:08 am

Try using the boards command. It will show your board and the directories that were detected on the board.

If /sd isn't listed, then the /sd is from your host computer and not from the pyboard.

smhodge
Posts: 86
Joined: Tue Jan 22, 2019 2:16 am
Location: Kirkland, WA, USA

Re: rshell issue

Post by smhodge » Thu Sep 03, 2020 3:12 pm

Thanks, sure enough it was there, /sd/cos.log on the current Windows drive. I guess I got caught by some sort of under-the-hood way rhell works. I thought "/" as in "/sd" would be the root of the pyboard. It looks like its actually "/" = "/pyboard"; is that correct? Why don't I see "/pyboard" listed when I do just "ls /"?

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

Re: rshell issue

Post by dhylands » Thu Sep 03, 2020 4:24 pm

ls / is showing you the root filesystem of your host.
ls /pyboard is showing you the root filesystem of the pyboard (which is just other virtual directories - you can't store files here).

rshell creates a "virtual" directory for each board that's connected. By default, the first one will have a name of pyboard (you can override this by putting a board.py file on your pyboard). /flash and /sd are created for the first pyboard (if they exist on the device).

If you refer to one of the directories listed in the boards command, then you'll be using files on the device. Otherwise you're using files on the host.

smhodge
Posts: 86
Joined: Tue Jan 22, 2019 2:16 am
Location: Kirkland, WA, USA

Re: rshell issue

Post by smhodge » Thu Sep 03, 2020 4:42 pm

Got it, thanks.

Post Reply