emsesp / EMS-ESP32

ESP32 firmware to read and control EMS and Heatronic compatible equipment such as boilers, thermostats, solar modules, and heat pumps
https://emsesp.github.io/docs
GNU Lesser General Public License v3.0
631 stars 107 forks source link

BBQKees Gateway S32 crashes after update to EMS-ESP-3_7_0-dev_27-ESP32_16M or later #1909

Closed Andi252 closed 3 months ago

Andi252 commented 3 months ago

PROBLEM DESCRIPTION

BBQKees Gateway S32 crashes and does not restart after update to EMS-ESP-3_7_0-dev_27-ESP32_16M - EMS-ESP-3_7_0-dev_29-ESP32_16M

The version EMS-ESP-3_7_0-dev_26-ESP32 is the last which works.

REQUESTED INFORMATION

Make sure your have performed every step and checked the applicable boxes before submitting your issue. Thank you!

Last good version

{
  "System": {
    "version": "3.7.0-dev.26",
    "uptime": "000+00:01:44.224",
    "uptime (seconds)": 104,
    "platform": "ESP32",
    "arduino": "Tasmota Arduino v2.0.17",
    "sdk": "4.4.8.240628",
    "free mem": 180,
    "max alloc": 107,
    "free caps": 130,
    "used app": 1690,
    "free app": 870,
    "partition": "boot",
    "reset reason": "Software reset CPU / Software reset CPU"
  },
  "Network": {
    "TxPower setting": 0,
    "static ip config": false,
    "low bandwidth": false,
    "disable sleep": false,
    "enable MDNS": true,
    "enable CORS": false,
    "AP provision mode": "disconnected",
    "AP security": "wpa2",
    "AP ssid": "ems-esp"
  },
  "NTP": {
    "NTP status": "disconnected",
    "enabled": false,
    "server": "time.google.com",
    "tz label": "Europe/Amsterdam"
  },
  "MQTT": {
    "MQTT status": "disconnected",
    "enabled": false,
    "client id": "esp32-7d55b594",
    "keep alive": 60,
    "clean session": false,
    "entity format": 0,
    "base": "ems-esp",
    "discovery prefix": "homeassistant",
    "discovery type": 0,
    "nested format": 1,
    "ha enabled": false,
    "mqtt qos": 0,
    "mqtt retain": false,
    "publish time heartbeat": 60,
    "publish time boiler": 10,
    "publish time thermostat": 10,
    "publish time solar": 10,
    "publish time mixer": 10,
    "publish time water": 10,
    "publish time other": 60,
    "publish time sensor": 10,
    "publish single": false,
    "publish2command": false,
    "send response": false
  },
  "Syslog": {
    "enabled": false
  },
  "Sensor": {
    "temperature sensors": 0,
    "temperature sensor reads": 0,
    "temperature sensor fails": 0,
    "analog sensors": 0,
    "analog sensor reads": 0,
    "analog sensor fails": 0
  },
  "API": {
    "API calls": 1,
    "API fails": 0
  },
  "Bus": {
    "bus status": "disconnected",
    "bus protocol": "Buderus",
    "bus telegrams received (rx)": 0,
    "bus reads (tx)": 0,
    "bus writes (tx)": 0,
    "bus incomplete telegrams": 0,
    "bus reads failed": 0,
    "bus writes failed": 0,
    "bus rx line quality": 100,
    "bus tx line quality": 100
  },
  "Settings": {
    "board profile": "S32",
    "locale": "en",
    "tx mode": 1,
    "ems bus id": 11,
    "shower timer": false,
    "shower min duration": 180,
    "shower alert": false,
    "hide led": false,
    "notoken api": false,
    "readonly mode": false,
    "fahrenheit": false,
    "dallas parasite": false,
    "bool format": 1,
    "bool dashboard": 1,
    "enum format": 1,
    "analog enabled": true,
    "telnet enabled": true,
    "max web log buffer": 50,
    "web log buffer": 11
  }
}

TO REPRODUCE

update version via webinterface afterwards gateway will loose connection and not recover.

EXPECTED BEHAVIOUR

update via web interface restart gateway login to new version

SCREENSHOTS

tried to update via EMS-ESP-Flasher created the following output:

Auto-detected serial port: COM5
Using 'COM5' as serial port.
Connecting....
Detecting chip type... Unsupported detection protocol, switching and trying again...
Connecting.....
Detecting chip type... ESP32
Connecting....

Chip Info:
 - Chip Family: ESP32
 - Chip Model: ESP32-D0WD-V3 (revision 3)
 - Number of Cores: 2
 - Max CPU Frequency: 240MHz
 - Has Bluetooth: YES
 - Has Embedded Flash: NO
 - Has Factory-Calibrated ADC: YES
 - MAC Address: 94:B5:55:7D:99:78
