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.
AP konusunda İlgaz haklı ama Log’daki takeover başka bir şey söylüyor, asıl sebep son yazdığın cümle.
Hermetry’de her cihazın tek bir oturumu olur. Aynı cihazın ikinci bağlantısı gelince birincisini kapatıp devralır. 60 kutu aynı token’la bağlanınca Hermetry bunları tek bir cihaz olarak görüyor: her bağlanan bir öncekini düşürüyor, düşen tekrar bağlanıyor, sonsuz döngü. Bunu iki ağdan sürekli yapan cihaz bir süre geri tutuluyor ve “takeover fight” bildirimi o. Normalde bağlantılar dağınık olduğu için fark etmemişsiniz, elektrik gelince 60’ı aynı anda kalkınca patlamış.
Ne yapmalı:
1. Her kutuya kendi kimlik bilgisi. 200 cihazı tek tek açmak yerine Imports sayfasından CSV ile toplu içe aktarma yapılabiliyor (dosya başına 1.000 satıra kadar), önce kuru çalıştırma gösteriyor, yeni cihazların token’ları bir kere indirilebilen bir dosyada geliyor. Alternatif olarak profilde provisioning key ile cihazların ilk açılışta kendi token’ını almasını sağlayabilirsiniz. 2. Yeniden bağlanmaya rastgele gecikme ekleyin. CONNACK 3 gelirse bekle-tekrar dene, ama hepsi aynı saniyede denemesin:
uint32_t backoff = 2000 + (esp_random() % 8000); // 2-10 sn
if (!mqtt.connected()) { delay(backoff); mqtt.connect(id, token, ""); }
3. Keepalive 30-300 saniye arası. 60 iyi. 4. 200 kutu için tek ev tipi AP’ye güvenmeyin, 2-3 tane kurumsal AP’ye bölün.
Oturum ve CONNACK detayları MQTT sayfasında.

