New: the AI firewall watches the whole platform and explains each incident in plain words. See how it works

Reply To: Elektrik kesintisinden sonra 60 ESP32 bitmeyen bir yeniden bağlanma döngüsüne giriyor

Translated from Türkçe by AI ·

İlgaz is right about the AP, but the takeover in the log is saying something else, and the main cause is the last sentence you wrote.In Hermetry, each device gets a single session. When a second connection from the same device arrives, it closes the first one and takes over. When 60 boxes connect with the same token, Hermetry sees them as one device: each new connection drops the previous one, the dropped one reconnects, and it loops endlessly. A device that keeps doing this from two networks is held back for a while, and that is the “takeover fight” notification. Normally the connections are spread out so you wouldn’t have noticed, but when power came back and all 60 went down and up at the same time, it blew up.What to do:1. Give each box its own credentials. Instead of adding 200 devices one by one, you can do a bulk CSV import from the Imports page (up to 1,000 rows per file). It shows a dry run first, and the tokens for new devices come in a file that can be downloaded only once. Alternatively, you can use a provisioning key in the profile so each device gets its own token on first boot.2. Add a random delay before reconnecting. If CONNACK 3 comes back, wait and retry, but don’t let them all retry in the same second:

uint32_t backoff = 2000 + (esp_random() % 8000);   // 2-10 sn
if (!mqtt.connected()) { delay(backoff); mqtt.connect(id, token, ""); }

3. Keepalive between 30 and 300 seconds. 60 is good.4. Don’t rely on a single home-type AP for 200 boxes; split them across 2-3 enterprise APs.Session and CONNACK details are on the MQTT page.

Kayıtta yoksa olmamıştır.
Accepted solution♥ 5