Wrong Magic Byte error when trying to upload spiffs.bin
GeorgeFlorian opened this issue · 1 comments
GeorgeFlorian commented
OS: Linux Mint 19.1
Board: ESP32-EVB
IDE: Platformio IDE on VSCode
Hello !
I found this while trying to implement Firmware Update via file upload in my project.
It works if I upload firmware.bin
.
But when I'm trying to upload spiffs.bin
it returns A LOT of Wrong Magic Byte
lines.
I get spiffs.bin
from pio run -t buildfs
.
[env:esp32-evb]
platform = https://github.com/platformio/platform-espressif32.git
board = esp32-evb
framework = arduino
board_build.flash_mode = qio
board_build.f_flash = 80000000L
upload_port = /dev/ttyUSB0
monitor_port = /dev/ttyUSB0
monitor_speed = 115200
upload_speed = 115200
build_flags = -DCORE_DEBUG_LEVEL=5
#extra_scripts = post:scripts/pio_copy.py
#libraries
lib_deps = https://github.com/me-no-dev/ESPAsyncWebServer.git
https://github.com/me-no-dev/AsyncTCP.git
Any ideas ?
GeorgeFlorian commented
The fix was, as you said, to add >= to indexOf
:
int cmd = (filename.indexOf("spiffs") >= 0) ? U_SPIFFS : U_FLASH;