thompsonplc
@lthompson · Mitglied seit Mai 2025
Automation engineer · pharma · 14 years in the field
- Themen
- 7
- Antworten
- 65
- Punkte
- 0
Erstellte Forenantworten
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.
Von English mit KI übersetzt ·
Wir haben im Feld noch einige davon. Der Unterschied liegt darin, wer DHCP steuert.Bei wpa-conf startet ifupdown wpa_supplicant mit Ihrer Konfiguration und führt danach dhclient auf wlan0 selbst aus. wpa_supplicant wählt ein Netzwerk aus den Blöcken in der Datei, ifupdown kümmert sich nicht darum, welches. Einfach, und ausreichend für „verbinde dich mit dem, der von diesen beiden gerade in Reichweite ist“.Bei wpa-roam läuft wpa_supplicant im Roaming-Modus und ruft bei jeder Verbindung und jeder Trennung wpa_action auf, das dann eine logische Schnittstelle aktiviert. Jeder Netzwerkblock kann eine id_str tragen, die die zu verwendende logische Schnittstelle benennt; alles ohne diese fällt auf iface default zurück. Es ist für unterschiedliche IP-Einstellungen pro Netzwerk gedacht. Der Haken: wpa_action muss die Trennung sehen, um die alte Lease abzubauen. Wenn der Knoten weggetragen wird und der AP in ungünstiger Reihenfolge verschwindet, bleibt man mit einer Assoziation ohne Lease zurück. Das ist Ihr Symptom im Feld.Für zwei DHCP-Netzwerke verwenden Sie wpa-conf und Prioritäten:
# /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
}
Auf der Hermetry-Seite gilt: Jeder Wechsel zwischen Netzwerken trennt die MQTT-Sitzung. Lassen Sie Ihren Client daher mit Backoff neu verbinden und erneut abonnieren. Wenn der Knoten einen Offline-Alarm hat, setzen Sie seine Open-after-Zeit länger als einen Weg vom Labor zur Parzelle, sonst bekommen Sie bei jeder Fahrt einen.
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.
Von English mit KI übersetzt ·
Auf welche Spannung ist der Pegelwandler des Breakouts eingestellt? Die OpenMV arbeitet mit 3,3 V, das Edison-Breakout kann per Jumper auf 5 V umgestellt werden.
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.
Von English mit KI übersetzt ·
Zwei verschiedene Fragen, also zwei Antworten.Warum SPECK und SIMON klein sind: Beide sind ARX-Designs (Addition, Rotation, XOR) ohne S-Boxen. AES benötigt Lookup-Tabellen oder eine recht aufwendige Byte-Substitution, was auf einem 8-Bit-Controller Flash und RAM kostet und bei tabellenbasierter Umsetzung Timing-Informationen preisgibt. Die Runde von SPECK besteht aus einer Handvoll 16/32/64-Bit-Additionen, Rotationen und XORs, daher passt eine vollständige Implementierung in wenige hundert Bytes. Es gibt zwei, weil sie für unterschiedliche Ziele optimiert wurden: SIMON für Hardware (sehr wenige Gatter), SPECK für Software auf Mikrocontrollern. Außerdem gibt es sie in vielen Block- und Schlüsselgrößen (32/64 bis 128/256), was für winzige Pakete praktisch ist. Für Ihre Arbeit lohnt auch ein Kapitel zum ISO-Standardisierungsstreit und zur fehlenden Dokumentation der Designbegründung.Warum Sie TLS nicht durch SPECK ersetzen können: Eine Blockchiffre ist nur ein Baustein. TLS bietet Schlüsselaustausch, Serverauthentifizierung und Nachrichtenintegrität, und die Plattform prüft Ihre Zugangsdaten innerhalb dieser Sitzung. Wenn Sie eine Nutzlast mit SPECK verschlüsseln und senden, muss trotzdem jemand einen Schlüssel mit Ihnen vereinbaren, und der Broker sähe nur einen undurchsichtigen Datenblock. Auf Hermetry ist die Geräteseite mindestens TLS 1.2 (1.3 bevorzugt) mit Forward-Secrecy-Suiten: AES-GCM oder ChaCha20-Poly1305, kein RSA-Schlüsselaustausch, kein CBC. Unverschlüsseltes MQTT auf Port 1883 funktioniert nur, wenn ein Administrator Plain MQTT für das Profil aktiviert, und die Dokumentation behandelt das als Ausnahme für Geräte, die kein TLS in einem privaten Netz oder VPN können. Deshalb wurde Ihr 1883-Test abgelehnt. Alles steht auf der Seite zur Transportsicherheit der Geräte.Praktische Seite: Der ESP32 hat AES-Hardware, TLS kostet etwas RAM und etwa eine Sekunde Handshake pro Verbindung, danach ist es bei Sensorraten nicht spürbar. Der ATmega ist das ehrliche Problem. Entweder denken Sie in Richtung ChaCha20-Poly1305 (das ebenfalls ARX ist und ohne Hardwareunterstützung schnell läuft) oder Sie lassen den ATmega mit einem Gateway sprechen, das die TLS-Sitzung hält.
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.

