thompsonplc
@lthompson · Se unió el mayo 2025
Automation engineer · pharma · 14 years in the field
- Temas
- 7
- Respuestas
- 65
- Puntos
- 0
Respuestas de foro creadas
Went with the PLC discrepancy bit, 3 s timer, plus the local trip. Hermetry alarms on sf1.discrepancy == true for all six supply fans through one profile rule. Tested by forcing the aux input and got the alarm and the e-mail within seconds. Kept your JSON version in my notes for the sites where I can’t touch the PLC program.
Traducido del English por IA ·
Todavía tenemos algunos de estos en campo. La diferencia está en quién controla DHCP.Con wpa-conf, ifupdown inicia wpa_supplicant con tu configuración y luego ejecuta dhclient en wlan0 por sí mismo. wpa_supplicant elige una red de los bloques del archivo; a ifupdown no le importa cuál. Es sencillo, y suficiente para «conectarse a cualquiera de estas dos que esté disponible».Con wpa-roam, wpa_supplicant funciona en modo de roaming y llama a wpa_action en cada conexión y desconexión, que a su vez levanta una interfaz lógica. Cada bloque de red puede llevar un id_str que indica la interfaz lógica a usar, y cualquiera sin él recae en iface default. Está pensado para tener ajustes IP distintos por red. El problema es que wpa_action debe ver la desconexión para liberar el arrendamiento anterior; cuando el nodo se traslada y el AP desaparece en un orden extraño, quedas asociado sin ningún arrendamiento. Ese es el síntoma que tenéis en campo.Para dos redes con DHCP, usa wpa-conf y prioridades:
# /etc/network/interfaces
allow-hotplug wlan0
iface wlan0 inet dhcp
wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf
# /etc/wpa_supplicant/wpa_supplicant.conf
network={
ssid="LAB-WIFI"
psk="..."
priority=10
}
network={
ssid="FIELD-AP"
psk="..."
priority=5
}
En el lado de Hermetry, cada cambio entre redes elimina la sesión MQTT, así que haz que tu cliente se reconecte con backoff y vuelva a suscribirse. Si el nodo tiene una alarma de desconexión, ajusta su tiempo de open-after por encima de lo que tarda caminar del laboratorio a la parcela, o recibirás una en cada viaje.
We still have a few of these in the field. The difference is who drives DHCP.
With wpa-conf, ifupdown starts wpa_supplicant with your config and then runs dhclient on wlan0 itself. wpa_supplicant picks a network from the blocks in the file, ifupdown doesn’t care which one. Simple, and enough for «connect to whichever of these two is around».
With wpa-roam, wpa_supplicant runs in roaming mode and calls wpa_action on every connect and disconnect, which then brings up a logical interface. Each network block can carry an id_str that names the logical interface to use, and anything without one falls to iface default. It’s meant for different IP settings per network. The catch is that wpa_action must see the disconnect to take the old lease down; when the node is carried away and the AP disappears in a funny order, you end up associated with no lease. That’s your field symptom.
For two DHCP networks use wpa-conf and priorities:
# /etc/network/interfaces
allow-hotplug wlan0
iface wlan0 inet dhcp
wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf
# /etc/wpa_supplicant/wpa_supplicant.conf
network={
ssid="LAB-WIFI"
psk="..."
priority=10
}
network={
ssid="FIELD-AP"
psk="..."
priority=5
}
On the Hermetry side, each move between networks drops the MQTT session, so make your client reconnect with backoff and resubscribe. If the node has an offline alarm, set its open-after time longer than a walk from the lab to the plot or you’ll get one every trip.
Traducido del English por IA ·
¿A qué voltaje está configurado el level shifter de la placa breakout? La OpenMV funciona a 3,3 V, y la placa breakout del Edison se puede configurar con un jumper para 5 V.
What voltage is the breakout’s level shifter set to? The OpenMV is 3.3 V, the Edison breakout can be jumpered for 5 V.
Traducido del English por IA ·
Dos preguntas distintas, así que dos respuestas.Por qué SPECK y SIMON son pequeños: ambos son diseños ARX (suma, rotación, XOR) sin S-cajas. AES necesita tablas de búsqueda o una sustitución de bytes bastante compleja, lo que consume memoria flash y RAM en un microcontrolador de 8 bits y filtra información de tiempos si se implementa con tablas. La ronda de SPECK son unas pocas sumas, rotaciones y XOR de 16/32/64 bits, por lo que una implementación completa cabe en unos cientos de bytes. Hay dos porque se ajustaron para objetivos distintos: SIMON para hardware (muy pocas puertas) y SPECK para software en microcontroladores. También existen en muchos tamaños de bloque y de clave (de 32/64 hasta 128/256), lo cual resulta útil para paquetes muy pequeños. Para tu tesis, la disputa sobre la estandarización ISO y la falta de justificación del diseño también merecen un capítulo.Por qué no puedes cambiar TLS por SPECK: un cifrado de bloque es solo un componente. TLS ofrece intercambio de claves, autenticación del servidor e integridad de los mensajes, y la plataforma comprueba tu credencial dentro de esa sesión. Si cifras una carga útil con SPECK y la envías, alguien aún tiene que acordar una clave contigo, y el broker vería un bloque opaco. En Hermetry, el lado del dispositivo requiere TLS 1.2 como mínimo (preferiblemente 1.3) con suites de secreto hacia adelante: AES-GCM o ChaCha20-Poly1305, sin intercambio de claves RSA y sin CBC. MQTT sin cifrar en el puerto 1883 solo funciona si un administrador activa MQTT sin cifrar para el perfil, y la documentación lo trata como una excepción para dispositivos que no pueden usar TLS en una red privada o una VPN. Por eso se rechazó tu prueba en el 1883. Todo está en la página de seguridad del transporte de dispositivos.Lado práctico: el ESP32 tiene hardware AES, TLS cuesta un poco de RAM y alrededor de un segundo de negociación por conexión, y después no se nota a las velocidades de los sensores. El ATmega es el problema real. O bien usas el enfoque ChaCha20-Poly1305 (también es ARX y rápido sin hardware dedicado), o dejas que el ATmega hable con una pasarela que mantenga la sesión TLS.
Two different questions, so two answers.
Why SPECK and SIMON are small: both are ARX designs (add, rotate, xor) with no S-boxes. AES needs lookup tables or a fairly involved byte substitution, which costs flash and RAM on an 8-bit part and leaks timing if you do it with tables. SPECK’s round is a handful of 16/32/64-bit adds, rotates and xors, so a full implementation fits in a few hundred bytes. There are two because they were tuned for different targets: SIMON for hardware (very few gates), SPECK for software on microcontrollers. They also come in many block and key sizes (32/64 up to 128/256), which is handy for tiny packets. For your thesis, the ISO standardisation fight and the missing design rationale are worth a chapter too.
Why you can’t swap TLS for SPECK: a block cipher is one building block. TLS gives you key exchange, server authentication and message integrity, and the platform checks your credential inside that session. If you encrypt a payload with SPECK and send it, someone still has to agree a key with you and the broker would see an opaque blob. On Hermetry the device side is TLS 1.2 minimum (1.3 preferred) with forward-secret suites: AES-GCM or ChaCha20-Poly1305, no RSA key exchange, no CBC. Plain MQTT on 1883 only works if an admin switches Plain MQTT on for the profile, and the docs treat that as an exception for devices that can’t do TLS on a private network or VPN. That’s why your 1883 test was refused. It’s all on the device transport security page.
Practical side: the ESP32 has AES hardware, TLS costs you a bit of RAM and a second or so of handshake per connection, and after that it’s nothing you’d notice at sensor rates. The ATmega is the honest problem. Either use ChaCha20-Poly1305 thinking (it’s ARX too and fast without hardware), or let the ATmega talk to a gateway that holds the TLS session.
For the next 30, think about OTA from day one and give each one a sticker with its device name. Climbing to 40 wall boxes to re-flash is a weekend gone.

