Yapay zekâ tarafından English dilinden çevrildi ·
Bir yüklenici firmasının sayaç kartlarında tam olarak bu durum yaşandı. Çalışan firmware’e sorabilirsiniz: ESP-IDF’deki partition API’si Arduino çekirdeğinde de sorunsuz çalışıyor. Ulaşabildiğiniz kartlara (kendi partinizden olanlara) tek bir derleme gönderin ya da diğerlerinin depoya gelmesini bekleyin; bağlandıktan sonra tabloyu bir kez client attributes olarak raporlayacak:
#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());
}
Ardından Attributes sekmesinde, Client scope altında her kart için part.app0, part.app1, part.otadata vb. görünecek. Görmek istediğiniz şey: iki uygulama alanı (ota_0 ve ota_1, Arduino tablolarında app0/app1 olarak geçer) ile otadata, her biri imajınızdan en az o kadar büyük olmalı. Tek bir app0 3 MB görüp app1 yoksa, bu “Huge APP” şemasıdır, OTA yapılamaz.Yeni derleme gönderemediğiniz kartlar için emily’nin yöntemi depoda işe yarar:
esptool.py --port /dev/ttyUSB0 read_flash 0x8000 0xc00 pt.bin
python gen_esp32part.py pt.bin
Yanlış şemaya sahip kartların, iki alanlı bir tabloyla bir kez USB üzerinden yeniden flaşlanması gerekir. Bundan sonra OTA kalıcı olarak çalışır.
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.

