aisha.maker
@aisha_r58 · Membre depuis octobre 2025
Maker · home automation · Brisbane
- Sujets
- 7
- Réponses
- 40
- Points
- 0
Toutes mes réponses sur les forums
Traduit de English par IA ·
La solution dongle, donc. Antenne sur le dessus du boîtier, Wi-Fi intégré désactivé, signal à -61 dBm maintenant porte fermée. Aucune déconnexion keepalive dans l’onglet Log depuis samedi, et j’ai laissé le fer à souder dans le tiroir. Il a fallu d’abord installer le pilote de mon dongle, c’était un RTL8812AU, donc vérifie que le tien est pris en charge avant d’acheter.
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.
Traduit de English par IA ·
Les modules HLK conviennent très bien à un usage domestique d’après mon expérience, j’en ai plusieurs qui fonctionnent depuis des années.
The HLK modules are fine at home in my experience, I have a few running for years.
Is the Pi’s ground tied to the 24 V supply’s 0 V somewhere? If so the opto isn’t isolating anything.
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.
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.
Traduit de English par IA ·
Sur un broker standard, si. Vous pourriez faire tourner Mosquitto sur un Pi dans le dépôt et faire publier les armoires là-bas aussi. Un peu brouillon quand même, deux destinations d’envoi.
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.
Traduit de English par IA ·
+1 pour le point sur le Twin. Même dans mon projet maison, une fois les appareils placés sous les pièces, les cartes ont soudain eu du sens pour les autres.
+1 to the Twin bit. Even in my house project, once devices sat under rooms the boards suddenly made sense to other people.
The single N-channel on the bottom is simpler, I’d just do that.
Traduit de English par IA ·
Un splitter 802.3af avec sortie micro-USB 5 V fonctionne sur une 3B, j’en utilise un dans ma serre. Prenez-en un de 2,4 A, les modèles 1 A s’effondrent en tension quand le HAT RS-485 et le Wi-Fi sont tous les deux sollicités.
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.
Traduit de English par IA ·
Pas besoin de topics par appareil. Les 300 publient tous sur le même v1/telemetry. Hermetry sait qui parle grâce aux identifiants avec lesquels l’appareil s’est connecté, donc le token fait office d’adresse. L’unité 17 ne peut pas écrire en tant que 18 car elle n’a pas les identifiants de 18, et un appareil ne peut s’abonner qu’à ses propres topics de downlink (v1/attributes/set, v1/rpc/req/+ et ainsi de suite), donc il ne voit jamais non plus les messages d’un autre appareil. Aucun fichier ACL à maintenir.Kevin n’a pas tort de dire que les topics Custom existent, mais ils sont destinés aux firmwares que l’on ne peut pas modifier : le profil considère alors tout topic en dehors de v1/ comme de la télémétrie de cet appareil. Les limites sont une profondeur de topic de 8, une longueur de 128 et 50 topics distincts par appareil, et avec « Prefix keys with the topic », grid/s12/temp devient une clé du type grid.s12.temp. Comme vous écrivez un nouveau firmware, ignorez tout cela.Pour l’identifiant du site, je en ferais plutôt un attribut de l’appareil qu’une partie du topic. Il ne change pas à chaque minute, donc il n’a pas sa place dans la télémétrie.Référence avec le tableau complet des topics : MQTT topics and payload reference. Un point pratique tiré de mon propre passage à cette architecture : donnez à chaque unité ses propres identifiants. Deux appareils partageant un même token ne cessent de se déconnecter mutuellement.
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.
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.
Traduit de English par IA ·
Réglé. J’ai ajouté le point d’accès avec nmcli comme l’a écrit tsmith, priorités 20/10. Samedi il s’est connecté au téléphone environ 40 s après le démarrage. Les relevés étaient enregistrés dans un fichier JSONL pendant que le téléphone n’avait pas de signal au fond des parcelles, puis envoyés par lots de 50 dès son retour. La première semaine, les horodatages étaient décalés d’une heure sur les premières lectures, exactement le problème NTP, donc j’ai commandé un DS3231 comme Michael. En attendant, le script vérifie NTPSynchronized avant d’horodater.
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.
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.
Module cost me about 4 USD more than the bare chip at 500 pcs. Hotels are 3 buildings with maybe 20 rooms per floor.
Traduit de English par IA ·
Publier de la télémétrie avec le jeton de l’appareil revient à vous faire passer pour l’appareil. Hermetry se contente d’enregistrer ce que « l’appareil » envoie. Vous avez besoin d’une commande dans le sens inverse.
Posting telemetry with the device token is you pretending to be the device. Hermetry just stores what « the device » says. You want a command going the other way.

