ciaran55
@ciaranwalsh55 · Se unió el junio 2025
Smart-city engineer · energy
- Temas
- 9
- Respuestas
- 68
- Puntos
- 0
Respuestas de foro creadas
Traducido del English por IA ·
Si alguna vez tiendes el cable a más de unos pocos metros y las lecturas empiezan a fallar, baja la resistencia a 2,2k.
If you ever run the cable longer than a few metres and readings get flaky, drop the resistor to 2.2k.
Traducido del English por IA ·
Eso funciona, pero existe una forma integrada. Además, la parte de Hermetry cambia un poco la pregunta.
That works but there’s a built-in way. Also, the Hermetry part changes the question a bit.
Traducido del English por IA ·
Siete reglas casi idénticas son mucho que mantener sincronizado. Consideraría hacer que cada sitio sea su propio dispositivo hijo de la Pi (topics de gateway) para que una sola regla sobre up los cubra a todos. Para 7, cualquiera de las dos opciones sirve.
Seven near-identical rules is a lot to keep in sync. I’d consider making each site its own child device of the Pi (gateway topics) so one rule on up covers all of them. Fine either way for 7.
Traducido del English por IA ·
+1 a la pegatina. Además, si alguno de esos laboratorios solo tiene Wi-Fi empresarial con inicio de sesión por usuario, un portal cautivo normal no sirve; necesitarías campos de identidad/nombre de usuario y WPA2-Enterprise en el firmware. Pide mejor a TI una red IoT con PSK, mucho menos complicado.
+1 to the sticker. Also if any of those labs only has enterprise Wi-Fi with a per-user login, a plain captive portal can’t do it, you’d need identity/username fields and WPA2-Enterprise in the firmware. Ask IT for a PSK IoT network instead, much less pain.
Traducido del English por IA ·
Usé Z-Wave en un piloto en un edificio municipal, así que te cuento cómo lo separaría.«Obligatorio» se refiere a la certificación: desde abril de 2017, todo dispositivo nuevo que obtenga la certificación Z-Wave debe admitir S2, y los controladores también. Tu adaptador lo hace. Eso no te obliga a incluir cada nodo con S2.Las clases son: S2 Access Control (cerraduras, puertas de garaje, cualquier cosa que abra una puerta), S2 Authenticated (requiere el PIN, que son los primeros 5 dígitos del DSK en la etiqueta del dispositivo o en el código QR) y S2 Unauthenticated (cifrado, pero sin prueba de que sea el dispositivo que crees).
- Cerraduras de puerta: S2 Access Control, sin discusión. La mayoría de las cerraduras ni siquiera aceptan comandos de bloqueo/desbloqueo sin inclusión segura.
- Sensores de puerta: si solo admiten S0 o nada, eso es lo que tendrán. S0 es muy charlatán (tres tramas por comando), así que prefiero usar los sensores antiguos sin seguridad antes que con S0, a menos que sean relevantes para la seguridad.
- Enchufes: S2 Authenticated. S2 añade unos pocos bytes por trama, nada comparable a la sobrecarga de S0. El problema del tráfico es el intervalo de reporte: configura los enchufes para que informen ante un cambio del 5 % o cada 60 s, en lugar de cada pocos segundos.
Guarda la hoja del PIN junto con las etiquetas; la necesitarás si alguna vez vuelves a incluir un dispositivo.
I ran Z-Wave in a council building pilot, so here’s how I’d split it.
«Mandatory» is about certification: since April 2017 every new device that gets Z-Wave certified has to support S2, and controllers too. Your stick does. That doesn’t force you to include every node with S2.
The classes are S2 Access Control (locks, garage doors, anything that opens a door), S2 Authenticated (needs the PIN, which is the first 5 digits of the DSK on the device label or QR code) and S2 Unauthenticated (encrypted, but no proof it’s the device you think).
- Door locks: S2 Access Control, no discussion. Most locks won’t even accept lock/unlock commands without secure inclusion.
- Door sensors: if they only support S0 or nothing, that’s what they get. S0 is chatty (three frames per command), so I’d rather run old sensors non-secure than S0, unless they’re security-relevant.
- Plugs: S2 Authenticated. S2 adds a few bytes per frame, nothing like S0’s overhead. The traffic problem is the reporting interval, set the plugs to report on a 5 % change or every 60 s instead of every few seconds.
Keep the PIN sheet with the labels, you need it again if you ever re-include.
Traducido del English por IA ·
Si más adelante miras PSM o eDRX en el módem, comprueba primero que tu operador lo admite con esa SIM. El nuestro no lo admitía y perdí un fin de semana.
If you look at PSM or eDRX on the modem later, check your operator supports it on that SIM first. Ours didn’t and I lost a weekend.
Traducido del English por IA ·
Hm, si rfkill ni siquiera lo lista, el kernel nunca activó el controlador.
Hm, if rfkill doesn’t even list it, the kernel never brought the controller up.
Traducido del English por IA ·
Y la Zero en sí consume unos 100 mA en reposo con Wi-Fi, BT y HDMI activados. Eso es un tercio de tu presupuesto antes de que la HAT haga nada.
And the Zero itself idles around 100 mA with Wi-Fi, BT and HDMI on. That’s a third of your budget before the HAT does anything.
Traducido del English por IA ·
Sí, es el timing de los GPIO, y la falta de polarización no ayuda. Tuve casi la misma línea con seis controladores de bombas.Controlar DE/RE desde Python es demasiado lento y demasiado inestable. Tras la escritura, su código vuelve a recepción solo cuando Linux se acuerda de hacerlo. A 38400 baudios, un esclavo puede empezar a responder en un par de milisegundos, así que se pierde el inicio de la respuesta o sigue usted manejando la línea mientras el esclavo habla. Solucione esto en el hardware: un adaptador USB-RS485 con control automático de dirección (los basados en FTDI son buenos), o deje que el kernel lo haga en el UART con el modo rs485. El adaptador es la solución de cinco minutos.Después, la línea en sí:
- Polarización: un pull-up en A y un pull-down en B, solo una vez en el bus (560 Ω a 1 kΩ es lo habitual), para que la línea en reposo quede definida.
- Cable de tierra común entre todos los nodos.
- Dé a pymodbus un timeout razonable y una pausa entre esclavos; algunos firmwares antiguos necesitan un respiro.
client = ModbusSerialClient(port="/dev/ttyUSB0", baudrate=38400, parity="N",
stopbits=1, bytesize=8, timeout=0.3, retries=2)
for unit in range(11, 17):
rr = client.read_holding_registers(0, count=4, slave=unit)
time.sleep(0.02)
Luego publique los seis como hijos del Pi en v1/gw/telemetry, identificados por nombre («mixer-11» y así sucesivamente). Cada uno obtiene su propio dispositivo en Hermetry, y puede poner una regla Device offline en su perfil.
Yes, it’s the GPIO timing, and the missing bias doesn’t help. I had almost the same line on six pump controllers.
Driving DE/RE from Python is too slow and too jittery. After the write, your code switches back to receive only when Linux gets round to it. At 38400 a slave can start answering within a couple of milliseconds, so the start of the reply is lost or you’re still driving the line while the slave talks. Fix it in hardware: a USB-RS485 adapter with automatic direction control (FTDI-based ones are good), or let the kernel do it on the UART with rs485 mode. The adapter is the five-minute fix.
Then the line itself:
- Bias: one pull-up on A and one pull-down on B, only once on the bus (560 R to 1 k is typical), so the idle line is defined.
- Common ground wire between all nodes.
- Give pymodbus a sane timeout and a pause between slaves, some old firmware needs a breather.
client = ModbusSerialClient(port="/dev/ttyUSB0", baudrate=38400, parity="N",
stopbits=1, bytesize=8, timeout=0.3, retries=2)
for unit in range(11, 17):
rr = client.read_holding_registers(0, count=4, slave=unit)
time.sleep(0.02)
Then report all six as children of the Pi on v1/gw/telemetry, keyed by name («mixer-11» and so on). Each one gets its own device in Hermetry, and you can put a Device offline rule on their profile.
Traducido del English por IA ·
El FS90R es la versión de rotación continua del SG90, del mismo tamaño.
The FS90R is the continuous version of the SG90, same size.
Traducido del English por IA ·
El orden del CRC es correcto, Modbus envía primero el byte bajo y 0x71 0xCB es correcto para esa trama. El problema es print.Serial.print(0x01) envía el texto «1», el byte 0x31. Serial.print(0x71) envía «113», tres bytes. Así que el medidor recibe algo como «1400021137…» en ASCII, que no es una trama Modbus en absoluto, y se queda en silencio. Serial.write envía el byte en bruto, que es lo que necesita Modbus RTU.Segundo problema: sueltas DE en cuanto termina el bucle, pero a 2400 baudios los bytes siguen saliendo de la UART durante unos 30 ms más. Cambiar a recepción corta el final de la trama. Espera a que termine la transmisión:
digitalWrite(2, HIGH);
Serial.write(frame, sizeof frame);
Serial.flush(); // retorna cuando el último byte ha salido de la UART
digitalWrite(2, LOW);
La respuesta son 9 bytes: dirección, 0x04, número de bytes 0x04, cuatro bytes de datos, CRC. La tensión del SDM120 es un float de 32 bits, big-endian, con la palabra alta primero:
union { uint32_t u; float f; } v;
v.u = ((uint32_t)r[3] << 24) | ((uint32_t)r[4] << 16) | (r[5] << 8) | r[6];
// v.f es la tensión
Como la única UART hardware del Nano ahora está en el lado RS485, depura con un pin SoftwareSerial o con un parpadeo, no con el monitor serie USB. Cuando lo envíes, manda {"voltage": 231.4} como número para que el gráfico funcione.
CRC order is right, Modbus sends the low byte first and 0x71 0xCB is correct for that frame. The problem is print.
Serial.print(0x01) sends the text «1», the byte 0x31. Serial.print(0x71) sends «113», three bytes. So the meter receives something like «1400021137…» in ASCII, which isn’t a Modbus frame at all, and it stays quiet. Serial.write sends the raw byte, which is what Modbus RTU needs.
Second problem: you drop DE the moment the loop ends, but at 2400 baud the bytes are still going out of the UART for another ~30 ms. Switching to receive cuts the end of the frame. Wait for the transmit to finish:
digitalWrite(2, HIGH);
Serial.write(frame, sizeof frame);
Serial.flush(); // returns when the last byte has left the UART
digitalWrite(2, LOW);
The answer is 9 bytes: address, 0x04, byte count 0x04, four data bytes, CRC. The SDM120 voltage is a 32-bit float, big-endian, high word first:
union { uint32_t u; float f; } v;
v.u = ((uint32_t)r[3] << 24) | ((uint32_t)r[4] << 16) | (r[5] << 8) | r[6];
// v.f is the voltage
Since the Nano’s only hardware UART is now on the RS485 side, debug through a SoftwareSerial pin or a blink, not the USB serial monitor. When you send it on, send {"voltage": 231.4} as a number so the chart works.
Traducido del English por IA ·
El modo de par sirve para presionar o mantener tensión; una puerta simplemente derivaría. Y la parada tardía es la verdadera lección: nunca cierres un bucle rápido a través de la nube.Un comando desde un símbolo puede llegar tarde, el operador puede hacer clic dos veces, y un comando que no recibe respuesta en 30 s se muestra como desconocido, no como fallido. Solo se ejecuta un comando por tarjeta de diagrama a la vez. Todo bien para «ir a abierto», peligroso para «empezar a moverse y esperar a la parada».Pon el accionamiento en modo de posición (o deja que un pequeño PLC junto a él haga el movimiento). La nube solo envía consignas: un comando del catálogo gate.move con un parámetro to de open o closed. El accionamiento gestiona por sí mismo la rampa, el límite de velocidad y las posiciones finales, así que un comando tardío o repetido termina igualmente en el mismo lugar. Haz que el dispositivo ignore un identificador de solicitud que ya ejecutó.En el símbolo: Ejecutar un comando, nivel Básico (los símbolos no pueden enviar nada más), y la confirmación siempre se solicita. Vincula el estado del símbolo de la puerta a la posición que informa el accionamiento, de modo que la imagen muestre dónde está la puerta y no lo que alguien pidió. Consulta Comandos en símbolos.
Torque mode is for pressing or holding tension, a gate would just drift. And the late stop is the real lesson: never close a fast loop through the cloud.
A command from a symbol can arrive late, the operator can click twice, and a command that gets no answer within 30 s is shown as unknown, not as failed. Only one command runs per diagram card at a time. All fine for «go to open», dangerous for «start moving and wait for stop».
Put the drive in position mode (or let a small PLC next to it do the motion). The cloud only sends targets: one catalog command gate.move with a parameter to of open or closed. The drive does the ramp, the speed limit and the end positions itself, so a late or repeated command still ends in the same place. Make the device ignore a request id it has already run.
On the symbol: Run a command, Basic tier (symbols can’t send anything else), and the confirmation is always asked. Bind the gate symbol’s state to the position the drive reports, so the picture shows where the gate is, not what someone asked for. See Commands on symbols.
Traducido del English por IA ·
Hicimos la separación ayer y salió bien. El operador nos pudo dar un APN privado para el antiguo 12; bastó una llamada y un formulario. Las redes permitidas ahora son solo su /24 y nada más. Rotamos los 12 tokens y enviamos los nuevos por el canal de configuración SMS del proveedor; dos armarios no lo aceptaron, así que tendré que visitarlos de todos modos.TI aceptó la frase «aislado hasta su sustitución», con una fecha de sustitución. El tester repitió su montaje de furgoneta en una unidad TLS y no obtuvo nada legible.
Did the split yesterday and it went fine. The operator could give us a private APN for the old 12, took one call and a form. Allowed networks is now their /24 and nothing else. Rotated the 12 tokens and pushed the new ones through the vendor’s SMS config channel, two cabinets didn’t take it so I’ll have to visit those anyway.
IT accepted the «fenced in until replaced» line, with a replacement date. The tester re-ran his van thing on a TLS unit and got nothing readable.
Traducido del English por IA ·
Gracias Laura, eso es más o menos lo que temía. Las unidades SIM800 tienen un firmware que, en teoría, podemos actualizar de forma remota, pero el proveedor dejó de responder correos electrónicos en 2024.
Thanks Laura, that’s roughly what I feared. The SIM800 units are on firmware we can update remotely in theory, but the vendor stopped answering emails in 2024.
Traducido del English por IA ·
Controlador de corriente constante. Las resistencias y los LED de potencia no son compatibles.
Constant current driver. Resistors and power LEDs don’t mix.