Uploading stub...
Running stub...
Stub running...
Changing baud rate to 460800
Changed.
 - Flash Size: 16MB
 - Flash Mode: dio
 - Flash Frequency: 40MHz
Erasing flash (this may take a while)...
Chip erase completed successfully in 53.3s
Flash will be erased from 0x00001000 to 0x00005fff...
Flash will be erased from 0x00008000 to 0x00008fff...
Flash will be erased from 0x0000e000 to 0x0000ffff...
Flash will be erased from 0x00010000 to 0x00260fff...
Flash params set to 0x0240
Compressed 17408 bytes to 12093...
Writing at 0x00001000... (100 %)
Wrote 17408 bytes (12093 compressed) at 0x00001000 in 0.5 seconds (effective 258.1 kbit/s)...
Hash of data verified.
Compressed 3072 bytes to 165...
Writing at 0x00008000... (100 %)
Wrote 3072 bytes (165 compressed) at 0x00008000 in 0.1 seconds (effective 474.7 kbit/s)...
Hash of data verified.
Compressed 8192 bytes to 47...
Writing at 0x0000e000... (100 %)
Wrote 8192 bytes (47 compressed) at 0x0000e000 in 0.1 seconds (effective 653.7 kbit/s)...
Hash of data verified.
Compressed 2426656 bytes to 1519305...
Writing at 0x00010000... (1 %)
Writing at 0x0001bbac... (2 %)
.....
Writing at 0x00251933... (97 %)
Writing at 0x00256ca1... (98 %)
Writing at 0x0025c21b... (100 %)
Wrote 2426656 bytes (1519305 compressed) at 0x00010000 in 36.3 seconds (effective 534.7 kbit/s)...
Hash of data verified.

Leaving...
Hard Resetting...
Hard resetting via RTS pin...
Done! Flashing is complete!

Showing logs:
[20:28:11]E (662) psram: PSRAM ID read error: 0xffffffff
[20:28:11]
[20:28:11]┌───────────────────────────────────────┐
[20:28:11]│  EMS-ESP version 3.7.0-dev.29         │
[20:28:11]│                                       │
[20:28:11]│  help to show available commands      │
[20:28:11]│  su to access admin commands          │
[20:28:11]│                                       │
[20:28:11]│  https://github.com/emsesp/EMS-ESP32  │
[20:28:11]│                                       │
[20:28:11]└───────────────────────────────────────┘
[20:28:11]
[20:28:11]ems-esp:$ E (724) esp_littlefs: ./components/esp_littlefs/src/littlefs/lfs.c:1367:error: Corrupted dir pair at {0x0, 0x1}
[20:28:11]
[20:28:11]E (726) esp_littlefs: mount failed,  (-84)
[20:28:11]E (730) esp_littlefs: Failed to initialize LittleFS
[20:28:11][   203][E][vfs_api.cpp:105] open(): /littlefs/config does not exist, no permits for creation
[20:28:11][   296][E][vfs_api.cpp:105] open(): /littlefs/config/networkSettings.json does not exist, no permits for creation
[20:28:11][   308][E][vfs_api.cpp:105] open(): /littlefs/config does not exist, no permits for creation
[20:28:11][   382][E][vfs_api.cpp:105] open(): /littlefs/config/apSettings.json does not exist, no permits for creation
[20:28:11][   413][E][vfs_api.cpp:105] open(): /littlefs/config/ntpSettings.json does not exist, no permits for creation
[20:28:11][   446][E][vfs_api.cpp:105] open(): /littlefs/config/mqttSettings.json does not exist, no permits for creation
[20:28:11][   532][E][vfs_api.cpp:105] open(): /littlefs/config/securitySettings.json does not exist, no permits for creation
[20:28:11][   655][E][vfs_api.cpp:105] open(): /littlefs/tmp_upload does not exist, no permits for creation
[20:28:11][   668][E][vfs_api.cpp:105] open(): /littlefs/config/emsespSettings.json does not exist, no permits for creation
[20:28:11][   678][E][Preferences.cpp:483] getString(): nvs_get_str len fail: boot NOT_FOUND
[20:28:11][   769][E][vfs_api.cpp:105] open(): /littlefs/config/emsespCustomization.json does not exist, no permits for creation
[20:28:12][   809][E][vfs_api.cpp:105] open(): /littlefs/config/emsespScheduler.json does not exist, no permits for creation
[20:28:12][   851][E][vfs_api.cpp:105] open(): /littlefs/config/emsespEntity.json does not exist, no permits for creation
[20:28:12]E (2155) lan87xx: lan87xx_pwrctl(409): power up timeout
[20:28:12]E (2155) lan87xx: lan87xx_init(491): power control failed
[20:28:12]E (2155) esp_eth: esp_eth_driver_install(215): init phy failed
[20:28:12][  1540][E][ETH.cpp:324] begin(): esp_eth_driver_install failed
[20:28:12][  1566][E][vfs_api.cpp:105] open(): /littlefs/config/emsespModules.json does not exist, no permits for creation
[20:28:12][20:28:12]

ADDITIONAL CONTEXT

same output occures with dev28

Showing logs:
[21:30:04]E (661) psram: PSRAM ID read error: 0xffffffff
[21:30:04]
[21:30:04]┌───────────────────────────────────────┐
[21:30:04]│  EMS-ESP version 3.7.0-dev.28         │
[21:30:04]│                                       │
[21:30:04]│  help to show available commands      │
[21:30:04]│  su to access admin commands          │
[21:30:04]│                                       │
[21:30:04]│  https://github.com/emsesp/EMS-ESP32  │
[21:30:04]│                                       │
[21:30:04]└───────────────────────────────────────┘
[21:30:04]
[21:30:04]ems-esp:$ E (723) esp_littlefs: ./components/esp_littlefs/src/littlefs/lfs.c:1367:error: Corrupted dir pair at {0x0, 0x1}
[21:30:04]
[21:30:04]E (725) esp_littlefs: mount failed,  (-84)
[21:30:04]E (729) esp_littlefs: Failed to initialize LittleFS
[21:30:04][   196][E][vfs_api.cpp:105] open(): /littlefs/config does not exist, no permits for creation
[21:30:04]E (918) wifi_init_default: netstack cb reg failed with 12289
[21:30:04][   301][E][vfs_api.cpp:105] open(): /littlefs/config/networkSettings.json does not exist, no permits for creation
[21:30:04][   316][E][vfs_api.cpp:105] open(): /littlefs/config does not exist, no permits for creation
[21:30:05][   388][E][vfs_api.cpp:105] open(): /littlefs/config/apSettings.json does not exist, no permits for creation
[21:30:05][   419][E][vfs_api.cpp:105] open(): /littlefs/config/ntpSettings.json does not exist, no permits for creation
[21:30:05][   452][E][vfs_api.cpp:105] open(): /littlefs/config/mqttSettings.json does not exist, no permits for creation
[21:30:05][   536][E][vfs_api.cpp:105] open(): /littlefs/config/securitySettings.json does not exist, no permits for creation
[21:30:05][   658][E][vfs_api.cpp:105] open(): /littlefs/tmp_upload does not exist, no permits for creation
[21:30:05][   671][E][vfs_api.cpp:105] open(): /littlefs/config/emsespSettings.json does not exist, no permits for creation
[21:30:05][   682][E][Preferences.cpp:483] getString(): nvs_get_str len fail: boot NOT_FOUND
[21:30:05][   772][E][vfs_api.cpp:105] open(): /littlefs/config/emsespCustomization.json does not exist, no permits for creation
[21:30:05][   813][E][vfs_api.cpp:105] open(): /littlefs/config/emsespScheduler.json does not exist, no permits for creation
[21:30:05][   855][E][vfs_api.cpp:105] open(): /littlefs/config/emsespEntity.json does not exist, no permits for creation
[21:30:06]E (2167) lan87xx: lan87xx_pwrctl(409): power up timeout
[21:30:06]E (2167) lan87xx: lan87xx_init(491): power control failed
[21:30:06]E (2167) esp_eth: esp_eth_driver_install(215): init phy failed
[21:30:06][  1551][E][ETH.cpp:324] begin(): esp_eth_driver_install failed
[21:30:06][  1578][E][vfs_api.cpp:105] open(): /littlefs/config/emsespModules.json does not exist, no permits for creation
[21:30:06][21:30:06]
proddy commented 3 months ago

Thanks for reporting. That doesn't look good. We've upgraded to the latest Core espressif chip libraries, so that might have something to do with it. We'll try to reproduce and fix it.

The problem is that it can't find the file system, as its probably corrupted.

How did you flash it? Via the WebUI, the Flash tool or manually?

proddy commented 3 months ago

ahh, I see the problem. You uploaded the wrong firmware. The older S32 gateways are 4MB and you used the latest S3 which is 16MB. Take this build: https://github.com/emsesp/EMS-ESP32/releases/download/latest/EMS-ESP-3_7_0-dev_29-ESP32.bin

There was an old bug in the WebUI which downloaded the wrong firmware version. That has now been fixed.