ESP8266-MicroPython install - No files #15810
-
I have installed MicroPython on an ESP8266-01 with 1 MiB of flash. I noticed there were no files on this configuration, and I couldn't install any. Then I saw that there is no FAT filesystem support for this device. Thus, it would seem that there is no way to actually use this device in a stand-alone situation with MicroPython since there is no main.py to run on power-up. Is this the case or am I missing some trick? |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 4 replies
-
Do you get a REPL prompt in whatever terminal program you are using? How did you load the firmware? |
Beta Was this translation helpful? Give feedback.
-
That sounds odd. Did you erase the flash on the device beforeflashing the new micropython firmware? If the flash was not erased first, micropython will not initialise the filesystem on first boot. See https://docs.micropython.org/en/latest/esp8266/tutorial/intro.html#deploying-the-firmware. |
Beta Was this translation helpful? Give feedback.
-
Did you flash the 1MB version of the firmware? It is at the bottom of the ESP8266 download page https://micropython.org/download/ESP8266_GENERIC/ |
Beta Was this translation helpful? Give feedback.
-
On the Python download page I noted the comment below after struggling with how to save a main.py. I used ESPTOOL to erase the flash and then flash the 1MB download. I was quite excited when I got a python prompt in my Thonny terminal. I could enter and execute python code manually. I could also run scripts I'm editing in Thonny. But there were no files shown in the Micropython device panel. And if I try to save to main.py on the device it gives me an error: OSError: Could not open file /main.py for writing, output. So, it would seem with no file system support it makes sense that there are no files. But I'm not sure what the point of the 1MB release is if I can't have it run a program on its own.
|
Beta Was this translation helpful? Give feedback.
I just checked with a 1M ESP8266. There is a small LFS2 file system. You should be able to verify with:
Here, it returns
(4096, 4096, 98, 93, 93, 0, 0, 0, 0, 255)
, telling that there are 98 blocks of 4k size available.You will not see the board's file system in the file manager of the PC. I can use Thonny to access the file system setting the interface properly to /dev/ttyUSB0. But I normally use mpremote as less intrusive tool. If you prefer to use a IDE, look at ViperIDE, which also has no unwanted side effects.