Upload to ESP8266 application + spifffs at the same time?

Is is possible to upload both application code and spiffs filesystem to the ESP8266 at the same time?

Currently this requires a two stage upload:

pio run -t upload
pio run -t uploadfs

Turning on -v output, I see esptool is running:

esptool -vv -cd nodemcu -cb 921600 -cp "/dev/ttyUSB0" -cf .pioenvs/emonesp_fast/firmware.bin
esptool -vv -cd nodemcu -cb 921600 -cp "/dev/ttyUSB0" -ca 0x300000 -cf .pioenvs/emonesp_fast/spiffs.bin

Could these two commands be combined? If this is not possible with Pio, is it possible using epstool to flash the two .bin’s?

Please correct me if I’m wrong but currently is it correct that pio does not have a way to mkspiffs to generate the spiffs.bin without running uploadfs target? I would like to build the spiffs package together with the application using Pio on TravisCI saving the .bins to github releases then upload later via OTA from the ESP.

Please check a docs. How about as for buildfs target? :slight_smile:

Oh dear, how did I miss that :blush: ! Thanks a lot

Actually, I know how I missed the buildfs command. It’s not listed anywhere on the espressif docs page: Espressif 8266 — PlatformIO v6.1 documentation

buildfs works locally but when I run it on travis I get the error Do not know how to make File target buildfs’` I get this error even if I ensure spiffs package is installed

$ platformio platform install espressif8266 --with-package tool-mkspiffs

What else needs to be installed for buildfs to work?

Please sorry, you are right. I added it but docs has not been released yet. Please use latest docs instead stable:

It looks that you have old dev platform on RPi. Try to pio upgrade & pio update on RPi.

Fixed! :tada: Issue was the TravisCI had cached an older version of framework-arduinoespressif8266.

Thanks a lot for your help :thumbsup:

firmware.bin and spiffs.bin are now auto-generated on git release by TravisCI and uploaded to github releases ready for OTA upload :smiley:

1 Like

It looks amazing!!! :blush:

The power of PlatformIO! :rocket:

1 Like

Uhm… I’m sorry, but I’m still missing it… How was this achieved?

I have targets = uploadfs in my platformio.ini, but it doesn’t do anything.

Thanks.

Could you try manually pio run -t uploadfs?

I have no problem uploading the FS. I just want to know how to get the IDE to do both uploadfs and upload in a single command/shortcut. I thought that was the subject of this thread.

But, I’ve since switched to a Makefile and running make uploadfs upload, which does exactly what I need.

I would also be interested to know if this is possible. I never managed to figure out how to upload application and spiffs at the same time using platformIO.

WAIT! You’re OP!

So you did NOT find a solution? :frowning:

One thing you could do is create a Makefile (see VIM integration for example), so you can run make uploadfs upload && pio device montor from any terminal (built-in IDE as well), to get the same result als the build/upload shortcut. That’s what I’m doing.

We have a related issue for that. Maybe, we will implement it in the current PIO Core 3.4 milestone. See

1 Like