BLE Mesh Serial Subscription

So I've been reading and re-reading all the guides and white papers for the last week, and I think I almost have my head wrapped around everything, but am struggling with trying to configure the "serial" example project node. Using the serial node I can scan for un-provisioned devices and get a "light switch server" (light) and "light switch client" (switch) all tied together using the interactive pyaci script and the ConfigurationClient model.

What I can't figure out is how to subscribe my serial node to the "light" to receive status updates, or to the "switch" to receive state changes. Using "device.send(cmd.AddrLocalUnicastGet())" I can find my internal unicast address, but am not sure how to add a model to my serial node and get that bound to the app key and subscribed.

Thanks!

  • So I think I figured it out, but posting here in case it helps anyone else.

    So digging into the Python a bit, and it looks like when I register a new model it sets up an event hook on MESH_MESSAGE_RECEIVED_UNICAST and model handling of the payload is done in Python. Everything is forwarded over serial and works great as long as you are publishing directly to the assigned unicast address of the serial node.

    If publishing to a group address, the serial node will trigger a callback if it has a subscription registered to that group address using the AddrSubscriptionAdd command.

Related