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
I’m a beginner too but I had exactly this with my weather station PC last winter, and the fix was to stop caring about the number. Find the port by what’s plugged into it instead. pyserial can list ports with their USB ids and serial number:
from serial.tools import list_ports
def find_arduino():
for p in list_ports.comports():
print(p.device, p.vid, p.pid, p.serial_number, p.description)
if p.vid == 0x2341 and p.serial_number == "85736323838351F0B0E1":
return p.device
return None
port = find_arduino()
ser = serial.Serial(port, 9600, timeout=2)
Run it once to print yours and copy the serial number in. 0x2341 is the vendor id of genuine Arduino boards. If yours is a clone with a CH340 chip (vid 0x1A86), careful: those usually have no serial number, so with two clones you can’t tell them apart and you’d match on p.location (the USB socket) instead.
Also wrap the read loop so it looks for the port again after an error instead of dying, then people can replug whenever they like.
Traducido del English por IA ·
Sí, cometí el mismo error en papel el invierno pasado en casa. Necesitas un contacto seco, así que o bien un módulo de relé libre de tensión (la placa tipo Sonoff RE5V1C, o cualquier ESP8266 con un módulo de relé de 5 V conectado a COM/NO) en los terminales del termostato, en paralelo con el termostato antiguo para que siga funcionando si tu placa falla.La parte de la placa fue más fácil de lo que pensaba una vez que encontré el catálogo. Abre el perfil del dispositivo, la pestaña Commands, y pulsa Add command:
Method: heat.set
Label: Heating
Tier: Basic
Parameters: on (Yes / no, required)
Solo los comandos de nivel Basic de esa lista aparecen en la configuración del Switch. Luego, en Switch: Run a command, elige el dispositivo y heat.set, con el valor de «The control’s value». Vincula Current state a una clave de telemetría que reporte la placa: yo envío heat_on como 0/1 con cada lectura para que el interruptor muestre lo que el relé hace realmente, y no lo que pulsaste. Para una luz o calefacción puedes desactivar «Ask before running». Responde con el mismo id o la tarjeta se queda en «Sent; waiting for the device»:
// in callback, topic "v1/rpc/req/17"
String id = String(topic).substring(11);
digitalWrite(RELAY, on ? HIGH : LOW);
mqtt.publish(("v1/rpc/res/" + id).c_str(), "{"ok":true}");
Página que usé: Control cards.
Yep did the same mistake on paper last winter at home. You want a dry contact, so either a relay module that’s volt-free (the Sonoff RE5V1C style board, or any ESP8266 plus a 5 V relay module wired COM/NO) across the thermostat terminals, in parallel with the old thermostat so it still works if your board dies.
The board side was easier than I thought once I found the catalogue. Open the device’s profile, Commands tab, Add command:
Method: heat.set
Label: Heating
Tier: Basic
Parameters: on (Yes / no, required)
Only Basic tier commands from that list show up in the Switch settings. Then in the Switch: Run a command, pick the device and heat.set, value from «The control’s value». Bind Current state to a telemetry key the board reports, I send heat_on as 0/1 with every reading so the switch shows what the relay is really doing, not what you clicked. For a light or heating you can turn «Ask before running» off. Reply on the same id or the card sits on «Sent; waiting for the device»:
// in callback, topic "v1/rpc/req/17"
String id = String(topic).substring(11);
digitalWrite(RELAY, on ? HIGH : LOW);
mqtt.publish(("v1/rpc/res/" + id).c_str(), "{"ok":true}");
Page I used: Control cards.
I looked into this for a friend’s small bakery. I couldn’t find a doc page for Forge either, so I can’t tell you what it does for quality or how it gets on a plan.
What works with the normal IoT part: have the sensor’s controller (or a small PLC) send the thickness of each piece, or the min/max/average per 10 s, as telemetry, e.g. {"thick_mm": 7.12, "rejects": 3}. Then an alarm rule on the profile for out of tolerance. There’s no «between» operator, but you can group conditions with any:
{ "any": [
{ "key": "thick_mm", "op": "<", "value": 6.0 },
{ "key": "thick_mm", "op": ">", "value": 8.0 }
] }
For counts per shift, send a growing rejects_total counter and chart it with the increase aggregate per hour. The reject gate itself must be driven locally by the sensor controller or PLC, not from the cloud; a belt at 0.4 m/s can’t wait on a round trip.
The conditions reference is Alarm conditions reference.
DNSServer + WiFiManager and the portal pops up on both phones now. Provisioning worked first time with pre-created names; I read the 30 chip IDs over serial into a CSV first. Forgot to save the token to NVS on my first build, so on reboot it tried to provision again and got device_exists. Fixed, and stickers are printed.
rev 2 boards arrived with two MMBT3904 and the 1 uF on EN. Uploads are automatic now and opening the monitor no longer resets it. I bodged rev 1 with transistors on wires, ugly but works. Thanks Eric, and Aoife for spotting it straight away.
Traducido del English por IA ·
Era eso. La red de invitados entrega bien el router como DNS, pero mi sketch usaba una IP de NTP fija que un cortafuegos bloqueaba, así que el reloj nunca se ajustó y TLS falló. Lo cambié a pool.ntp.org y el sensor volvió a funcionar. Los cinco están ahora en la red de invitados, con el aislamiento desactivado, y el portátil del trabajo no puede verlos.No toqué el reenvío de puertos, Kevin, gracias de todos modos.
That was it. Guest network hands out the router as DNS fine, but my sketch was using a hardcoded NTP IP that a firewall blocked, so the clock never set and TLS failed. Switched it to pool.ntp.org and the sensor came back. All five are on the guest network now, isolation off, and the work laptop can’t see them.
Didn’t touch the port forwarding, Kevin, thanks anyway.
Could it be the coin cell? Mine read weird when the battery was cold.
Shame about MJPEG but makes sense, thanks Aoife.
Traducido del English por IA ·
Compré una RTC HAT barata justo para este motivo, una DS3231, por un par de libras. Así el reloj está bien incluso sin conexión.
I bought a cheap RTC HAT for this exact reason, DS3231, a couple of quid. Then the clock is right even offline.
Can you watch it in Hermetry’s camera live view once it’s flashed? Been wondering about these.
+1 for the request, would love a simple person count for my garden shed camera.
Could you just make the contacts bigger? Like wide copper strips on the dock.
Traducido del English por IA ·
Por lo que veo, solo el interruptor de aislamiento, además de un límite de ancho de banda. No hay reglas adecuadas.
Only the isolation switch as far as I can see, plus a bandwidth limit. No proper rules.
maybe the WiFi pulls too much current and the 3.3 V sags? I had brownouts on mine
Maybe the DHCP lease is slow and the code tries MQTT before the address is ready?

