I'm trying to troubleshoot using ampy with my Adafruit huzza and Adalogger w/sdcard. I won't go into great detail here, but the sdcard is now unmounted when I run any ampy commands, so actions are performed on the esp8266 flash filesystem only. ampy worked fine with the sdcard for about a week.
I've provided greater detail here and on the Adafruit user forum: https://github.com/adafruit/ampy/issues/10
In trying to debug the ampy issue, I'd like enter raw REPL (CNTL-A) and perform the equivalent of os.listdir() to see if the mounted sdcard is visible. Any suggestions on how to do this (or other troubleshooting) would be appreciated.
Thanks,
J
[SOLVED] How to perform equiv of os.listdir() in raw REPL?
[SOLVED] How to perform equiv of os.listdir() in raw REPL?
Last edited by jpj on Mon Dec 26, 2016 6:39 pm, edited 2 times in total.
Re: How to perform equiv of os.listdir() in raw REPL?
You should just be able to type the commands. You won't see them echoed back, and they won't be executed until you enter Control-D. On my pyboard if I type:
Finally, press Control-B to exit raw REPL mode.
- Control-A
import os
print(os.listdir('/'))
Control-D
Code: Select all
MicroPython v1.8.4-151-g5f3b9aa-dirty on 2016-10-11; PYBv1.0 with STM32F405RG
Type "help()" for more information.
>>>
raw REPL; CTRL-B to exit
>OK['flash']
>
Re: How to perform equiv of os.listdir() in raw REPL?
Thanks Dave. Yes that worked:
Entering raw REPL is not bothering the sdcard mount, so it must be something else ampy is doing.
Code: Select all
>>> os.listdir()
['logtest.py', 'log', 'blink.py', 'blinkred.py', 'hello.py', 'ht16k33_matrix.py', 'test', 'mymodules', 'mytime', 'main.py', 'getrtctime.py', 'empty.py', 'setRtcFromNtp.py', '.Spotlight-V100', 'readfile.py', '.fseventsd', 'font5x8.bin', 'webrepl_cfg.py', 'ht16k33_seg.py', 'bitmapfont.mpy']
>>>
raw REPL; CTRL-B to exit
>OK['logtest.py', 'log', 'blink.py', 'blinkred.py', 'hello.py', 'ht16k33_matrix.py', 'test', 'mymodules', 'mytime', 'main.py', 'getrtctime.py', 'empty.py', 'setRtcFromNtp.py', '.Spotlight-V100', 'readfile.py', '.fseventsd', 'font5x8.bin', 'webrepl_cfg.py', 'ht16k33_seg.py', 'bitmapfont.mpy']
>
Re: [RESOLVED] How to perform equiv of os.listdir() in raw REPL?
ampy is working with the sdcard again. I'm not certain what the fix was. I created some git branches of earlier micropython releases and installed them on the huzzah. The ampy issue remained, so I reloaded my version 1.8.6 with the frozen sdcard.py and ampy started working with the sdcard.
Thanks to Dave Hylands for helping me with his rshell program. Works well and I now have a backup method for managing files on the esp8266.
https://github.com/dhylands/rshell
Thanks to Dave Hylands for helping me with his rshell program. Works well and I now have a backup method for managing files on the esp8266.
https://github.com/dhylands/rshell