Traducido del English por IA ·
Tuve exactamente esta situación con placas de contadores que instaló un contratista. Puedes preguntarle al firmware que está corriendo: la API de particiones de ESP-IDF funciona bien desde el core de Arduino. Sube un build a las placas a las que puedas acceder (las de tu propio lote), o espera a que las demás estén en el depósito; reportará la tabla como atributos de cliente una vez después de conectarse:
#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());
}
Luego, en la pestaña Attributes, ámbito Client, verás part.app0, part.app1, part.otadata y demás por placa. Lo que quieres ver son dos slots de aplicación (ota_0 y ota_1, llamados app0/app1 en las tablas de Arduino) más otadata, cada uno al menos tan grande como tu imagen. Si ves un solo app0 de 3 MB y ningún app1, es el esquema «Huge APP», no es posible OTA.Para las placas a las que no puedes enviar un build nuevo, el método de emily funciona en el depósito:
esptool.py --port /dev/ttyUSB0 read_flash 0x8000 0xc00 pt.bin
python gen_esp32part.py pt.bin
Las placas con el esquema equivocado necesitan un reflasheo único por USB con una tabla de dos slots. Después, OTA funciona para siempre.
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.

