aisha.maker
@aisha_r58 · Ekim 2025 tarihinde katıldı
Maker · home automation · Brisbane
- Konular
- 7
- Yanıtlar
- 42
- Puan
- 0
Oluşturulan forum yanıtları
Yapay zekâ tarafından English dilinden çevrildi ·
Loopback testini notlarınızda saklamaya değer. Bana iki kez işe yaradı.
The loopback test is worth keeping in your notes. Saved me twice.
Yapay zekâ tarafından English dilinden çevrildi ·
SF12’nin sadece SF7’nin daha yavaş bir versiyonu olduğunu, yani aynı şey, sadece daha fazla süre gerektirdiğini düşünmüştüm?
I thought SF12 is just a slower version of SF7, same thing, more time?
Yapay zekâ tarafından English dilinden çevrildi ·
Demek ki USB adaptörü yolunu seçiyorum. Anten kutunun üstünde, dahili Wi-Fi kapalı, kapı kapalıyken sinyal şimdi -61 dBm. Cumartesiden beri Log sekmesinde keepalive kaynaklı bağlantı kopması yok ve lehimleme ekipmanını çekmecede bıraktım. Önce adaptörüm için sürücüyü kurmam gerekti, RTL8812AU modeldi, bu yüzden satın almadan önce sizinkinin desteklenip desteklenmediğini kontrol edin.
Dongle route it is. Antenna on top of the box, onboard Wi-Fi off, signal now -61 dBm with the door shut. No keepalive disconnects in the Log tab since Saturday, and I kept the soldering iron in the drawer. Had to install the driver for my dongle first, it was a RTL8812AU one, so check yours is supported before buying.
Yapay zekâ tarafından English dilinden çevrildi ·
Benim deneyimime göre HLK modülleri evde sorunsuz çalışıyor, birkaç tanesi yıllardır çalışıyor.
The HLK modules are fine at home in my experience, I have a few running for years.
Yapay zekâ tarafından English dilinden çevrildi ·
Pi’nin topraklaması bir yerde 24 V besleme kaynağının 0 V’una bağlı mı? Eğer bağlıysa optokuplör hiçbir şeyi izole etmiyor.
Is the Pi’s ground tied to the 24 V supply’s 0 V somewhere? If so the opto isn’t isolating anything.
Yapay zekâ tarafından English dilinden çevrildi ·
Tyler tek satırda haklı, işte uzun versiyonu. PubSubClient soketten yalnızca okuma yapar ve pingleri client.loop() içinde gönderir. Varsayılan keepalive değeri 15 sn’dir. 30 sn uyuyorsunuz, bu yüzden hiç ping gitmiyor, broker keepalive_timeout süresinin ardından sizi düşürüyor ve -3 durumu “connection lost” anlamına geliyor.
loop() içinde asla bloke etmeyin, bunun yerine bir zamanlayıcı kullanın:
unsigned long last = 0;
void setup() {
...
client.setKeepAlive(60);
client.setBufferSize(512);
}
void loop() {
if (!client.connected()) reconnect(); // with a back-off, not a tight loop
client.loop(); // every pass
if (millis() - last >= 30000) {
last = millis();
snprintf(buf, sizeof buf, "{"temperature":%.2f}", bme.readTemperature());
client.publish("v1/telemetry", buf);
}
}
Dokümanların önerdiği keepalive değeri 30 ile 300 sn arasıdır. Ayrıca Niall’ın dediğini yapın, Log sekmesi her bağlantı kopmasının nedenini gösterir.
Tyler’s right in one line, here’s the longer version. PubSubClient only reads from the socket and sends pings inside client.loop(). Its default keepalive is 15 s. You sleep 30 s, so no ping goes out, the broker drops you for keepalive_timeout, and state -3 is “connection lost”.
Never block in loop(), use a timer instead:
unsigned long last = 0;
void setup() {
...
client.setKeepAlive(60);
client.setBufferSize(512);
}
void loop() {
if (!client.connected()) reconnect(); // with a back-off, not a tight loop
client.loop(); // every pass
if (millis() - last >= 30000) {
last = millis();
snprintf(buf, sizeof buf, "{"temperature":%.2f}", bme.readTemperature());
client.publish("v1/telemetry", buf);
}
}
Keepalive between 30 and 300 s is what the docs recommend. And do what Niall said, the Log tab names the reason for every disconnect.
Yapay zekâ tarafından English dilinden çevrildi ·
100 ms’de bir okumaya düşürdüm ve iki gündür kesintisiz bağlı. Michael, yalnızca delay(1) kullanmak kopmaları azalttı, ama yine de koptu.
Down to one read every 100 ms and it has been connected for two days straight. Michael, delay(1) alone made it drop less, but it still dropped.
Yapay zekâ tarafından English dilinden çevrildi ·
Düz bir broker üzerinde görebiliyor. Depodaki bir Pi üzerinde Mosquitto çalıştırıp dolapların oraya da yayın yapmasını sağlayabilirsiniz. Yalnız biraz karmaşık olur, iki farklı yere gönderim yapmak gerekir.
On a plain broker it is. You could run Mosquitto on a Pi in the depot and have the cabinets publish there as well. Bit messy though, two places to send to.
Yapay zekâ tarafından English dilinden çevrildi ·
Twin kısmına +1. Evimdeki projede bile cihazlar odaların altına yerleştirilince kartlar diğer insanlar için birden anlamlı hale geldi.
+1 to the Twin bit. Even in my house project, once devices sat under rooms the boards suddenly made sense to other people.
Yapay zekâ tarafından English dilinden çevrildi ·
Alttaki tek N-kanallı olan daha basit, ben sadece onu kullanırdım.
The single N-channel on the bottom is simpler, I’d just do that.
Yapay zekâ tarafından English dilinden çevrildi ·
Micro-USB 5 V çıkışlı bir 802.3af ayırıcı 3B ile çalışır, ben de serasında bir tane kullanıyorum. 2,4 A değerli bir tane alın; 1 A’lik olanlar RS-485 HAT ve Wi-Fi aynı anda meşgul olduğunda gerilim düşüp kapanıyor.
An 802.3af splitter with a micro-USB 5 V output works on a 3B, I run one in my greenhouse. Get one rated 2.4 A, the 1 A ones brown out when the RS-485 HAT and Wi-Fi are both busy.
Yapay zekâ tarafından English dilinden çevrildi ·
Cihaz başına topic gerekmiyor. Hepsi aynı v1/telemetry topic’ine yayın yapar. Hermetry, cihazın giriş yaptığı kimlik bilgisinden kimin konuştuğunu bilir, dolayısıyla token fiilen adres görevi görür. 17 numaralı ünite, 18’in kimlik bilgisine sahip olmadığı için 18 adına yazamaz; bir cihaz yalnızca kendi downlink topic’lerine (v1/attributes/set, v1/rpc/req/+ vb.) abone olabilir, bu yüzden başka bir cihazın mesajlarını da hiç görmez. Tutulacak bir ACL dosyası yok.Kevin’in Custom topic’lerin var olduğu konusundaki haklılığı tartışılamaz, ancak bunlar değiştirilemeyen firmware için: profil bu durumda v1/ dışındaki her topic’i o cihazın telemetrisi olarak alır. Buradaki limitler topic derinliği 8, uzunluk 128 ve cihaz başına 50 farklı topic’tir; “Prefix keys with the topic” seçeneğiyle grid/s12/temp, grid.s12.temp gibi bir anahtara dönüşür. Yeni firmware yazdığınız için bunların hepsini atlayın.Saha kimliği için topic’in parçası yapmak yerine cihazın bir özniteliği olarak tanımlamanızı öneririm. Her dakika değişmediği için telemetriye ait değil.Tüm topic tablosunu içeren referans: MQTT topics and payload reference. Kendi cihazlarımı taşırken öğrendiğim pratik bir şey: her ünitenin kendi kimlik bilgisi olsun. Aynı token’ı paylaşan iki cihaz birbirinin bağlantısını sürekli koparır.
No per-device topics needed. All 300 publish to the same v1/telemetry. Hermetry knows who’s talking from the credential the device logged in with, so the token is effectively the address. Unit 17 can’t write as unit 18 because it doesn’t have 18’s credential, and a device can only subscribe to its own downlink topics (v1/attributes/set, v1/rpc/req/+ and so on), so it never sees another device’s messages either. No ACL file to keep.
Kevin’s not wrong that Custom topics exist, but they’re for firmware you can’t change: the profile then takes any topic outside v1/ as telemetry of that device. Limits there are topic depth 8, length 128 and 50 distinct topics per device, and with “Prefix keys with the topic” grid/s12/temp becomes a key like grid.s12.temp. Since you’re writing new firmware, skip all of that.
For the site id I’d make it an attribute of the device instead of part of the topic. It doesn’t change every minute so it doesn’t belong in telemetry.
Reference with the full topic table: MQTT topics and payload reference. One practical thing from when I moved my own stuff: give every unit its own credential. Two devices sharing one token keep kicking each other off.
Yapay zekâ tarafından English dilinden çevrildi ·
Açılır pencerenin çıkması için ESP32 üzerinde her adı 192.168.4.1 ile yanıtlayan bir DNS sunucusu gerekir. Telefon bilinen bir adresi dener, bunun yerine sizin sayfanızı alır ve bunun bir portal olduğuna karar verir.
The pop-up needs a DNS server on the ESP32 that answers every name with 192.168.4.1. The phone tries some known address, gets your page instead and decides it’s a portal.
Yapay zekâ tarafından English dilinden çevrildi ·
Çözüldü. tsmith’in yazdığı gibi hotspot’u nmcli ile ekledim, öncelikler 20/10. Cumartesi günü açılıştan yaklaşık 40 sn sonra telefona bağlandı. Telefonun uzak bölmelerde sinyali yokken okumalar bir JSONL dosyasına yazıldı, sinyal geri gelince 50’lik gruplar halinde yukarı gönderildi. İlk hafta ilk birkaç okumada saatler bir saat kaymıştı, tam olarak NTP meselesi; bu yüzden Michael’ın yaptığı gibi bir DS3231 sipariş ettim. O gelene kadar script, zaman damgası basmadan önce NTPSynchronized değerini kontrol ediyor.
Sorted. Added the hotspot with nmcli as tsmith wrote, priorities 20/10. Saturday it joined the phone within about 40 s of boot. Readings went into a JSONL file while the phone had no signal at the far beds, then went up in batches of 50 when it came back. First week the times were off by an hour on the first few readings, the NTP thing exactly, so I’ve ordered a DS3231 like Michael. Until it comes the script checks NTPSynchronized before stamping.
Yapay zekâ tarafından English dilinden çevrildi ·
Kartı yeniden düzenlemek için 20 adet MDBT42Q modülü sipariş ettim ve evde v1/gw formatını kullanan bir Pi ağ geçidi kurdum. Beş etiketim bir dakika içinde, MAC adlarıyla adlandırılmış alt öğeler olarak göründü. Çift raporlama noktası gerçek: evimdeki iki Pi aynı etiketi raporladı; ağ geçitlerinde en güçlü RSSI kuralıyla düzelttim.
Ordered 20 MDBT42Q modules to rework the board, and set up a Pi gateway at home with the v1/gw format. My five tags showed up as children named after their MAC addresses within a minute. The double-reporting point is real: two Pis in my house both reported the same tag, fixed it with a strongest-RSSI rule in the gateways.

