wilsonmaker
@wilson-m · Membre depuis juillet 2025
Maker · home automation · Nottingham · new to IoT
- Sujets
- 14
- Réponses
- 70
- Points
- 0
Toutes mes réponses sur les forums
Traduit de English par IA ·
J’ai exactement essayé le truc uMQTTBroker chez moi l’an dernier et j’ai abandonné, puis j’ai fait ceci, qui tourne sans problème depuis 8 mois. Je ne suis pas expert, donc prenez-le comme « ce qui a marché pour moi ».Un Pi Zero 2 W faisant tourner Mosquitto sert de broker local. Les nœuds ESP8266 publient dessus sur le LAN ; le port 1883 non chiffré convient ici, car rien ne sort de la maison. La logique du buzzer est un petit script Python sur le Pi qui s’abonne localement, il fonctionne donc sans aucune connexion Internet.Pour Hermetry, le Pi est un seul appareil marqué comme passerelle (l’interrupteur « Cet appareil est une passerelle » lors de l’ajout). Un second script s’abonne à tout sur le broker local, horodate chaque mesure avec l’heure du Pi (synchronisée par NTP, à vérifier avec timedatectl), les conserve dans un fichier SQLite et les envoie vers le cloud avec paho-mqtt sur TLS :
topic: v1/gw/telemetry
{
"freezer-1": [{"ts": 1762941600000, "values": {"temp": -18.6, "amps": 1.92}}],
"gate": [{"ts": 1762941605000, "values": {"open": 0}}]
}
Chaque nœud devient un appareil enfant portant son nom. Il ne supprime une ligne de SQLite qu’après le PUBACK. Quand Internet revient, il envoie l’arriéré du plus ancien au plus récent, par lots, et les mesures se placent à leurs heures réelles dans l’historique.Deux choses que j’ai apprises à mes dépens. Hermetry ignore le flag retain et ne fait pas de pont vers votre broker, donc ne vous appuyez sur aucun des deux. Et un gros arriéré se résorbe au rythme « Replay messages per second » du profil, donc après une longue coupure il faut un certain temps pour rattraper le retard, c’est normal.La page que j’ai suivie : Devices behind a gateway.
I tried exactly the uMQTTBroker thing at home last year and gave up on it, then did this, which has been solid for 8 months. Not an expert, so take it as « what worked for me ».
A Pi Zero 2 W running Mosquitto is the local broker. The ESP8266 nodes publish to it on the LAN, plain 1883 is fine there because it never leaves the house. The buzzer logic is a tiny Python script on the Pi that subscribes locally, so it works with no internet at all.
For Hermetry, the Pi is one device marked as a gateway (the « This device is a gateway » switch when you add it). A second script subscribes to everything on the local broker, stamps each reading with the Pi’s time (NTP-synced, check timedatectl), keeps them in a SQLite file, and sends them up with paho-mqtt over TLS:
topic: v1/gw/telemetry
{
"freezer-1": [{"ts": 1762941600000, "values": {"temp": -18.6, "amps": 1.92}}],
"gate": [{"ts": 1762941605000, "values": {"open": 0}}]
}
Each node becomes a child device by its name. It only deletes a row from SQLite after the PUBACK. When the internet comes back it sends the backlog oldest first, in batches, and the readings land at their real times in history.
Two things I learned the hard way. Hermetry ignores the retain flag and doesn’t bridge to your broker, so don’t build on either. And a big backlog drains at the profile’s Replay messages per second rate, so after a long outage it takes a while to catch up, that’s normal.
The page I followed was Devices behind a gateway.
Traduit de English par IA ·
Merci James. -hupcl seul ne suffisait pas, la première ouverture après un redémarrage réinitialisait toujours la carte, comme tu l’avais dit. J’ai ajouté le condensateur de 10 µF (avec une étiquette sur la carte indiquant « retirer pour téléverser », je l’avais déjà appris à mes dépens) et les réinitialisations ont disparu. J’ai aussi déplacé le script vers systemd, comme l’a suggéré twilson. Tout est stable maintenant.
Thanks James. -hupcl alone wasn’t enough, the first open after a reboot still reset it, like you said. Put the 10 µF cap on (with a label on the board saying « remove to upload », learned that the hard way already) and the resets are gone. Also moved the script to systemd like twilson said. Total is stable now.
Working! Got two WiZ bulbs. The command list filled up as soon as I added light.set to the catalog. First version the Switch only ever showed its Unknown text, because I hadn’t bound Current state yet. Bound it to hallway_on and it stays put now, even when my wife uses the bulb’s own button.
Traduit de English par IA ·
Deux bus sur GPIO4 et GPIO17, 2.2k chacun, et j’ai refait le câblage en une seule ligne le long des baies. 20 sur 20 depuis deux jours, pas un seul 85. J’ai aussi renommé les clés, supprimé l’appareil et repris à zéro puisqu’il n’y avait qu’une semaine de données. Le tableau de bord ressemble maintenant à une cave plutôt qu’à une liste de numéros de série. Merci à tous, Kevin peut-être pour le prochain build 😉
Two buses on GPIO4 and GPIO17, 2.2k each, and I re-did the run as a line along the racks. 20 of 20 for two days now, not a single 85. Renamed the keys too, deleted the device and started fresh since there was only a week of data. Dashboard reads like a cellar now instead of a serial number list. Thanks all, Kevin maybe next build 😉
Works first time, which never happens to me. Readings are clean and the valve opens when the Mega sends 1. I’d been sending text because I thought I2C was « like Serial ». Also fixed my Hermetry payload while I was at it: temperature now goes out as a number with one decimal.
Traduit de English par IA ·
3 fils, 3.3V depuis le Pi. Les branches font de 30 cm à 1 m, c’est plutôt une étoile qu’une ligne je pense.
3 wires, 3.3V from the Pi. Legs are 30 cm to 1 m, it’s more of a star than a line I guess.
Traduit de English par IA ·
Sur mon Pi de bureau, un petit éclair apparaît dans le coin lorsque l’alimentation est défectueuse, donc il le détecte forcément d’une manière ou d’une autre.
On my desktop Pi a little lightning bolt shows up in the corner when the supply is bad, so it definitely knows somehow.
Maybe Modbus just doesn’t do negative numbers? Could you add 100 to everything and subtract it again later?
Traduit de English par IA ·
Le Wi-Fi invité semble le plus simple ? Il est déjà séparé de vos caisses.
Guest Wi-Fi seems easiest? It’s already separated from your tills.
Traduit de English par IA ·
ÇA MARCHE. J’ai monté le circuit opto sur une plaque perforée, la première version sans condensateur donnait environ 40 sonneries à chaque pression, haha. Après l’ajout du 10 µF, c’est propre. L’admin a connecté notre plateforme de chat, j’ai lié mon compte, et maintenant « Quelqu’un est à la porte de la rue » s’affiche sur mon téléphone environ 2 secondes après le bouton. Merci Lee !
IT WORKS. Built the opto circuit on perfboard, first version without the capacitor gave me like 40 rings per press haha, added the 10 µF and it’s clean. Admin connected our chat platform, I linked my account, and now « Someone is at the street door » pops up on my phone about 2 seconds after the button. Thanks Lee!
Traduit de English par IA ·
J’ai eu le même problème avec un BME280, et c’était l’adresse, 0x76 au lieu de 0x77.
Had the same with a BME280 and it was the address, 0x76 vs 0x77.
Traduit de English par IA ·
Une application ne convient pas à la plupart d’entre eux. Nous avons une application de chat d’équipe au travail, notre administrateur dit qu’il existe un plugin pour cela dans la marketplace. Donc le chat me conviendrait si je peux y faire publier les messages !
App is a no for most of them. We have a team chat app at work, our admin says there is a plugin for it in the marketplace. So chat would be fine if I can get it to post there!
It works!! The strip dims with the slider now and the board says Done. I had also been answering on v1/rpc/req/17 instead of res, so even when I got the number right nothing came back. Thank you Emily.
fair enough, power first next time
Good to know the R thing, I’ve wondered about that on other parts.

