Von English mit KI übersetzt ·
Genau diese Situation hatten wir mit Zählerplatinen, die ein Dienstleister installiert hat. Sie können die laufende Firmware fragen: Die Partition-API in ESP-IDF funktioniert problemlos über den Arduino-Core. Spielen Sie einen Build auf die Boards auf, die Sie erreichen können (die aus Ihrer eigenen Charge), oder warten Sie, bis die anderen im Depot sind; diese meldet die Tabelle nach dem Verbinden einmal als Client-Attribute:
#include "esp_partition.h"
void reportPartitions() {
String json = "{";
esp_partition_iterator_t it =
esp_partition_find(ESP_PARTITION_TYPE_ANY, ESP_PARTITION_SUBTYPE_ANY, NULL);
bool first = true;
while (it != NULL) {
const esp_partition_t *p = esp_partition_get(it);
if (!first) json += ",";
json += ""part." + String(p->label) + "":"" +
String(p->address, HEX) + "/" + String(p->size) + """;
first = false;
it = esp_partition_next(it);
}
esp_partition_iterator_release(it);
json += "}";
mqtt.publish("v1/attributes", json.c_str());
}
Dann zeigt der Reiter Attributes, Scope Client, pro Board part.app0, part.app1, part.otadata usw. Gewünscht sind zwei App-Slots (ota_0 und ota_1, in den Arduino-Tabellen app0/app1 genannt) plus otadata, jeweils mindestens so groß wie Ihr Image. Sehen Sie nur ein app0 mit 3 MB und kein app1, handelt es sich um das Schema „Huge APP“, dann ist kein OTA möglich.Für Boards, auf die sich kein neuer Build spielen lässt, funktioniert im Depot Emilys Vorgehen:
esptool.py --port /dev/ttyUSB0 read_flash 0x8000 0xc00 pt.bin
python gen_esp32part.py pt.bin
Boards mit falschem Schema brauchen einen einmaligen USB-Reflash mit einer Tabelle mit zwei Slots. Danach funktioniert OTA dauerhaft.
Had this exact situation with meter boards a contractor did. You can ask the running firmware: the partition API in ESP-IDF works fine from the Arduino core. Push one build to the boards you can reach (the ones from your own batch), or wait until the others are at the depot, that reports the table as client attributes once after connecting:
#include "esp_partition.h"
void reportPartitions() {
String json = "{";
esp_partition_iterator_t it =
esp_partition_find(ESP_PARTITION_TYPE_ANY, ESP_PARTITION_SUBTYPE_ANY, NULL);
bool first = true;
while (it != NULL) {
const esp_partition_t *p = esp_partition_get(it);
if (!first) json += ",";
json += ""part." + String(p->label) + "":"" +
String(p->address, HEX) + "/" + String(p->size) + """;
first = false;
it = esp_partition_next(it);
}
esp_partition_iterator_release(it);
json += "}";
mqtt.publish("v1/attributes", json.c_str());
}
Then the Attributes tab, Client scope, shows part.app0, part.app1, part.otadata and so on per board. What you want to see is two app slots (ota_0 and ota_1, called app0/app1 in the Arduino tables) plus otadata, each at least as big as your image. If you see one app0 of 3 MB and no app1, that’s the „Huge APP“ scheme, no OTA possible.
For the boards you can’t get a new build on, emily’s way works at the depot:
esptool.py --port /dev/ttyUSB0 read_flash 0x8000 0xc00 pt.bin
python gen_esp32part.py pt.bin
Boards with the wrong scheme need one USB reflash with a two-slot table. After that OTA works for good.

