mirror of
https://github.com/rstrouse/ESPSomfy-RTS.git
synced 2026-10-31 13:52:15 +01:00
feat: say when the firmware is flashed over USB
Builds with one app slot (C6, debug, and the C5 to come) have nowhere for /updateFirmware to write. It answered "Error updating firmware: " and rebooted. - ConfigSettings::otaSlot, from esp_ota_get_next_update_partition(). - The header sends otaSlot, default 1, so only those builds send it. - /updateFirmware refuses with 400 and a reason, and doesn't stop the radio or reboot. - The web UI's Update Firmware says to flash the onboard image over USB, with a backup first. Firmware before the field leaves it undefined, which keeps the uploader. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
6db449e878
commit
5721d34a34
10 changed files with 55 additions and 5 deletions
|
|
@ -4169,9 +4169,14 @@ class Firmware {
|
|||
div.style.display = '';
|
||||
}
|
||||
updateFirmware() {
|
||||
let chip = document.getElementById('divContainer').getAttribute('data-chipmodel') || '';
|
||||
// Firmware from before the field leaves it out: undefined, not false.
|
||||
if (proto.model.header.otaSlot === false) {
|
||||
ui.infoMessage(`This device has no OTA slot, so its firmware is flashed over USB with SomfyController.onboard.esp32${chip}.bin. That image holds the web UI and an empty configuration too, so take a backup first and restore it afterwards.`);
|
||||
return;
|
||||
}
|
||||
let div = this.createFileUploader('/updateFirmware');
|
||||
let inst = div.querySelector('div[id=divInstText]');
|
||||
let chip = document.getElementById('divContainer').getAttribute('data-chipmodel') || '';
|
||||
let html = `<div style="font-size:14px;margin-bottom:20px;">Select a binary file [SomfyController.ino.esp32${chip}.bin] containing the device firmware then press the Upload File button.</div>`;
|
||||
if (this.isMobile()) {
|
||||
html += `<div style="width:100%;color:red;text-align:center;font-weight:bold;"><span style="margin-top:7px;width:100%;background:yellow;padding:3px;display:inline-block;border-radius:5px;background:white;">WARNING<span></div>`;
|
||||
|
|
|
|||
|
|
@ -140,7 +140,7 @@ ProtoModel.ITEMS = [
|
|||
// have it.
|
||||
ProtoModel.FIELDS = {
|
||||
header: ['maxRooms', 'maxShades', 'maxGroups', 'maxGroupedShades', 'maxLinkedRemotes', 'startingAddress', 'bitLength',
|
||||
'proto', 'serverId', 'hostname', 'model', 'chipModel', 'fw', 'connType'],
|
||||
'proto', 'serverId', 'hostname', 'model', 'chipModel', 'otaSlot', 'fw', 'connType'],
|
||||
room: ['roomId', 'name', 'sortOrder'],
|
||||
shadeState: ['shadeId', 'position', 'target', 'direction', 'myPos', 'tiltPosition', 'tiltTarget', 'tiltDirection',
|
||||
'myTiltPos', 'flags', 'lastRollingCode'],
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue