New: the AI firewall watches the whole platform and explains each incident in plain words. See how it works

painlessMesh root node as the only link to Hermetry: how should the other nodes show up?

painlessMesh root node as the only link to Hermetry: how should the other nodes show up?

Solved 5 4

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);
♥ 0

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.

♥ 0

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.

♥ 1

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.

Accepted solution♥ 2

Out of curiosity, how many hops do you get through all that steel?

♥ 0

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.

♥ 0
Viewing 6 posts – 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.

Join the conversation

Sign in to ask and answer, like helpful posts and mark the reply that solved your problem. Every contribution earns points and levels.

Share