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

Sending one instruction to every node in a Contiki 6LoWPAN mesh behind our border router

Sending one instruction to every node in a Contiki 6LoWPAN mesh behind our border router

Solved 3 3

Plant manager, so forgive the vocabulary. Our contractor put 30 wireless temperature nodes in the cold stores two years ago. They run Contiki-NG on a 6LoWPAN mesh, and a box running the border router sits in the electrical room. The same box also reports the readings to Hermetry as a gateway, each node shows up as its own child device. That part has been rock solid.

What I want now: when the QA team starts a validation run, every node should switch from 5-minute to 30-second sampling, and back afterwards. Today the contractor SSHs in and pokes each node one by one, which takes most of an hour. I asked him to “just broadcast it” and he said multicast through the border router doesn’t work in Contiki and that Hermetry can’t send to children anyway.

Is he right on both counts? I don’t need the details of the radio stack, I need to know whether to pay him for a fix or look for another approach.

♥ 0

He’s wrong about the Hermetry half. Hermetry can send commands and shared attribute changes to devices behind a gateway: the gateway gets them on v1/gw/rpc or v1/gw/attributes and has to apply them, so it depends on whether the contractor’s gateway software handles those topics. A command to the gateway device itself works too, so the box in your electrical room can get “start validation sampling” from a dashboard button or a rule and fan it out locally. That’s one command instead of 30. The radio half is Eric’s territory.

Measure twice, poll once.
♥ 0

Partly right on the radio half. Contiki-NG does have IPv6 multicast for RPL networks: two engines, SMRF and MPL. You turn one on at build time in the nodes’ project-conf.h and in the border router’s:

/* every node and the border router */
#define UIP_MCAST6_CONF_ENGINE UIP_MCAST6_ENGINE_MPL
/* for SMRF instead you also need storing mode with multicast: */
/* #define UIP_MCAST6_CONF_ENGINE UIP_MCAST6_ENGINE_SMRF */
/* #define RPL_CONF_MOP RPL_MOP_STORING_MULTICAST */

Where he’s right is that the stock rpl-border-router does not forward multicast arriving from the outside network into the mesh. So the multicast has to originate on the border router itself: a small process on that box that, on a command from Hermetry, sends one MPL datagram to a group the nodes joined. It means reflashing all 30 nodes with multicast enabled, which on a cold store install is a site visit.

Honestly, for 30 nodes I’d skip multicast. Have the border router loop over the 30 addresses and send unicast with a retry. 30 small packets on a mesh is nothing, it finishes in seconds, and every node acks so you know who missed it. No reflash.

Then in Hermetry: add a command like sampling.set with a period_s parameter on the gateway’s profile, answer it from that process once all nodes acked, and put two buttons on the QA dashboard. Have the nodes report their current period as a client attribute so QA can see it took.

Timestamps in UTC or it didn't happen.
Accepted solution♥ 8

Contractor did the unicast loop in two days, no site visit. QA presses “Validation on”, the gateway answers with 30/30 acked about 8 seconds later, and the nodes’ sample_period attribute flips to 30. Went from an hour to a button. Thanks both, and I’ve stopped saying “just broadcast it”.

♥ 0
Viewing 4 posts – 1 through 4 (of 4 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