wilsonmaker
@wilson-m · Se unió el julio 2025
Maker · home automation · Nottingham · new to IoT
- Temas
- 14
- Respuestas
- 70
- Puntos
- 0
Respuestas de foro creadas
Traducido del English por IA ·
Probé exactamente lo de uMQTTBroker en casa el año pasado y lo dejé, luego hice esto, que lleva 8 meses funcionando bien. No soy experto, así que tómalo como «lo que me funcionó a mí».Una Pi Zero 2 W con Mosquitto es el broker local. Los nodos ESP8266 publican en él por la LAN; el puerto 1883 sin cifrar está bien ahí porque nunca sale de casa. La lógica del zumbador es un pequeño script de Python en la Pi que se suscribe localmente, así que funciona sin nada de internet.Para Hermetry, la Pi es un dispositivo marcado como gateway (el interruptor «Este dispositivo es un gateway» al añadirlo). Un segundo script se suscribe a todo en el broker local, marca cada lectura con la hora de la Pi (sincronizada por NTP, compruébalo con timedatectl), las guarda en un archivo SQLite y las envía con paho-mqtt sobre TLS:
topic: v1/gw/telemetry
{
"freezer-1": [{"ts": 1762941600000, "values": {"temp": -18.6, "amps": 1.92}}],
"gate": [{"ts": 1762941605000, "values": {"open": 0}}]
}
Cada nodo se convierte en un dispositivo hijo con su nombre. Solo borra una fila de SQLite después del PUBACK. Cuando vuelve internet, envía el acumulado del más antiguo al más reciente, por lotes, y las lecturas se registran en su hora real en el historial.Dos cosas que aprendí a las malas. Hermetry ignora el flag de retain y no hace bridge a tu broker, así que no te apoyes en ninguno de los dos. Y un acumulado grande se vacía a la velocidad de «Replay messages per second» del perfil, así que tras un corte largo tarda un rato en ponerse al día; es normal.La página que seguí fue 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.
Traducido del English por IA ·
Gracias James. Solo -hupcl no bastó, la primera apertura después de un reinicio seguía reiniciándolo, como dijiste. Puse el condensador de 10 µF (con una etiqueta en la placa que dice «quitar para cargar», eso ya lo aprendí por las malas) y los reinicios desaparecieron. También pasé el script a systemd, como sugirió twilson. Todo está estable ahora.
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.
Traducido del English por IA ·
Dos buses en GPIO4 y GPIO17, 2.2k cada uno, y rehice el cableado como una sola línea a lo largo de los racks. 20 de 20 desde hace dos días, ni un solo 85. También renombré las claves, eliminé el dispositivo y empecé de nuevo, ya que solo había una semana de datos. El panel ahora se lee como una bodega en lugar de una lista de números de serie. Gracias a todos, Kevin quizás en la próxima 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.
Traducido del English por IA ·
3 cables, 3.3V desde la Pi. Los cables miden de 30 cm a 1 m, es más una estrella que una línea, creo.
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.
Traducido del English por IA ·
En mi Pi de escritorio aparece un pequeño rayo en la esquina cuando la alimentación es mala, así que definitivamente lo detecta de alguna manera.
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?
Traducido del English por IA ·
¿El Wi-Fi de invitados parece lo más sencillo? Ya está separado de tus cajas registradoras.
Guest Wi-Fi seems easiest? It’s already separated from your tills.
Traducido del English por IA ·
FUNCIONA. Monté el circuito optoacoplador en una placa perforada; la primera versión sin condensador daba unos 40 timbrazos por pulsación, jaja. Después añadí el de 10 µF y ya está limpio. El administrador conectó nuestra plataforma de chat, yo vinculé mi cuenta y ahora aparece «Alguien está en la puerta de la calle» en mi teléfono unos 2 segundos después de pulsar el botón. ¡Gracias 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!
Traducido del English por IA ·
Tuve lo mismo con un BME280 y era la dirección, 0x76 frente a 0x77.
Had the same with a BME280 and it was the address, 0x76 vs 0x77.
Traducido del English por IA ·
La aplicación no sirve para la mayoría. En el trabajo usamos una aplicación de chat de equipo, y nuestro administrador dice que hay un plugin para ella en el marketplace. Así que el chat me vendría bien si consigo que publique allí.
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.

