wendlers / mpfshell

A simple shell based file explorer for ESP8266 Micropython based devices ⛺
MIT License
398 stars 85 forks source link

Fix crash bugs when used with MicroPython 1.8.7 #27

Closed xantoz closed 7 years ago

xantoz commented 7 years ago

The filesystem layout has changed with MicroPython 1.8.7. os.listdir('/') will now list all filesystems as directory mounts, os.listdir('//') generates an error, so we need to be more careful about what we send to it. Trying to read or create directories or files in '/' will generate 'ENODEV' or sometimes 'EINVAL' so we need to handle these error conditions as well. Also start out the user on '/flash' on connection, as this is where you should, and can, put your files; which should give the same behavior as before. Cherry-picked the commit by mhoffma which instead asks the board for the current directory.