platform-espressif8266 icon indicating copy to clipboard operation
platform-espressif8266 copied to clipboard

Upload Filesystem Image OTA (uploadfsota) fails to provide -s flag to espota

Open cregganna opened this issue 4 years ago • 3 comments

Hi,

I have found an issue when uploading Filesystems via OTA. The "-s" flag is not supplied to the espota call and thus the OTA fails.

The issue is at: https://github.com/platformio/platform-espressif8266/blob/bb547cee8e61815ee33b9ea0b6c03449196dc269/builder/main.py#L311

When running OTA FS updates the Target is "uploadfsota" not "uploadfs".

With the original code I see (Note spiffs is reported as False)

Uploading .pio/build/esp12f_upload_ota/littlefs.bin
21:45:16 [DEBUG]: Options: {'esp_ip': '192.168.101.39', 'host_ip': '0.0.0.0', 'esp_port': 8266, 'host_port': 52607, 'auth': 'XXXXXXXX', 'image': '.pio/build/esp12f_upload_ota/littlefs.bin', 'spiffs': False, 'debug': True, 'progress': True}
21:45:16 [INFO]: Starting on 0.0.0.0:52607
21:45:16 [INFO]: Upload size: 1024000
21:45:16 [INFO]: Sending invitation to: 192.168.101.39
Authenticating...OK
21:45:17 [INFO]: Waiting for device...

Uploading: [                                                            ] 0% 
....
Uploading: [============================================================] 100% Done...

21:45:32 [INFO]: Waiting for result...

21:45:32 [ERROR]: ERROR[10]: 
*** [uploadfsota] Error 1

With the code modified to:

if "uploadfsota" in COMMAND_LINE_TARGETS:

I see (Note spiffs is reported as True)

Uploading .pio/build/esp12f_upload_ota/littlefs.bin
21:48:48 [DEBUG]: Options: {'esp_ip': '192.168.101.39', 'host_ip': '0.0.0.0', 'esp_port': 8266, 'host_port': 20550, 'auth': 'XXXXXXXX', 'image': '.pio/build/esp12f_upload_ota/littlefs.bin', 'spiffs': True, 'debug': True, 'progress': True}
21:48:48 [INFO]: Starting on 0.0.0.0:20550
21:48:48 [INFO]: Upload size: 1024000
21:48:48 [INFO]: Sending invitation to: 192.168.101.39
Authenticating...OK
21:48:49 [INFO]: Waiting for device...

Uploading: [                                                            ] 0% 
...
Uploading: [============================================================] 100% Done...

21:49:04 [INFO]: Waiting for result...
21:49:05 [INFO]: Result: OK

And the new FS is now loaded on the device.

With the change the non-OTA FS updates are still functional.

cregganna avatar Nov 23 '21 21:11 cregganna

I can confirm this. Tried to upload a program which uses littlefs via ota. Got the same response Uploading: [============================================================] 100% Done...

22:36:48 [ERROR]: ERROR[10]: *** [uploadfsota] Error 1

After changing main.py like mentioned above the error was gone.

becks0815 avatar Jan 31 '22 21:01 becks0815

Agreed,

https://github.com/platformio/platform-espressif8266/blob/bb547cee8e61815ee33b9ea0b6c03449196dc269/builder/main.py#L311

Changed to: if "uploadfsota" in COMMAND_LINE_TARGETS:

Fixes the "Upload Filesystem Image OTA" issue.

theplen avatar Mar 28 '22 21:03 theplen

Working also for me. How can this change be integrated in latest ESP8266 pio files?

Thanks for showing this up

crazyduck avatar Jun 13 '22 19:06 crazyduck

Also worked for me. Thanks. 👍 Any idea when this change will be made official? or at least some other that address this issue.

kmomberg avatar Mar 28 '23 16:03 kmomberg

This fixed it for me too. Not sure why this is not being adopted into the code, it is pretty clear.

Helix70 avatar May 29 '23 08:05 Helix70

Super merci beaucoup cela fonctionne parfaitement de mon coté

lycheejp avatar Aug 05 '23 05:08 lycheejp

This solved my problem, thanks

itldg avatar Oct 31 '23 00:10 itldg