Another try with OTA going via http server
- UART flash FW1 with full chip erase
$ mos flash 464fw.zip --esp-erase-chip
- Reset chip
- connect to wifi sta
$ mos --port ws://$ap_ip/rpc wifi $ssid $pass
- license the module
$ mos --port ws://$sta:ip/rpc license
- call FS.Mkfs 2x
$ mos --port ws://$sta_ip/rpc call FS.Mkfs '{"dev_type": "sysflash", "fs_type": "SPIFFS", "fs_opts": "{\"addr\": 3407872, \"size\": 524288"}'
mg_rpc.c:293 FS.Mkfs via WS_in 192.168.0.7:56019
mgos_vfs.c:109 Create SPIFFS (dev 0x3fff619c, opts {"addr": 3407872, "size": 524288)
mgos_vfs_fs_spiffs.:156 addr 0x340000 size 524288 bs 4096 ps 256 es 4096 nfd 10 encr 0 => -10025
mgos_http_server.c:180 0x3fff5fec HTTP connection from 192.168.0.7:56050
mg_rpc.c:293 FS.Mkfs via WS_in 192.168.0.7:56050
mgos_vfs.c:109 Create SPIFFS (dev 0x3fff619c, opts {"addr": 3407872, "size": 524288)
mgos_vfs_fs_spiffs.:172 There is a valid FS already, reformatting
- call OTA update
$ `mos --port ws://$sta_ip/rpc call OTA.update â{âurlâ:âhttp://some_server.com/âŠ/500fw.zipâ}â
mgos_http_server.c:180 0x3fff5fec HTTP connection from 192.168.0.7:56115
mg_rpc.c:293 OTA.Update via WS_in 192.168.0.7:56115
mgos_ota_http_clien:270 Update URL: http://some_server.com/.../500fw.zip
mgos_ota_core.c:253 Starting, timeout 600, commit timeout 0, mem 32544
mgos_ota_core.c:489 FW: chi_smart esp8266 5.00 20200902-135819/v4.62-13-ge84ffbc-master-dirty
esp_ota_backend.c:152 Slot 1, FW: chi_smart.bin -> 0x200000, FS fs.bin -> 0x48000
mgos_ota_core.c:506 0.16% total, chi.bin 512 of 524288
mgos_ota_core.c:506 9.35% total, chi.bin 136704 of 524288
mgos_ota_core.c:506 19.21% total, chi.bin 282624 of 524288
mgos_ota_core.c:506 29.09% total, chi.bin 429056 of 524288
esp_ota_backend.c:245 Start writing chi_smart.bin (689648) @ 0x200000
mgos_ota_core.c:506 35.56% total, chi_smart.bin 512 of 689648
mgos_ota_core.c:506 42.79% total, chi_smart.bin 107520 of 689648
mgos_ota_core.c:506 49.84% total, chi_smart.bin 211968 of 689648
mgos_ota_core.c:506 57.48% total, chi_smart.bin 325120 of 689648
mgos_ota_core.c:506 64.39% total, chi_smart.bin 427520 of 689648
mgos_ota_core.c:506 71.27% total, chi_smart.bin 529408 of 689648
mgos_ota_core.c:506 78.77% total, chi_smart.bin 640512 of 689648
esp_ota_backend.c:282 Write finished, checksum ok
mgos_ota_core.c:506 82.11% total, esp_init_data_default_v08.bin 128 of 128
esp_ota_backend.c:245 Start writing fs.bin (262144) @ 0x48000
mgos_ota_core.c:506 82.14% total, fs.bin 512 of 262144
mgos_ota_core.c:506 89.47% total, fs.bin 109056 of 262144
mgos_ota_core.c:506 96.73% total, fs.bin 216576 of 262144
esp_ota_backend.c:282 Write finished, checksum ok
mgos_ota_core.c:506 99.85% total, rboot.bin 512 of 2320
mgos_ota_core.c:629 Reached the end of archive
esp_ota_backend.c:330 New rboot config: prev_rom: 0, current_rom: 1 current_rom addr: 0x200000, current_rom size: 689648, current_fs addr: 0x48000, current_fs size: 262144
mgos_ota_core.c:811 Update finished, result 1 (Update applied, rebooting)
mgos_ota_core.c:852 Update requires reboot
mgos_utils.c:38 Rebooting in 500 ms
mgos_vfs.c:1026 Unmounting filesystems
state: 5 -> 0 (0)
rm 0
bcn 0
del if1
del if0
usl
mode : null
mgos_system.c:42 Restarting
ets Jan 8 2013,rst cause:2, boot mode:(3,7)
load 0x40100000, len 1540, room 16
tail 4
chksum 0x82
load 0x3ffe8000, len 748, room 4
tail 8
chksum 0x65
csum 0x65
rBoot v1.2.1-cesanta1 - richardaburton@gmail.com
Flash Size: 32 Mbit
Flash Mode: DIO
Flash Speed: 80 MHz
rBoot Option: Big flash
First boot, attempt 0
Boot is unconfirmed
Booting rom 1 (0x200000).
Ășbl`.rĂn.lphĂ„â.Ă.ĂnĂĂrĂĂn|Ă.l.lll`..bĂ...Ă»|.rĂ.lĂșnâĄ.Ănâ..l`.Ă„ârĂlĂ„l.Ă„...Ë[ĂŁĂŻĂ
: softAP(82:7d:3a
esp_main.c:178 chi_smart 5.00 (20200902-135819/v4.62-13-ge84ffbc-master-dirty)
esp_main.c:180 Mongoose OS 2.18.0 (20200902-135819/2.18.0-g24c520d)
esp_main.c:181 CPU: ESP8266EX, 160 MHz, RAM: 51768 total, 48660 free
esp_main.c:185 SDK 2.2.2-dev(a58da79); flash: 4M
esp_exc.c:211 Reset cause: 4 (soft reset)
mg_lwip_ev_mgr.c:75 Mongoose 6.18, LwIP 2.1.2
mg_ssl_if_mbedtls.c:56 mbed TLS 2.16.6-cesanta1
mgos_vfs_dev.c:72 sfl0: sysflash (), size 4194304
mgos_vfs_dev.c:72 root: part ({"dev": "sfl0", "offset": 294912, "size": 262144}), size 262144
mgos_vfs.c:173 /: SPIFFS @ root, opts {"bs":4096,"ps":256,"es":4096}
mgos_vfs.c:344 /: size 233681, used: 33885, free: 199796
esp_ota_backend.c:480 Mounting old FS: 262144 @ 0x8000
mgos_vfs_dev.c:72 oldroot: part ({"dev": "sfl0", "offset": 32768, "size": 262144}), size 262144
mgos_vfs.c:173 /old: SPIFFS @ oldroot, opts {bs:4096,ps:256,es:4096}
mgos_vfs.c:344 /old: size 233681, used: 34889, free: 198792
mgos_file_utils.c:36 Copying /old/conf9.json -> //conf9.json
mgos_file_utils.c:36 Copying /old/conf1.json -> //conf1.json
mgos_sys_config.c:232 Loading conf1.json
mgos_sys_config.c:232 Loading conf9.json
mgos_sys_config.c:366 MAC: 82:7d:3a:3d:bf:1f
mgos_sys_config.c:374 WDT: 30 seconds
mgos_core.c:104 Setting TZ to 'AR3'
esp_main.c:158 SDK: bcn 0
esp_main.c:158 SDK: del if1
esp_main.c:158 SDK: usl
esp_main.c:158 SDK: mode : null
mgos_wifi.c:88 WiFi STA: Using config 0 (ssid)
mgos_wifi.c:464 WiFi mode: AP+STA
esp_wifi.c:118 WiFi mode: AP
esp_main.c:158 SDK: mode : softAP(82:7d:3a:3d:bf:1f)
esp_main.c:158 SDK: add if1
esp_main.c:158 SDK: dhcp server start:(ip:192.168.4.1,mask:255.255.255.0,gw
esp_main.c:158 SDK: :192.168.4.1)
esp_main.c:158 SDK: bcn 100
esp_wifi.c:317 WiFi AP: SSID CHI_3DBF1F, channel 6
esp_main.c:158 SDK: bcn 0
esp_main.c:158 SDK: del if1
esp_main.c:158 SDK: usl
esp_main.c:158 SDK: add if1
esp_main.c:158 SDK: dhcp server start:(ip:192.168.4.1,mask:255.255.255.0,gw
esp_main.c:158 SDK: :192.168.4.1)
esp_main.c:158 SDK: bcn 100
esp_wifi.c:363 WiFi AP IP: 10.10.10.1/255.255.255.0 gw 10.10.10.1, DHCP range 10.10.10.2 - 10.10.10.11
esp_wifi.c:118 WiFi mode: AP+STA
esp_main.c:158 SDK: mode : sta(80:7d:3a:3d:bf:1f) + softAP(82:7d:3a:3d:bf:1
esp_main.c:158 SDK: f)
esp_main.c:158 SDK: add if0
mgos_wifi.c:270 WiFi STA: Connecting to ssid
mgos_vfs_dev.c:72 data: part ({"dev": "sfl0", "offset": 0x340000, "size": 0x80000}), size 524288
mgos_vfs.c:173 /chi: SPIFFS @ data, opts {"bs": 4096, "ps": 128, "es": 4096}
mgos_vfs_fs_spiffs.:151 addr 0x0 size 524288 bs 4096 ps 128 es 4096 nfd 10 encr 0 => -10025
mgos_vfs_fs_spiffs.:204 SPIFFS mount failed
mgos_vfs.c:182 FS SPIFFS {"bs": 4096, "ps": 128, "es": 4096}: mount failed
mgos_deps_init.c:138 fstab init failed
esp_main.c:192 MG init error: -32
esp_ota_backend.c:609 Update failed, reverting to ROM 0
esp_ota_backend.c:590 cur 0 prev 0 fwu 0
mgos_vfs.c:1026 Unmounting filesystems
esp_main.c:158 SDK: bcn 0
esp_main.c:158 SDK: del if1
esp_main.c:158 SDK: scandone
esp_main.c:158 SDK: del if0
esp_main.c:158 SDK: usl
esp_main.c:158 SDK: mode : null
mgos_system.c:42 Restarting
ets Jan 8 2013,rst cause:2, boot mode:(3,7)
load 0x40100000, len 1540, room 16
after OTA update, the new fw report SPIFFS mount failed, fstab init failed.
and revert to the old fw and reset continuously with the same SPIFFS mount failed, fstab init failed.