painlessMesh-Wurzelknoten als einzige Verbindung zu Hermetry: Wie sollen die anderen Knoten erscheinen?
Von English mit KI übersetzt ·
Ich lese meist nur mit, aber bei einer Architekturfrage stecke ich fest.Umspannwerksgelände, 12 ESP8266-Knoten mit DS18B20 an Transformator- und Schrankoberflächen, zu weit verteilt und zu viel Stahl für normales WLAN zu jedem Knoten. Ich habe ein painlessMesh-Netz aufgebaut, das für sich allein stabil läuft. Knoten 0 ist kabelgebunden in der Nähe des Leitstandgebäudes und soll die Wurzel sein, die alles an Hermetry weitergibt.Zwei Probleme. Erstens: Wenn sich die Wurzel zusätzlich mit dem WLAN der Anlage verbindet (stationManual()), fällt das Mesh alle paar Minuten auseinander, Knoten fallen aus und melden sich wieder an. Zweitens: Ich will kein Hermetry-Gerät mit 24 Schlüsseln namens n7_temp, sondern 12 Geräte, damit ich Alarmregeln in einem Profil hinterlegen kann. Auf der Wurzel geht mir der RAM aus, TLS plus Mesh; der Heap liegt bei etwa 9 KB, wenn es abstürzt.
mesh.init(MESH_PREFIX, MESH_PASSWORD, &sched, MESH_PORT, WIFI_AP_STA, 6);
mesh.stationManual(STATION_SSID, STATION_PASSWORD);
mesh.setRoot(true);
mesh.setContainsRoot(true);
I mostly lurk, but I’m stuck on an architecture question.
Substation yard, 12 ESP8266 nodes with DS18B20s on transformer and cabinet surfaces, too spread out and too much steel for plain Wi-Fi to every node. I built a painlessMesh network and it is stable on its own. Node 0 is wired near the control building and should be the root that gets everything to Hermetry.
Two problems. First, when the root also joins the plant Wi-Fi with stationManual() the mesh falls apart every few minutes, nodes drop and rejoin. Second, I don’t want one Hermetry device with 24 keys called n7_temp, I want 12 devices so I can put alarm rules on a profile. I’m running out of RAM on the root with TLS plus mesh, heap is around 9 KB when it crashes.
mesh.init(MESH_PREFIX, MESH_PASSWORD, &sched, MESH_PORT, WIFI_AP_STA, 6);
mesh.stationManual(STATION_SSID, STATION_PASSWORD);
mesh.setRoot(true);
mesh.setContainsRoot(true);
Von English mit KI übersetzt ·
Ist der Anlagen-AP tatsächlich auf Kanal 6? Das Mesh muss auf dem Kanal des Routers liegen, wenn der Root als Station arbeitet, sonst wechselt das Funkmodul ständig den Kanal und genau dieser Abbruch und Wiederbeitritt tritt auf.
Is the plant AP actually on channel 6? The mesh has to sit on the router’s channel when the root is a station, otherwise the radio keeps hopping and you get exactly that drop and rejoin.
Von English mit KI übersetzt ·
Geprüft, der AP steht auf 11 und auf auto. Ich habe das Mesh auf 11 umgestellt, und es ist besser, aber der AP wechselt nachts manchmal den Kanal.
Checked, the AP is on 11 and auto. Moved the mesh to 11 and it’s better, but the AP changes channel at night sometimes.
Von English mit KI übersetzt ·
Wir hatten ein ähnliches Gelände auf einem Logistikstandort und haben die Internetanbindung ganz aus dem Mesh herausgenommen. Der Root bleibt ein einfacher Mesh-Knoten (kein Station-Modus, daher spielt der Kanal keine Rolle) und kommuniziert über UART mit 115200 Baud mit einem ESP32 daneben. Der ESP32 hängt an Ethernet oder am WLAN der Anlage, hat genug RAM für TLS und ist das einzige Gerät, das Hermetry kennt.Legen Sie den ESP32 in Hermetry als Gateway-Gerät an (setzen Sie beim Erstellen den Haken bei This device is a gateway) und melden Sie jeden Mesh-Knoten als Child über die Gateway-Topics. Verwenden Sie die Mesh-Knoten-ID oder ein Label als Child-Namen und senden Sie einen Typ, damit alle im selben Profil landen:
v1/gw/connect {"device": "yard-n07", "type": "yard-temp"}
v1/gw/telemetry {"yard-n07": {"values": {"temp_c": 41.2, "rssi": -71}},
"yard-n03": {"values": {"temp_c": 38.9, "rssi": -64}}}
Erstellen Sie zuerst ein Profil mit exakt dem Namen yard-temp. Dann erhalten die Children es automatisch, und Ihre Alarmregeln werden diesem Profil zugeordnet. Lassen Sie ts weg, sofern der ESP32 kein NTP hat; die Plattform vergibt dann den Empfangszeitpunkt.Wenn Sie später einen Befehl an einen Knoten senden möchten, gelangt er für ein Child über v1/gw/rpc zum ESP32, und der ESP32 leitet ihn per UART an den Root und weiter ins Mesh. Referenz: Devices behind a gateway.
We had a similar yard on a logistics site and ended up taking the internet job away from the mesh entirely. The root stays a plain mesh node (no station mode, so channel doesn’t matter) and talks over UART at 115200 to an ESP32 next to it. The ESP32 is on Ethernet or the plant Wi-Fi, has the RAM for TLS, and is the only thing Hermetry knows about.
Make the ESP32 a gateway device in Hermetry (tick This device is a gateway when you create it) and report each mesh node as a child on the gateway topics. Use the mesh node id or a label as the child name and send a type so they all land on one profile:
v1/gw/connect {"device": "yard-n07", "type": "yard-temp"}
v1/gw/telemetry {"yard-n07": {"values": {"temp_c": 41.2, "rssi": -71}},
"yard-n03": {"values": {"temp_c": 38.9, "rssi": -64}}}
Create a profile named exactly yard-temp first, then children get it automatically and your alarm rules go on that profile. Leave out ts unless the ESP32 has NTP, the platform will stamp arrival time.
If you later want to send something to a node, a command to a child comes down to the ESP32 on v1/gw/rpc, and the ESP32 passes it over UART to the root and into the mesh. Reference: Devices behind a gateway.
Von English mit KI übersetzt ·
Aus reiner Neugier: Wie viele Hops schaffst du durch all den Stahl?
Out of curiosity, how many hops do you get through all that steel?
Von English mit KI übersetzt ·
Höchstens 3, die entfernten Schaltschränke laufen über zwei Relais. Die UART-Aufteilung wurde diese Woche gemacht: Root ist wieder ein einfacher Mesh-Knoten, der ESP32 macht TLS mit reichlich Heap, unter dem Gateway sind im Profil yard-temp 12 Child-Knoten erschienen. Ich sende den connect-Befehl einmal pro Knoten nach dem Booten, daher landet ein Knoten, der dem Mesh gerade beigetreten ist, sofort auf yard-temp.
3 at most, the far cabinets go through two relays. Did the UART split this week: root is a dumb mesh node again, ESP32 does TLS with plenty of heap, 12 children appeared under the gateway on the yard-temp profile. I send the connect once per node after boot, so a node that just joined the mesh lands on yard-temp straight away.
- Du musst angemeldet sein, um auf dieses Thema antworten zu können.
Mitdiskutieren
Melde dich an, um Fragen zu stellen und zu beantworten, hilfreiche Beiträge mit „Gefällt mir“ zu markieren und die Antwort zu kennzeichnen, die dein Problem gelöst hat. Jeder Beitrag bringt Punkte und Stufen.

