MicroPython on ESP32 with SPIRAM support
Re: MicroPython on ESP32 with SPIRAM support
Does os.listdir('/') show the sd directory? If not, rshell won't see it.
- pythoncoder
- Posts: 5956
- Joined: Fri Jul 18, 2014 8:01 am
- Location: UK
- Contact:
Re: MicroPython on ESP32 with SPIRAM support
Isn't there a need to mount the drive before rshell starts? I'd try mounting the drive in main.py.
Peter Hinch
Index to my micropython libraries.
Index to my micropython libraries.
-
- Posts: 847
- Joined: Mon Nov 20, 2017 10:18 am
Re: MicroPython on ESP32 with SPIRAM support
I haven't used the SD card with Rshell but did use the SD card in 4 pin mode with FPT transfer not a problem.
os.list() will list the the contents of the SD directory when it is my active directory.
If your using loboris firmware then rshell is a bit obsolete as this firmware allows telent and FTP.
You can get a repl terminal over a telent session on putty and can transfer/edit files over ftp much faster then over serial.
os.list() will list the the contents of the SD directory when it is my active directory.
If your using loboris firmware then rshell is a bit obsolete as this firmware allows telent and FTP.
You can get a repl terminal over a telent session on putty and can transfer/edit files over ftp much faster then over serial.
Re: rshell and sd card
Thanks for the responses. It seems very odd although I am sure it's something absolutely obvious that I am missing. I am mounting the sd card in boot.py although I've tried main.py as well. I have run rshell in debug mode and when it does remote_eval of os.listdir("/") all that returns is /flash whereas os.listdir("/") done directly from the micropython repl shows both /flash and /sd. I am not sure how that can happen since rshell's remote_eval is just running os.listdir("/") in raw repl I assume but that's what I am finding.
Here's an rshell session where rshell doesn't see /sd but when I enter repl from rshell, there it is ...
Here's an rshell session where rshell doesn't see /sd but when I enter repl from rshell, there it is ...
Code: Select all
(rshell) slzatz@slz-t470s:~/rshell$ rshell -p /dev/ttyUSB0
Connecting to /dev/ttyUSB0 ...
Welcome to rshell. Use Control-D to exit.
/home/slzatz/rshell> ls /flash
boot.py iot_esp32_tft.py settings.py
config.py main.py test
/home/slzatz/rshell> ls /sd
Cannot access '/sd': No such file or directory
/home/slzatz/rshell> repl
Entering REPL. Use Control-X to exit.
>
MicroPython ESP32_LoBo_v3.1.3 - 2017-01-13 on ESP32 board with ESP32
Type "help()" for more information.
>>>
>>> uos.listdir("/")
['flash', 'sd']
>>>
Re: MicroPython on ESP32 with SPIRAM support
What does rshell’s boards command return?
Bernhard Boser
Re: MicroPython on ESP32 with SPIRAM support
That does not work for me either. The problem is more, that the mounting state is not properly cleared on a soft reset (Ctrl-D). If you add the mount statement in your main.py and perform a hard reset, the device is mounted. If you the do a soft reset, the sd is in a zombie mode. It cannot be mounted (message: device is already mounted), and it cannot be unmounted. Similar the pycom port.
I do not know how rshell internally works, whether it issues a soft reset and how it performs the repl, but opening the latter definitely does not cause main.py to be run.
I do not know how rshell internally works, whether it issues a soft reset and how it performs the repl, but opening the latter definitely does not cause main.py to be run.
Re: MicroPython on ESP32 with SPIRAM support
Each command that rshell executes on the device essentially goes through pyboard.py which does a soft-reset of the device and goes into raw-repl mode. Something like doing an ls command requires a bunch of commands to be executed.
I think that main.py isn't executed when doing that (at least that's how it works on the pyboard).
rshell does an initial query to determine the "roots" (/flash and /sd) and this is probably insufficient to deal with dynamically mounted devices.
I think that main.py isn't executed when doing that (at least that's how it works on the pyboard).
rshell does an initial query to determine the "roots" (/flash and /sd) and this is probably insufficient to deal with dynamically mounted devices.
Re: rshell and sd card
If I mount the sd in boot.py and do a hard reset, I can make some progress. Rshell does know that /sd exists but can't access it when issuing an ls command but can cd into the directory -- it just can't do anything once there. Here is the rshell output:
As was suggested, it may be time to telnet (or ssh - I think the @loboris port supports that too) into the board -- I haven't tried that yet.
Code: Select all
(rshell) slzatz@slz-t470s:~/rshell$ rshell -p /dev/ttyUSB0
Connecting to /dev/ttyUSB0 ...
Welcome to rshell. Use Control-D to exit.
/home/slzatz/rshell> boards
pyboard @ /dev/ttyUSB0 connected Dirs: /flash /sd /pyboard/flash /pyboard/sd
/home/slzatz/rshell> ls /sd
Cannot access '/sd': No such file or directory
/home/slzatz/rshell> cd /sd
/sd> ls
Cannot access '/sd': No such file or directory
/sd> ls /flash
boot.py iot_esp32_tft.py settings.py
config.py main.py test
Re: MicroPython on ESP32 with SPIRAM support
I'm not using rshell, but I'll try to fix this issue in a next couple of days.
Re: MicroPython on ESP32 with SPIRAM support
There was a bug in unmounting/mounting sdcard on soft reset. It is fixed now and update commited to the repository.
To acces the sdcard from rshell put in boot.py:
At the moment, main.py is not executed when the raw repl is requested on soft reset (which is the case with rshell).
SDCard can now be accessed from rshell without problem.
To acces the sdcard from rshell put in boot.py:
Code: Select all
import uos
uos.mountsd()
SDCard can now be accessed from rshell without problem.