<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: weiyi</title>
    <description>The latest articles on DEV Community by weiyi (@weiyi).</description>
    <link>https://dev.to/weiyi</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F655533%2F4d6d7257-0a75-4d05-bf68-c11b5c5b15f1.png</url>
      <title>DEV Community: weiyi</title>
      <link>https://dev.to/weiyi</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/weiyi"/>
    <language>en</language>
    <item>
      <title>Why Does Matter Use IPv6? Will It Work If IPv6 Isn’t Enabled at Home?</title>
      <dc:creator>weiyi</dc:creator>
      <pubDate>Sat, 07 Nov 2026 01:19:21 +0000</pubDate>
      <link>https://dev.to/weiyi/why-does-matter-use-ipv6-will-it-work-if-ipv6-isnt-enabled-at-home-3lbm</link>
      <guid>https://dev.to/weiyi/why-does-matter-use-ipv6-will-it-work-if-ipv6-isnt-enabled-at-home-3lbm</guid>
      <description>&lt;p&gt;You bought a Matter smart plug and are getting ready to add it to your home automation system. Then you notice a line in the network requirements: IPv6 is required.&lt;/p&gt;

&lt;p&gt;You open your router settings. Your internet connection doesn’t appear to have an IPv6 address, and devices at home are still using &lt;code&gt;192.168.x.x&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Do you need to call your internet provider just to use a smart plug?&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Usually not. Matter needs IPv6 communication on your local network; it does not require an IPv6 internet service from your provider.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;That does not mean you can disable IPv6 throughout your local network. These are two separate questions: can devices at home communicate with one another over IPv6, and can they reach the internet over IPv6?&lt;/p&gt;

&lt;p&gt;This is not a trick for bypassing a requirement. In its “Network Topology” section, the CSA Matter 1.4.1 Core Specification explicitly considers operation when an internet provider does not support IPv6, and when the network is disconnected from or isolated by a firewall from the internet.[1]&lt;/p&gt;

&lt;p&gt;That raises another question: if internet access is not necessarily required, why does Matter use IPv6? With so few devices at home, isn’t IPv4 enough?&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;The opening is a hypothetical scenario. This article explains network mechanisms using specifications and official developer documentation; it does not report hands-on tests of routers, device compatibility, or performance without internet access. Installation, account sign-in, and remote features of specific products may still depend on the internet.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Frumrmhoblxuisrgv8i1b.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Frumrmhoblxuisrgv8i1b.png" alt="Concept illustration of home devices connected locally, separate from the internet" width="799" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;AI-generated concept illustration distinguishing local networking from the internet; not an actual topology or connectivity test.&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  1. Matter First Needs Devices on Different Networks to Speak the Same Language
&lt;/h2&gt;

&lt;p&gt;Imagine three things at home: a Wi-Fi smart plug, a battery-powered Thread sensor, and a controller connected by Ethernet.&lt;/p&gt;

&lt;p&gt;Their power consumption, bandwidth, and connection methods differ. There is no need to force them all onto the same wireless technology. But the control system still needs to do certain things across them: find devices, read their state, send commands, and establish who is allowed to operate them.&lt;/p&gt;

&lt;p&gt;A useful first approximation of Matter’s division of responsibilities is:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Layer&lt;/th&gt;
&lt;th&gt;Main question it answers&lt;/th&gt;
&lt;th&gt;Examples here&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Matter device model and interactions&lt;/td&gt;
&lt;td&gt;What can the device do, and how are its functions read and operated?&lt;/td&gt;
&lt;td&gt;On/off, brightness, temperature, and related attributes and commands&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Matter security mechanisms&lt;/td&gt;
&lt;td&gt;Who is communicating, who is authorized to operate the device, and can the messages be trusted?&lt;/td&gt;
&lt;td&gt;Identity credentials, secure sessions, access control&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;IPv6 network&lt;/td&gt;
&lt;td&gt;Where should data be sent, and how does it reach another network?&lt;/td&gt;
&lt;td&gt;Unicast, multicast, and routing where needed&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Underlying network technology&lt;/td&gt;
&lt;td&gt;What link carries the data?&lt;/td&gt;
&lt;td&gt;Wi-Fi, Ethernet, Thread&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;This illustrates responsibilities; it is not a complete protocol stack.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Matter did not invent a network addressing and routing system just for smart plugs. It builds its device interactions on IP networks.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The architecture section of the CSA specification explicitly describes Matter as an IPv6-based smart home communication protocol and identifies the Wi-Fi, Ethernet, and Thread networks it covers.[1] Google’s developer primer also distinguishes IPv6-based operational communication from BLE, which can be used to commission a device onto a network.[2]&lt;/p&gt;

&lt;p&gt;This allows the underlying connection methods and higher-level device functions to evolve separately. A sensor can remain optimized for low power, and a controller can keep using Ethernet, without either needing a different definition of what “temperature” means.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. Why IPv6 Instead of Continuing to Use IPv4?
&lt;/h2&gt;

&lt;p&gt;“IPv6 has more addresses” is not wrong, but it does little to explain why a home with a few dozen devices needs it.&lt;/p&gt;

&lt;p&gt;Three points better explain the choice in terms of Matter’s architecture.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;First, Thread is already a low-power network based on IPv6.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Thread does not start with a completely different device network and then leave each vendor’s gateway to translate every function into the IP world. It provides IPv6 networking for low-power devices.[3]&lt;/p&gt;

&lt;p&gt;Wi-Fi and Ethernet can also carry IPv6. By using IPv6 throughout, Matter gives native Matter nodes on these different links a common network layer, reducing the need to translate between different network protocols.&lt;/p&gt;

&lt;p&gt;That does not mean communication across networks works automatically. Moving between Thread and the home LAN still requires border routing and correct address and route configuration.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Second, IPv6 provides not just individual addresses, but network mechanisms for local communication and multicast.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Matter needs to reach individual nodes and may also send messages to groups of nodes. Google’s developer documentation explicitly states that Matter uses IPv6 unicast and multicast to reach nodes and groups, respectively.[4]&lt;/p&gt;

&lt;p&gt;IPv6 also supports addresses with different scopes. Devices can have addresses for local communication without each sensor needing a publicly reachable address.&lt;/p&gt;

&lt;p&gt;There is an important qualification: IPv4 also has private addresses, multicast, and other capabilities. &lt;strong&gt;It would be wrong to claim that IPv4 cannot provide every capability mentioned here, or that IPv6 inherently guarantees delivery of group commands.&lt;/strong&gt; The key point is that Matter has chosen a common IPv6 communication foundation and defines its own interaction and security rules on top of it.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Third, a common network layer makes it easier to reuse existing IP technologies and tools.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;A Thread Group technical article emphasizes that Thread, Wi-Fi, and Ethernet devices can participate as IP devices in a larger network.[5] Developers can troubleshoot IP connectivity, service discovery, and routing without defining a separate application gateway for every underlying link.&lt;/p&gt;

&lt;p&gt;This explains an architectural benefit; it is not a claim that IPv6 is necessarily faster than IPv4, or a complete account of the standards authors’ historical decisions. A product’s actual power consumption, latency, and reliability still depend on its wireless environment, implementation, and workload.&lt;/p&gt;

&lt;h2&gt;
  
  
  3. No “Public IPv6” and No “Local IPv6” Are Very Different Things
&lt;/h2&gt;

&lt;p&gt;An “IPv6” switch in a router interface might control the WAN connection, or it might also affect LAN configuration. The switch’s name alone cannot tell you whether Matter will work.&lt;/p&gt;

&lt;p&gt;Start by separating these three observations:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;What you see&lt;/th&gt;
&lt;th&gt;What it tells you&lt;/th&gt;
&lt;th&gt;What it does not establish&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Your internet provider has not assigned an IPv6 address or prefix&lt;/td&gt;
&lt;td&gt;You may not have IPv6 internet connectivity&lt;/td&gt;
&lt;td&gt;Devices at home are not necessarily unable to communicate locally over IPv6&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;A device has a &lt;code&gt;192.168.x.x&lt;/code&gt; address&lt;/td&gt;
&lt;td&gt;It has an IPv4 address&lt;/td&gt;
&lt;td&gt;It may also be using IPv6&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;You can see an IPv6 address on a network interface&lt;/td&gt;
&lt;td&gt;At least one IPv6 address exists&lt;/td&gt;
&lt;td&gt;The target device is reachable, service discovery works, or Matter authorization has succeeded&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;IPv4 and IPv6 can coexist. Seeing a familiar IPv4 address in your router interface does not mean the device supports only IPv4.&lt;/p&gt;

&lt;p&gt;Conversely, seeing a link-local address beginning with &lt;code&gt;fe80::&lt;/code&gt; does not establish that the whole home network is connected. Such addresses work only on their own link; an ordinary router cannot forward them to another subnet. Reaching another network, such as Thread, also requires addresses and routes suitable for communication across networks.[6][7]&lt;/p&gt;

&lt;p&gt;Home Assistant’s official Matter documentation states this directly: an IPv6 internet connection and a DHCPv6 server are not required, but IPv6 support must be enabled on the host, and the relevant IPv6 and multicast traffic must be able to pass through.[8]&lt;/p&gt;

&lt;p&gt;The troubleshooting order should therefore be: &lt;strong&gt;first confirm that local IPv6 works, then investigate whether the problem actually involves the internet.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;For an offline test, disconnect the internet link while keeping the router, access points, controller, and border router powered and the local network running. Unplugging the entire router tests more than the absence of internet access.&lt;/p&gt;

&lt;h2&gt;
  
  
  4. Is a Thread Border Router Just Another Kind of “Gateway”?
&lt;/h2&gt;

&lt;p&gt;Product pages often use “gateway,” “hub,” and “controller” interchangeably. For design and troubleshooting, it helps to distinguish their functions.&lt;/p&gt;

&lt;p&gt;For example, a path for controlling a Thread-based Matter smart plug might be:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Matter controller → Wi-Fi/Ethernet → Thread border router → Thread network → Matter smart plug.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Both endpoints speak Matter. The border router in between primarily enables IP data to cross the network boundary and helps support service discovery. OpenThread’s official documentation explicitly lists bidirectional IP connectivity between Thread and Wi-Fi/Ethernet, along with mDNS- and SRP-related service discovery functions.[7]&lt;/p&gt;

&lt;p&gt;Simply changing the link from Wi-Fi to Thread does not require it to translate Matter’s “turn on the light” command into the “turn on the light” command of another application protocol.&lt;/p&gt;

&lt;p&gt;Bringing a non-Matter Zigbee or Bluetooth Mesh device into Matter is different. A bridge must also map that device’s capabilities and state into a data model Matter can understand.[1][2]&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Role&lt;/th&gt;
&lt;th&gt;Main responsibility&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Ordinary home router/access point&lt;/td&gt;
&lt;td&gt;Provides the relevant IP network, routing, or Wi-Fi access; IPv6 support does not automatically provide Thread support&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Thread border router&lt;/td&gt;
&lt;td&gt;Connects Thread to an adjacent IP network and provides the necessary routing and service discovery support&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Matter controller&lt;/td&gt;
&lt;td&gt;Reads or controls Matter nodes using an appropriately authorized identity&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Matter bridge&lt;/td&gt;
&lt;td&gt;Maps devices using other technologies into the Matter data model&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;A speaker or hub can perform several of these roles in one product. &lt;strong&gt;Combining roles in one box does not make their responsibilities the same.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Another easy mistake is to equate network reachability with permission to control a device. A Matter Fabric is a logical domain organized around a shared root of trust, not a Wi-Fi name or an IPv6 subnet. Multiple Fabrics can exist on the same home network, and Matter credentials and access control still determine control permissions.[1]&lt;/p&gt;

&lt;h2&gt;
  
  
  5. If Bluetooth Finds the Device, Why Can Adding It Still Fail?
&lt;/h2&gt;

&lt;p&gt;Because finding a device that is ready to be added and getting it into normal operation are different steps.&lt;/p&gt;

&lt;p&gt;Some common commissioning flows first use BLE to find a device and establish an initial configuration channel, then configure its Wi-Fi or Thread network. The device must subsequently join its operational network and complete discovery, secure session establishment, and final commissioning confirmation.[1][2]&lt;/p&gt;

&lt;p&gt;So a phone finding the device shows only that this discovery step succeeded. It does not guarantee that later IPv6 communication will work.&lt;/p&gt;

&lt;p&gt;Once commissioned, Matter uses IP-based DNS-SD for operational discovery. On a typical LAN, this involves mDNS. Registration of Thread devices’ services and discovery from outside the Thread network may also involve SRP and a discovery proxy on the border router.[4][7][9]&lt;/p&gt;

&lt;p&gt;Separating these stages makes failures easier to describe:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;The device can be scanned but cannot join its operational network:&lt;/strong&gt; Check network credentials, the connection methods the device supports, and the conditions for joining Thread.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The device has joined but the controller cannot find it:&lt;/strong&gt; Check whether service discovery reaches the controller and whether the IPv6 address in the discovery result is reachable.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The device can be found and is reachable, but control fails:&lt;/strong&gt; Investigate the Matter secure session, Fabric, access permissions, and device implementation.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;These are troubleshooting directions, not root causes that can be determined from the symptoms alone. A single report of “commissioning failed” should not conflate the Bluetooth, IP networking, and application permission stages.&lt;/p&gt;

&lt;h2&gt;
  
  
  6. When Something Goes Wrong, Check These Five Things First
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;First, confirm which kind of Matter device you bought.&lt;/strong&gt; Wi-Fi and Thread versions have different network requirements. A standard Wi-Fi router’s IPv6 support does not mean it has a Thread radio or border router functionality.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Next, check IPv6 in the controller’s actual runtime environment.&lt;/strong&gt; This is especially important for a custom gateway, virtual machine, or container: an IPv6 address on the host does not mean the environment running the Matter service has the same network connectivity.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Check whether devices are isolated from one another.&lt;/strong&gt; A guest network, AP client isolation, VLAN, or firewall policy can let each device access the internet while preventing the discovery or communication they need with each other. For initial verification, establish a baseline on a trusted, simple, locally connected network before adding isolation policies one at a time.[8]&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Test discovery and communication separately.&lt;/strong&gt; DNS-SD/mDNS finds services and their connection information. The controller must still reach the device over a working IPv6 path afterward. Across VLANs, adding an mDNS forwarder alone does not mean addresses, routes, multicast, and access rules are all correctly configured.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Finally, distinguish local control from cloud features.&lt;/strong&gt; Provider-supplied IPv6, vendor accounts, remote control, voice services, and firmware downloads may have different dependencies. Matter’s ability to support local control does not mean every step from a particular product’s first installation to all its extra features works entirely offline.[8]&lt;/p&gt;

&lt;p&gt;For each failure, record the stage, which network each endpoint is on, what address discovery returned, and whether the actual connection succeeded. That is more useful than a note saying only “this router is incompatible.”&lt;/p&gt;

&lt;p&gt;There is also no need to disable the entire router firewall to try Matter. Identify the missing capability or blocked traffic on the local communication path, then make a targeted change.&lt;/p&gt;

&lt;h2&gt;
  
  
  7. Using IPv6 Does Not Mean Devices Are Directly Exposed to the Internet
&lt;/h2&gt;

&lt;p&gt;Two common misconceptions remain.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;An IPv6 address is not a pass to control a device remotely.&lt;/strong&gt; Whether a device is reachable from the internet depends on its address type, routing, and firewall. Even when it is network-reachable, Matter still has its own authentication, encryption, and access control.[1]&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;IPv6 does not automatically make communication secure, either.&lt;/strong&gt; Matter’s security comes from its specific credentials, sessions, message protection, and permission mechanisms, as well as correct product implementation and maintenance. It cannot be reduced to “it is secure because it uses IPv6.”&lt;/p&gt;

&lt;p&gt;Returning to the smart plug: the first thing to confirm is whether it and the controller have a local path that supports service discovery, carries IPv6 data, and has the correct authorization.&lt;/p&gt;

&lt;p&gt;Matter uses IPv6 to put devices with different connection methods on a common network foundation. Getting that local path working is more relevant than first obtaining a public IPv6 address.&lt;/p&gt;

&lt;h2&gt;
  
  
  Sources and Scope of Verification
&lt;/h2&gt;

&lt;p&gt;Sources checked: 2026-11-06. This article cites Matter 1.4.1 as a verifiable specification version, not as the latest version. It does not infer complete compatibility across all ecosystems from any one vendor’s tutorial.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;a href="https://csa-iot.org/wp-content/uploads/2025/05/23-27349-007_matter-1-4-1-core-specification.pdf" rel="noopener noreferrer"&gt;CSA: Matter Core Specification 1.4.1&lt;/a&gt;, 2025-03-17. Sections 2.1–2.4 and 2.7–2.8 were checked in particular for architecture, network topology, operation without public IPv6, Fabrics, security, and commissioning.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://developers.home.google.com/matter/primer?hl=en" rel="noopener noreferrer"&gt;Google Home Developers: What is Matter?&lt;/a&gt;. Checked for the use of IPv6 in operational communication, BLE’s role in commissioning, and the concept of bridging; the English text was used to avoid ambiguity from automatic translation.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://openthread.io/guides/thread-primer?hl=en" rel="noopener noreferrer"&gt;OpenThread: What is Thread?&lt;/a&gt;. Checked for Thread’s role as an IPv6 network for low-power devices.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://developers.home.google.com/matter/primer/thread-and-ipv6?hl=en" rel="noopener noreferrer"&gt;Google Home Developers: Thread and IPv6&lt;/a&gt;. Checked for unicast, multicast, border routing, and discovery proxies; its example throughput or latency figures are not cited as product metrics.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://threadgroup.org/newsroom/blog/multiple-thread-networks-and-the-seamless-interconnectivity-of-ip" rel="noopener noreferrer"&gt;Thread Group: Multiple Thread Networks and The Seamless Interconnectivity of IP&lt;/a&gt;, 2023-08-24. Used to understand the benefits of IP connectivity across links; network reachability must still be distinguished from Matter authorization.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://openthread.io/guides/thread-primer/ipv6-addressing?hl=en" rel="noopener noreferrer"&gt;OpenThread: IPv6 Addressing&lt;/a&gt;. Checked for address scope and the possibility of multiple addresses on one device; Thread-internal addresses are not assumed to be reachable across networks.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://openthread.io/guides/border-router?hl=en" rel="noopener noreferrer"&gt;OpenThread: Border Router&lt;/a&gt;. Checked for border routing, mDNS/SRP service discovery, and the fact that link-local addresses are not forwarded across the boundary.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.home-assistant.io/integrations/matter/" rel="noopener noreferrer"&gt;Home Assistant: Official Matter Integration Documentation&lt;/a&gt;, particularly “Introduction” and “General recommendations.” Used to cross-check local control and IPv6 configuration requirements; Home Assistant-specific installation steps are not applied to every platform.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://developers.home.google.com/matter/primer/commissionable-and-operational-discovery?hl=en" rel="noopener noreferrer"&gt;Google Home Developers: Commissionable and Operational Discovery&lt;/a&gt;. Checked for the distinction between commissionable and operational discovery, DNS-SD, and Thread service registration proxies.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Originally published at &lt;a href="https://ay3s.com/en/articles/matter-ipv6-local-network/" rel="noopener noreferrer"&gt;ay3s.com&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>iot</category>
      <category>matter</category>
      <category>networking</category>
    </item>
    <item>
      <title>Why Can Adding More Bluetooth Mesh Relays Make the Network Slower?</title>
      <dc:creator>weiyi</dc:creator>
      <pubDate>Sat, 07 Nov 2026 01:19:02 +0000</pubDate>
      <link>https://dev.to/weiyi/why-can-adding-more-bluetooth-mesh-relays-make-the-network-slower-2ni9</link>
      <guid>https://dev.to/weiyi/why-can-adding-more-bluetooth-mesh-relays-make-the-network-slower-2ni9</guid>
      <description>&lt;p&gt;The light at the end of the corridor occasionally fails to respond, so you enable the relay function on a few nearby lights.&lt;/p&gt;

&lt;p&gt;It seems to help. You decide to enable it on every light that supports relaying and increase the retransmission count: “If it sends a few more times, surely the message won’t be missed?”&lt;/p&gt;

&lt;p&gt;But when you dim the whole group, the lights become sluggish again. Some react first, others later, and the status on your phone is still updating.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The problem may have shifted from “the message can’t get through” to “too much is being transmitted over the same shared radio channel.”&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Relays can add communication paths, but every forwarding transmission also consumes wireless resources. To decide whether to add more or use fewer, first determine what you lack: coverage, an alternate path, or relief from excessive duplicate traffic.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;The scenario above is hypothetical, not a record of measured results. This article discusses SIG Mesh networks that primarily use the advertising bearer and Managed Flooding; it does not represent every Bluetooth product implementation. No latency, capacity, or success rate has been measured for specific devices. The troubleshooting sequence is engineering guidance.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fas27irpn995fpet5alq4.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fas27irpn995fpet5alq4.png" alt="Relay placement and overlapping transmissions in offices and a corridor" width="799" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;AI-generated illustration. Radio arcs do not represent measured coverage, signal strength or actual routes.&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  1. A Relay Rebroadcasts a Message from Another Location; It Does Not “Max Out” the Signal
&lt;/h2&gt;

&lt;p&gt;Consider a simple path:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Wall switch → corridor relay → distant light.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The switch cannot reach the distant light directly, but a node in the corridor can receive the message and transmit it onward. That is where a relay helps: it carries a message across a segment it otherwise could not cross.&lt;/p&gt;

&lt;p&gt;It does not increase the switch’s transmit power or reserve a dedicated channel for the control command.&lt;/p&gt;

&lt;p&gt;If many nodes in the same room have Relay enabled, they may all receive a message that meets the forwarding conditions and each take part in forwarding it. Multiple paths can improve the chance of delivery, but they also mean more wireless transmissions.&lt;/p&gt;

&lt;p&gt;Both a Bluetooth SIG article on network design and Silicon Labs’ optimization documentation emphasize the same point: &lt;strong&gt;relays should have a deliberate location and purpose, rather than being enabled on every device that supports them.&lt;/strong&gt;[1][2]&lt;/p&gt;

&lt;p&gt;So before “adding one more relay,” ask:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Which previously unreliable link segment will it bridge?&lt;/li&gt;
&lt;li&gt;Will it provide an alternate path distinct from the existing nodes?&lt;/li&gt;
&lt;li&gt;Could it lose power along with the wall switch?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If you cannot answer those questions, you may mainly be adding duplicate transmissions rather than useful coverage.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. If Duplicate Packets Are Filtered, Why Does the Network Still Get Busy?
&lt;/h2&gt;

&lt;p&gt;A common misconception is: “Mesh filters duplicate packets, so having more relays doesn’t matter, right?”&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Filtering can stop a node from repeatedly processing a packet it has already seen, but it cannot undo radio transmissions other nodes have already made.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Suppose relays B and C both receive a message from A. On receiving it for the first time, each may meet the conditions for forwarding. D can later recognize the copies from B and C as duplicates, but both transmissions have already occurred.&lt;/p&gt;

&lt;p&gt;Two things must also be distinguished:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Receiving duplicate copies from other nodes should not cause a relay to start forwarding them indefinitely.&lt;/li&gt;
&lt;li&gt;A sender or relay may be configured to transmit multiple copies to improve reliability.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Mechanisms such as caches constrain the former; the latter is configured retransmission. There is no contradiction between them. The SIG primer identifies TTL and the message cache as mechanisms that constrain Managed Flooding; Silicon Labs’ documentation separately explains Network Transmit and Relay Retransmit settings.[2][3]&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What should you check first?&lt;/strong&gt; Do not rely solely on an application log showing that it “received one command.” A single application-layer delivery does not prove there was only one radio transmission. Use protocol-stack counters, transmit-queue records, and available packet-capture tools together to identify where the duplication occurs. A capture from one location may also miss packets and cannot be treated as a complete record of traffic across the network.&lt;/p&gt;

&lt;h2&gt;
  
  
  3. Do Not Call Four Different Controls “Boosting the Signal”
&lt;/h2&gt;

&lt;p&gt;When adjusting parameters on site, it is easy to lose track of cause and effect by adding relays, raising TTL, increasing retransmissions, and having the application retry more often all at once.&lt;/p&gt;

&lt;p&gt;These changes do different things:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Adjustment&lt;/th&gt;
&lt;th&gt;What it primarily changes&lt;/th&gt;
&lt;th&gt;What to confirm first&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Relay enablement and placement&lt;/td&gt;
&lt;td&gt;Which nodes participate in forwarding and where communication paths exist&lt;/td&gt;
&lt;td&gt;Is this filling a coverage gap or adding duplicate forwarding in an area already covered?&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;TTL&lt;/td&gt;
&lt;td&gt;How many hops a message is allowed to traverse&lt;/td&gt;
&lt;td&gt;Where are the target devices, and how far must the necessary alternate paths reach?&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Network Transmit / Relay Retransmit&lt;/td&gt;
&lt;td&gt;The number and spacing of network-layer copies sent by a source node or relay&lt;/td&gt;
&lt;td&gt;Does the current SDK field mean the number of retransmissions or the total number of transmissions?&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Model publishing, queries, and application retries&lt;/td&gt;
&lt;td&gt;How many business-layer messages are generated and when they are sent again&lt;/td&gt;
&lt;td&gt;Are there frequent reports, concentrated queries, or duplicate submissions?&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;TTL is particularly easy to misuse. It limits how far a message propagates; &lt;strong&gt;it is neither RF power nor a reliability percentage&lt;/strong&gt;. A message with a TTL of 0 will not be relayed, so it cannot reach a device that requires a relay hop.[3]&lt;/p&gt;

&lt;p&gt;But that does not mean TTL should always be set high. “The message can travel farther” does not mean “this particular light is more likely to receive it.” Unnecessary propagation can also add load in other areas.[1]&lt;/p&gt;

&lt;p&gt;A “3” in a configuration interface may mean three transmissions or three retransmissions. Whether the initial transmission is counted separately depends on the SDK interface and parameter encoding. &lt;strong&gt;Check the field’s meaning before copying someone else’s number.&lt;/strong&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  4. How Can You Tell Whether Coverage Is Insufficient or There Are Too Many Messages?
&lt;/h2&gt;

&lt;p&gt;Do not draw a conclusion from a single instance of “it worked just now.” Use the same devices, positions, and control actions for two sets of comparisons.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;First: Does the problem still occur consistently at distant devices under low load?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;In a test environment, retain the necessary control traffic while reducing background queries and reports that you can control. If distant devices remain repeatedly unreachable, and a targeted change to a relay’s position produces a clear improvement, coverage or path problems deserve priority.&lt;/p&gt;

&lt;p&gt;That is still not a diagnosis: antenna installation, obstructions, power supply, configuration errors, and other factors may also affect the result.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Second: With device positions unchanged, does the problem appear as traffic increases?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;A single on/off command works acceptably, but delays appear when frequent dimming, batch queries, or periodic reports begin. If reducing one category of traffic improves the behavior, investigate radio-channel load, protocol-stack queues, and gateway processing capacity before immediately adding another relay.&lt;/p&gt;

&lt;p&gt;Silicon Labs explicitly warns that publishing model messages too frequently increases network traffic and can slow responses.[2] But improvement after reducing the frequency only narrows the investigation; it does not, by itself, prove that every problem was caused by wireless collisions.&lt;/p&gt;

&lt;p&gt;There is another often-overlooked check: &lt;strong&gt;Is the light reacting slowly, or is its status returning slowly?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://ay3s.com/en/articles/bluetooth-mesh-group-control-status-retry/" rel="noopener noreferrer"&gt;The previous article&lt;/a&gt; distinguishes between acceptance by the sender, device model status, and the light actually turning on. Record them separately during optimization, or you may adjust a lighting control path that works fine because the interface refreshes slowly.&lt;/p&gt;

&lt;h2&gt;
  
  
  5. If You Do Tune the Network, Follow a Sequence That Preserves the Evidence
&lt;/h2&gt;

&lt;p&gt;The following is a practical integration-testing sequence, not a standard test prescribed by the protocol.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;First, save a baseline.&lt;/strong&gt; Record firmware and SDK versions, device positions, relay settings, TTL, network-layer retransmission settings, model publishing intervals, and the controller’s query and retry policies. Hide keys when exporting configurations. Without a baseline, it is hard to tell which change made things “better.”&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Next, assign a purpose to each relay.&lt;/strong&gt; Mark on a floor plan which nodes bridge rooms, which cover corridors, and which provide alternate coverage. Keep the nodes serving those purposes first, then evaluate relays with heavily overlapping coverage in batches. Do not turn off a large group at once, and do not use remote configuration to sever the only management path; arrange a way to restore service on site before testing.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Then change only one category of variables at a time.&lt;/strong&gt; Hold business traffic constant while comparing relay configurations; then hold the relay layout constant while comparing retransmission or publishing frequency. That makes the effects of each change assessable. There is no need to remove all reliability redundancy just to minimize transmissions.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Finally, test during busy periods and failures.&lt;/strong&gt; Being able to control the lights when the network is idle is only half the job. Also test under dimming, reporting, and query loads that reflect product requirements, and deliberately take a relay node offline and restore it.&lt;/p&gt;

&lt;p&gt;Keep at least these records for each round:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Record&lt;/th&gt;
&lt;th&gt;How to make it useful for comparison&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Test conditions&lt;/td&gt;
&lt;td&gt;Use the same positions, actions, load, and observation window; state exactly what changed this round&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Control results&lt;/td&gt;
&lt;td&gt;Record results by “target device × control action”; list unknown status separately rather than counting it as confirmed success&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Response time&lt;/td&gt;
&lt;td&gt;Specify the start and end points: request sent, model status returned, or actual change in illumination&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Slow responses and anomalies&lt;/td&gt;
&lt;td&gt;Keep the sample count, slower samples, and failure locations; do not report only the average&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Alternate paths&lt;/td&gt;
&lt;td&gt;Record which devices are affected when a key relay goes offline and whether they return to normal after it is restored&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Comparing the time at which lights actually change requires suitable on-site observation or measurement. Application logs cannot substitute for the physical result.&lt;/p&gt;

&lt;p&gt;The goal of this round is not to find the smallest-looking TTL or the fewest relays. &lt;strong&gt;The goal is to retain sufficiently reliable paths under normal load and agreed failure conditions while reducing unnecessary transmissions.&lt;/strong&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  6. Would Switching to Directed Forwarding Make These Concerns Go Away?
&lt;/h2&gt;

&lt;p&gt;Bluetooth Mesh also has an optional mechanism called Directed Forwarding. It allows nodes on a particular forwarding path to forward relevant messages, instead of involving every relay that meets the Managed Flooding conditions, thereby reducing unnecessary wireless transmissions.[3]&lt;/p&gt;

&lt;p&gt;But availability in the protocol does not mean the devices, SDK, and configuration tools you have support or enable it. Nor does it replace business-layer traffic design: if the application keeps generating new control messages, queries, and retries, you still need to check whether those messages are necessary.&lt;/p&gt;

&lt;p&gt;For an existing project, a more practical first step is to list the features and parameters actually in use, then decide whether introducing a new mechanism is worthwhile. Do not treat a protocol-version upgrade as the answer before identifying the bottleneck.&lt;/p&gt;

&lt;p&gt;The next time a distant device occasionally fails to respond, do not enable every relay right away.&lt;/p&gt;

&lt;p&gt;First answer one question: &lt;strong&gt;Which part of the path will this additional relay bridge?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;If the problem appears only when the network is busy, ask another: &lt;strong&gt;Which messages on this network do not need to be sent so many times?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Further reading: &lt;a href="https://ay3s.com/en/articles/bluetooth-mesh-custom-broadcast-multihop-design/" rel="noopener noreferrer"&gt;What It Takes to Move from Broadcasting to Multiple Hops&lt;/a&gt; · &lt;a href="https://ay3s.com/en/articles/bluetooth-mesh-low-power-node-friend-battery/" rel="noopener noreferrer"&gt;Why Battery-Powered Nodes Wait for Downlink Messages&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  References and Scope
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;a href="https://www.bluetooth.com/blog/mesh-in-large-scale-networks/" rel="noopener noreferrer"&gt;Bluetooth SIG: How Bluetooth Mesh Networking puts the ‘large’ in large-scale wireless networks&lt;/a&gt;, 2018-06-26. This article draws on the design principles in its Relays, TTL, and Network retransmissions sections; it does not use their example network sizes, retransmission intervals, or traffic multipliers as product metrics.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://docs.silabs.com/btmesh/11.0.2/btmesh-network-optimization/03-bluetooth-mesh-networking-principles" rel="noopener noreferrer"&gt;Silicon Labs: Bluetooth Mesh Networking Principles, 11.0.2&lt;/a&gt;. Used to check relay density, publishing frequency, and network-layer transmission settings; consult the target SDK for specific interfaces and parameter values.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.bluetooth.com/bluetooth-mesh-networking-primer/" rel="noopener noreferrer"&gt;Bluetooth SIG: The Bluetooth Mesh Networking primer&lt;/a&gt;. Sections 4.18.1, 4.19.2, and 4.19.3 are particularly relevant to TTL, caching, Managed Flooding, and Directed Forwarding.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Sources checked: 2026-11-06. No hardware testing was performed for this article. It provides no universal best settings, fixed node-capacity figure, or promise of performance improvement.&lt;/p&gt;

&lt;p&gt;Originally published at &lt;a href="https://ay3s.com/en/articles/bluetooth-mesh-relay-density-network-tuning/" rel="noopener noreferrer"&gt;ay3s.com&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>iot</category>
      <category>bluetooth</category>
      <category>embedded</category>
    </item>
    <item>
      <title>Bluetooth Mesh Group Control: One Light Stayed Off—Should You Resend to Everyone?</title>
      <dc:creator>weiyi</dc:creator>
      <pubDate>Sat, 07 Nov 2026 01:18:44 +0000</pubDate>
      <link>https://dev.to/weiyi/bluetooth-mesh-group-control-one-light-stayed-off-should-you-resend-to-everyone-2oop</link>
      <guid>https://dev.to/weiyi/bluetooth-mesh-group-control-one-light-stayed-off-should-you-resend-to-everyone-2oop</guid>
      <description>&lt;p&gt;Imagine pressing “all lights on” in a meeting room. Most lights come on, but one in the corner does nothing. Your phone nevertheless says “sent successfully.”&lt;/p&gt;

&lt;p&gt;You press it again. Everything lights up this time—but will someone have to look up and check after every group operation?&lt;/p&gt;

&lt;p&gt;The obvious solution is to make every light say “received” and resend whenever a reply is missing. &lt;strong&gt;That provides more feedback, but simultaneous replies and repeated questions can themselves become a network burden.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The short answer: do not automatically resend to the entire group because feedback is missing. Separate three questions: was the command sent, what state did the device report, and did the light physically turn on? Those are different kinds of evidence.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;This meeting room is a hypothetical example, not a field test. This article covers SIG Mesh multicast and model messages, not the implementation of products such as Mijia. No success rates, latency or node capacities were measured. State tracking and compensation below are engineering suggestions, not a complete feature automatically supplied by the protocol.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  1. How far does “sent successfully” actually go?
&lt;/h2&gt;

&lt;p&gt;The message on the phone might mean only that an application handed a request to a gateway, or that a module accepted a transmission task. Check the interface and logs rather than guessing from the label.&lt;/p&gt;

&lt;p&gt;Separate the evidence into three layers:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The sender accepted a task.&lt;/strong&gt; This proves progress at a sending stage, not receipt at the target light.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;A target model reported its state.&lt;/strong&gt; Generic OnOff Status, for example, reports the corresponding element's Generic OnOff state. Identify the source and distinguish the present value, target value and remaining transition time where applicable.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The physical lighting meets the requirement.&lt;/strong&gt; This also involves the driver, supply, light source and site conditions. A model saying “on” is not independent optical sensing and cannot rule out a failed driver or LED.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fih6cqtzeqcuwyl6wsh1m.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fih6cqtzeqcuwyl6wsh1m.png" alt="Three evidence layers: sender acceptance, model state and physical lighting need different checks" width="800" height="741"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;These layers do not require three confirmations for every operation. They mean that &lt;strong&gt;the evidence should support exactly what the interface claims&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Check first:&lt;/strong&gt; find the code or interface definition behind the success message. Does it represent queuing, a module result or target-state feedback? Without that definition, even your success-rate statistics may start from the wrong premise.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. A group command is not a signed receipt from every member
&lt;/h2&gt;

&lt;p&gt;SIG Mesh commonly uses publish–subscribe for group control: a switch sends to a group address, and relevant models on lights subscribe to it. This is closer to addressing the meeting room once than calling every light individually.&lt;/p&gt;

&lt;p&gt;It avoids sending the same intent separately to every device. But a group address does not generate a complete list of members that executed it.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The management side must know the expected members.&lt;/strong&gt; Was the new light's model subscription configured? Is a replaced device still in the old inventory? A handful of received statuses cannot reconstruct that inventory reliably.&lt;/p&gt;

&lt;p&gt;Nor does the number of packets equal the number of completed lights. Match expected elements and models; duplicate messages from one source are not additional completed devices.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Check first:&lt;/strong&gt; compare installation records with model configuration, AppKey binding and group subscriptions. If one light consistently fails, check whether it belongs to this control group before increasing every relay and retransmission setting.&lt;/p&gt;

&lt;h2&gt;
  
  
  3. Wouldn't replies from every light be more reliable?
&lt;/h2&gt;

&lt;p&gt;Using Generic OnOff as an example:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Generic OnOff Set&lt;/strong&gt; is acknowledged; its response is Generic OnOff Status.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Generic OnOff Set Unacknowledged&lt;/strong&gt; does not require a model response to that request.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This is a &lt;strong&gt;model-layer response&lt;/strong&gt;, not a single generic “ACK” covering lower-layer transport acknowledgements, gateway API replies and physical execution.&lt;/p&gt;

&lt;p&gt;Waiting for a corresponding response can be useful for one-to-one operations. But if many nodes respond to one group command, radio use is no longer just one command.&lt;/p&gt;

&lt;p&gt;Bluetooth SIG's scaling article discusses how multicast replies combined with further queries and retries can create a dense message stream. It highlights unacknowledged multicast control rather than assuming every operation needs a roll call.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;That does not mean unacknowledged messages guarantee delivery, or that acknowledged group control is prohibited.&lt;/strong&gt; It means budgeting both control and confirmation traffic according to the application. More replies do not automatically mean more reliability.&lt;/p&gt;

&lt;p&gt;Not requiring a response to this request also does not mean a device never reports its state. State publication and request responses are separate configurations and behaviors to inspect.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Check first:&lt;/strong&gt; list the message being sent, the response the controller expects, and configured state publications. Only then decide on retries.&lt;/p&gt;

&lt;h2&gt;
  
  
  4. Missing state should first mean “unknown,” not “failed”
&lt;/h2&gt;

&lt;p&gt;Missing feedback can mean that the command never arrived, that execution succeeded but the return path failed, that a transition is ongoing, or that the controller confused an old report with a new result. A reply/no-reply flag cannot distinguish them.&lt;/p&gt;

&lt;p&gt;Consider more honest application labels:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Requested:&lt;/strong&gt; the intent was submitted, without sufficient target evidence yet.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;State confirmed:&lt;/strong&gt; model state meeting this operation's criteria was received, with source and time recorded.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Needs verification:&lt;/strong&gt; sufficient evidence was not obtained within the agreed observation window.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;These are application design suggestions, not additional standard Mesh states.&lt;/p&gt;

&lt;p&gt;Confirmation should not last forever. A wall switch, sensor or automation may change the device later. Show the last confirmation time instead of displaying yesterday's “on” as live state.&lt;/p&gt;

&lt;p&gt;Also, &lt;strong&gt;Generic OnOff Status does not carry the TID from Set&lt;/strong&gt;. Do not assume response transaction IDs provide one-to-one correlation. With rapid commands, publications and multiple controllers, evaluate source, value, reception time and application context. A recently received “on” alone does not prove the current operation completed.&lt;/p&gt;

&lt;h2&gt;
  
  
  5. Why not keep resending to the entire group?
&lt;/h2&gt;

&lt;p&gt;A repeat may recover a lost command, but it costs resources. Most devices may already have completed the operation. Repeating also cannot repair missing subscriptions, disconnected power or driver failures.&lt;/p&gt;

&lt;p&gt;A more controlled direction is: &lt;strong&gt;send the group command, observe feedback, rate-limit checks of a small set of uncertain members when necessary, and apply bounded compensation only where justified.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Do not turn this into querying every device immediately after each group operation. That merely shifts the same traffic. Test the scope, pacing, deadline and maximum attempts against the deployment size and required response time.&lt;/p&gt;

&lt;p&gt;Retries must follow the model's transaction rules. TID in Generic OnOff Set distinguishes a new transaction from retransmission of the same transaction. Do not arbitrarily increment it on every retry, or keep reusing an old value for independent operations. Consult the applicable specification and SDK for complete windows and matching rules; no universal retry interval is proposed here.&lt;/p&gt;

&lt;p&gt;Before compensation, ask whether the user has issued a newer intent. If “off” is followed by compensation for the previous “on,” old work is interfering with new work—not improving reliability.&lt;/p&gt;

&lt;h2&gt;
  
  
  6. Take this checklist to integration testing
&lt;/h2&gt;

&lt;p&gt;This is troubleshooting guidance, not certification or a validated default product policy.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Observation&lt;/th&gt;
&lt;th&gt;Check first&lt;/th&gt;
&lt;th&gt;Avoid assuming&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;UI says success; one light stays off&lt;/td&gt;
&lt;td&gt;Meaning of success, subscriptions, power&lt;/td&gt;
&lt;td&gt;All devices are guaranteed to have executed&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Light is on; UI says failure&lt;/td&gt;
&lt;td&gt;State return path, reception handling, observation window&lt;/td&gt;
&lt;td&gt;Missing feedback proves no execution&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Individual control works; group control sometimes fails&lt;/td&gt;
&lt;td&gt;Group setup, response/publication traffic, concurrent load&lt;/td&gt;
&lt;td&gt;More repeats must improve reliability&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;State is “on”; physical light is dark&lt;/td&gt;
&lt;td&gt;State semantics, transitions, driver and light source&lt;/td&gt;
&lt;td&gt;Software state equals optical acceptance&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;State oscillates after rapid on/off&lt;/td&gt;
&lt;td&gt;Report age, other controllers, old compensation tasks&lt;/td&gt;
&lt;td&gt;The last arriving message is the newest state&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;One device never provides feedback&lt;/td&gt;
&lt;td&gt;Inventory, model, key binding, subscription, power, coverage&lt;/td&gt;
&lt;td&gt;Whole-group retries must fix it&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Keep sender results, model state and physical observations as separate records. Use consistent samples, observation windows and expected membership; do not combine three different criteria into one “success rate.”&lt;/p&gt;

&lt;p&gt;Log SDK version, message type, source, destination, time and relevant settings. Mask identities as needed; never publish NetKey, AppKey, DevKey or customer information.&lt;/p&gt;

&lt;p&gt;In an isolated test environment, also try individual power loss, rapid operations and concurrent normal traffic. Observe how uncertainty is displayed, how retries stop and whether recovery executes obsolete tasks. Do not inject failures into public lighting or safety-related systems.&lt;/p&gt;

&lt;h2&gt;
  
  
  7. Reliability is more than “eventually all the lights came on”
&lt;/h2&gt;

&lt;p&gt;The single “all on” button hides three problems: &lt;strong&gt;send efficiently, know what evidence you have, and recover from uncertainty without making things worse.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Not every operation needs a complete roll call. But missing feedback must not be marketed as 100% success either.&lt;/p&gt;

&lt;p&gt;Before asking how many repeats are best, define expected members, completion evidence, waiting limits and how a newer instruction cancels obsolete work. Then the dark light in the corner becomes something you can diagnose—not merely a reason to press the button again.&lt;/p&gt;

&lt;p&gt;Further reading: &lt;a href="https://ay3s.com/en/articles/bluetooth-mesh-provisioning-appkey-model-binding/" rel="noopener noreferrer"&gt;provisioning and model binding&lt;/a&gt;, &lt;a href="https://ay3s.com/en/articles/bluetooth-mesh-selection-validation-checklist/" rel="noopener noreferrer"&gt;selection and acceptance checklist&lt;/a&gt; and &lt;a href="https://ay3s.com/en/articles/bluetooth-mesh-low-power-node-friend-battery/" rel="noopener noreferrer"&gt;battery-node reception&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Sources and scope
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://www.bluetooth.com/wp-content/uploads/Files/Specification/HTML/MMDL_v1.1/out/en/index-en.html" rel="noopener noreferrer"&gt;Bluetooth SIG: Mesh Model v1.1&lt;/a&gt;, especially 3.2.1, for Set, Set Unacknowledged, Status, TID and transition fields. Check the specification and SDK adopted by the product.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.bluetooth.com/blog/mesh-in-large-scale-networks/" rel="noopener noreferrer"&gt;Bluetooth SIG: Mesh in large-scale networks&lt;/a&gt;, 2018-06-26, for shared radio capacity and multicast response load. Historical examples and parameters are not current product performance claims.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://docs.silabs.com/btmesh/11.0.1/btmesh-sdk6-or-higher-lighting-demo/" rel="noopener noreferrer"&gt;Silicon Labs: Lighting Demonstration, 11.0.1&lt;/a&gt;, for publish–subscribe and group control, not universal vendor behavior.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Sources checked on 2026-11-06. This is mechanism analysis and engineering guidance, without hardware or field performance testing.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;The cover is an AI-generated illustration of meeting-room group lighting, not a photograph of a field test.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Originally published at &lt;a href="https://ay3s.com/en/articles/bluetooth-mesh-group-control-status-retry/" rel="noopener noreferrer"&gt;ay3s.com&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>iot</category>
      <category>bluetooth</category>
      <category>embedded</category>
    </item>
    <item>
      <title>Bluetooth Mesh Battery Devices: Why Can They Report Promptly but Not Receive Control Immediately?</title>
      <dc:creator>weiyi</dc:creator>
      <pubDate>Sat, 07 Nov 2026 01:18:25 +0000</pubDate>
      <link>https://dev.to/weiyi/bluetooth-mesh-battery-devices-why-can-they-report-promptly-but-not-receive-control-immediately-4mih</link>
      <guid>https://dev.to/weiyi/bluetooth-mesh-battery-devices-why-can-they-report-promptly-but-not-receive-control-immediately-4mih</guid>
      <description>&lt;p&gt;Imagine a battery-powered door sensor: opening the door quickly produces a phone notification, but changing its settings from the phone takes a while to take effect.&lt;/p&gt;

&lt;p&gt;Why can the same device be quick to report, yet slower to receive?&lt;/p&gt;

&lt;p&gt;It is not necessarily poor reception or a stuck program. &lt;strong&gt;A Bluetooth Mesh device using low-power mechanisms may follow different schedules for transmitting and receiving.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Here is the short answer: a local event can wake a device to transmit, while messages sent to it during sleep may be stored by a Friend until it requests them. Diagnose the delay by separating those paths.&lt;/p&gt;

&lt;p&gt;This article explains how devices reduce listening, how a Friend stores messages, and how to check whether energy saving affects the response your application needs.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;The door sensor is a hypothetical example, not a measurement. This discussion concerns SIG Mesh Low Power and Friend mechanisms. Check your SDK, board and platform separately; no battery-life or latency tests were performed.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  1. Start with the diagram: transmitting is not always-on reception
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fa09t7hnootui8bvhfzv0.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fa09t7hnootui8bvhfzv0.png" alt="Two paths for a battery Mesh node: local events can trigger transmission, while downlink messages are stored by a Friend and retrieved with Friend Poll" width="800" height="1133"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Think of someone who does not constantly watch a mailbox. They can go out to deliver a letter when necessary; incoming letters can be held by a neighbor until collected.&lt;/p&gt;

&lt;p&gt;That neighbor is the &lt;strong&gt;Friend&lt;/strong&gt;; the device using the Low Power feature is a &lt;strong&gt;Low Power Node, or LPN&lt;/strong&gt;. This analogy explains reception scheduling, not guaranteed delivery or a Friend's ability to wake a sleeping chip remotely.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Check first:&lt;/strong&gt; draw separate paths for event reporting and remote configuration. The phone side may include a gateway, cloud and caches; do not assign every delay to Mesh radio communication.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. Why can a button transmit while a settings change waits?
&lt;/h2&gt;

&lt;p&gt;Silicon Labs documents that an LPN can transmit without waiting for the next message poll. Whether a button or door event wakes it promptly depends on hardware and application design.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Local event:&lt;/strong&gt; event → wake and process → transmit → destination processing.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Downlink:&lt;/strong&gt; message reaches Friend → waits for retrieval → LPN receives and processes → reports the result if needed.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Not waiting for a poll &lt;strong&gt;does not guarantee fast end-to-end delivery&lt;/strong&gt;. Sampling, retries and upper-layer processing still matter. Slow downlink likewise does not prove every outbound event is slow. A prompt door-open report cannot justify an immediate-configuration promise.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Check first:&lt;/strong&gt; record the event, transmission, Friend queueing, LPN retrieval and actual application of the setting. Do not subtract timestamps from unsynchronized devices.&lt;/p&gt;

&lt;h2&gt;
  
  
  3. Why does saving power require more than fewer transmissions?
&lt;/h2&gt;

&lt;p&gt;A sensor that rarely reports may still consume substantial energy if its receiver stays on.&lt;/p&gt;

&lt;p&gt;Bluetooth SIG describes Low Power primarily in terms of reduced receiver duty cycle. After establishing friendship, an LPN can reduce continuous listening, letting its Friend store eligible messages for later retrieval.&lt;/p&gt;

&lt;p&gt;The Friend is not an unlimited mailbox. Supported LPNs, buffered messages and subscriptions depend on implementation and resources. Backlogs, retries and repeated friendship establishment can increase consumption.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Check first:&lt;/strong&gt; identify what the current trace represents—sampling, scanning, transmitting, retrieving messages or searching for a Friend. A datasheet's minimum sleep current is not the whole product's consumption.&lt;/p&gt;

&lt;h2&gt;
  
  
  4. Does increasing PollTimeout save more power?
&lt;/h2&gt;

&lt;p&gt;Not necessarily. Separate how often the device collects messages from how long a friendship may remain without qualifying contact.&lt;/p&gt;

&lt;p&gt;The &lt;strong&gt;actual polling interval&lt;/strong&gt; depends on stack and application scheduling. Additional queued messages may cause further polls.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;PollTimeout&lt;/strong&gt; is a friendship maintenance timeout. A Friend may end the relationship when the required requests do not arrive in time. It is not an application wake-up timer or a measured downlink latency.&lt;/p&gt;

&lt;p&gt;ReceiveDelay concerns the wait between an LPN request and the start of listening; ReceiveWindow concerns the reception window. Neither is automatically a business-operation period.&lt;/p&gt;

&lt;p&gt;Less frequent retrieval usually makes some downlink messages wait longer. Queueing, retries and execution also matter, so a single parameter cannot guarantee a maximum delivery time.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Check first:&lt;/strong&gt; compare application polling policy, maintenance parameters and observed timing, rather than treating a timeout field as the only control.&lt;/p&gt;

&lt;h2&gt;
  
  
  5. Why might switching a light off make a sensor consume more?
&lt;/h2&gt;

&lt;p&gt;Suppose a light supporting Friend serves a battery node, but a mechanical switch removes its power. The old receive relationship can no longer work normally.&lt;/p&gt;

&lt;p&gt;Silicon Labs notes that restarting either Friend or LPN requires re-establishment. Marginal signals that repeatedly break friendship also increase energy use. Searching in a tight loop is not a power-saving strategy; design backoff and recovery for your implementation.&lt;/p&gt;

&lt;p&gt;Location matters too. Bluetooth SIG's introductory article says Friend Request is not relayed. Multihop application traffic does not mean an LPN can discover a Friend an arbitrary number of hops away.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Friend, Relay and application gateway are different roles.&lt;/strong&gt; Relaying does not imply message storage for LPNs, and a product called a gateway need not expose Friend support. Do not assume a battery node should continuously relay for others.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Check first:&lt;/strong&gt; verify candidate features, direct reachability and power habits, then test outages. Do not assume old queues migrate or Friend changes are seamless.&lt;/p&gt;

&lt;h2&gt;
  
  
  6. Measure average product current before predicting battery life
&lt;/h2&gt;

&lt;p&gt;The whole product stands between a low-power mode and a lifetime claim. Sensors, regulators, LEDs, debuggers and logging can all affect consumption. Include sampling, user actions, reporting, retrieval, retries and discovery in the workload.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Average current ≈ sum of each state's current × duration ÷ total observation time.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Using a consistent battery-side basis, &lt;strong&gt;usable capacity (mAh) ÷ average current (mA) ≈ operating hours&lt;/strong&gt;. With voltage conversion, account for efficiency or use consistent energy units; do not mix parameters from opposite sides of a converter.&lt;/p&gt;

&lt;p&gt;This is still not a guarantee. Temperature, aging, self-discharge, pulse capability and cutoff voltage affect usable capacity.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Check first:&lt;/strong&gt; measure steady operation and fault recovery separately. A brief idle trace after provisioning under good reception does not represent an entire use cycle. At low charge, examine voltage dips and communication failures too.&lt;/p&gt;

&lt;h2&gt;
  
  
  7. Keep this checklist for prototype testing
&lt;/h2&gt;

&lt;p&gt;These are engineering checks, not certification tests. Use an isolated environment and agree workload, acceptable waiting and success criteria before measuring.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Symptom&lt;/th&gt;
&lt;th&gt;Check first&lt;/th&gt;
&lt;th&gt;Do not jump to this conclusion&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Reporting works, but setting changes wait&lt;/td&gt;
&lt;td&gt;Both paths, polling, queueing and application time&lt;/td&gt;
&lt;td&gt;Radio reception must be poor&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Sleep current is low, but the product drains its battery&lt;/td&gt;
&lt;td&gt;Sampling, listening, sending, retries and peripherals&lt;/td&gt;
&lt;td&gt;A new battery or chip will solve it&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Behavior changes after Friend power loss&lt;/td&gt;
&lt;td&gt;Lost friendship, backoff, re-establishment and recovery&lt;/td&gt;
&lt;td&gt;Queues migrate and switching is seamless&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Rapid setting changes produce unexpected results&lt;/td&gt;
&lt;td&gt;Queue limits, application handling and final state&lt;/td&gt;
&lt;td&gt;Every historical command is retained forever&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Some group messages are missed&lt;/td&gt;
&lt;td&gt;Model and Friend subscription lists, traffic&lt;/td&gt;
&lt;td&gt;Multicast guarantees success for every node&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Intermittent failures at low charge&lt;/td&gt;
&lt;td&gt;Voltage during transmission, supply capability, recovery&lt;/td&gt;
&lt;td&gt;All nominal capacity is usable&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Record board, SDK, parameters, layout and observation window. Pseudonymize device identities; do not publish NetKey, AppKey, DevKey or device private keys.&lt;/p&gt;

&lt;p&gt;For selection, start with three questions:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Mostly occasional outbound events?&lt;/strong&gt; Evaluate LPN and Friend, but measure the real workload.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Timely inbound commands required?&lt;/strong&gt; Agree acceptable waiting, then validate reception policy against battery budget.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Long standby, immediate reception and continuous relaying all required?&lt;/strong&gt; Check that the objectives are compatible before promising battery life.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The useful question is not simply whether Bluetooth Mesh supports batteries. It is: &lt;strong&gt;when does the device wake, what does it do, and what happens when messages cannot currently be received?&lt;/strong&gt; Answer these before estimating lifetime.&lt;/p&gt;

&lt;p&gt;Further reading: &lt;a href="https://ay3s.com/en/articles/bluetooth-mesh-selection-validation-checklist/" rel="noopener noreferrer"&gt;Bluetooth Mesh selection and acceptance checklist&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Sources and scope
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://www.bluetooth.com/blog/bluetooth-mesh-networking-series-friendship/" rel="noopener noreferrer"&gt;Bluetooth SIG: Bluetooth Mesh Networking: Friendship&lt;/a&gt;, August 24, 2017. Historical introductory material for basic mechanisms, not a replacement for your current specification version.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://docs.silabs.com/btmesh/11.0.1/btmesh-power-consumption-measurements/01-bluetooth-mesh-node-power-consumption" rel="noopener noreferrer"&gt;Silicon Labs: Bluetooth Mesh Node Power Consumption, 11.0.1&lt;/a&gt;. Outbound transmission, receive windows, friendship recovery and consumption guidance; use your actual SDK.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Sources checked November 6, 2026. This is document analysis and engineering guidance, not a first-hand test report or a verified guarantee of lifetime, latency or capacity.&lt;/p&gt;

&lt;p&gt;Cover: &lt;a href="https://commons.wikimedia.org/wiki/File:Tapo_smart_LED_bulb_lighting_sample.jpg" rel="noopener noreferrer"&gt;Japanwikisan&lt;/a&gt;, &lt;a href="https://creativecommons.org/licenses/by/4.0/" rel="noopener noreferrer"&gt;CC BY 4.0&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Originally published at &lt;a href="https://ay3s.com/en/articles/bluetooth-mesh-low-power-node-friend-battery/" rel="noopener noreferrer"&gt;ay3s.com&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>iot</category>
      <category>bluetooth</category>
      <category>embedded</category>
    </item>
    <item>
      <title>How to Choose Bluetooth Mesh: Validate the Design with a Lighting Acceptance Checklist</title>
      <dc:creator>weiyi</dc:creator>
      <pubDate>Sat, 07 Nov 2026 01:18:06 +0000</pubDate>
      <link>https://dev.to/weiyi/how-to-choose-bluetooth-mesh-validate-the-design-with-a-lighting-acceptance-checklist-389o</link>
      <guid>https://dev.to/weiyi/how-to-choose-bluetooth-mesh-validate-the-design-with-a-lighting-acceptance-checklist-389o</guid>
      <description>&lt;p&gt;The first four articles covered &lt;a href="https://ay3s.com/en/articles/bluetooth-mesh-private-sig-xiaomi-comparison/" rel="noopener noreferrer"&gt;how the approaches relate&lt;/a&gt;, &lt;a href="https://ay3s.com/en/articles/bluetooth-mesh-custom-broadcast-multihop-design/" rel="noopener noreferrer"&gt;turning custom broadcasts into multihop networking&lt;/a&gt;, &lt;a href="https://ay3s.com/en/articles/bluetooth-mesh-provisioning-appkey-model-binding/" rel="noopener noreferrer"&gt;SIG Mesh provisioning and model binding&lt;/a&gt;, and &lt;a href="https://ay3s.com/en/articles/xiaomi-mesh-sig-mesh-mijia-integration-boundaries/" rel="noopener noreferrer"&gt;why SIG Mesh support does not guarantee Mi Home integration&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;When it is time to choose, the question returns: which approach should we use? First replace that broad question with a concrete one: &lt;strong&gt;can this implementation reliably perform the actions users need in the space we plan to deliver?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Some projects only need a wall switch, some require Mi Home, and others need a custom gateway bridging devices to Matter. A generic protocol comparison cannot decide all three.&lt;/p&gt;

&lt;p&gt;This article uses lighting in a meeting room and adjacent corridor as a hypothetical example. The room, devices and failures are design scenarios, not completed field tests. The checklist is engineering guidance, not certification testing or a guarantee of performance.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F1b2gcek7rnb7m7tm489s.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F1b2gcek7rnb7m7tm489s.png" alt="Bluetooth Mesh: validate before promising" width="800" height="607"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  1. Write user actions before protocol names
&lt;/h2&gt;

&lt;p&gt;Suppose users want one press to operate the whole lighting group, basic lighting during an internet outage, and a phone display that does not remain inconsistent with the lights. Clarify each requirement:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Does “offline” mean losing internet access, or also powering down the router and gateway?&lt;/li&gt;
&lt;li&gt;Must every light eventually respond, or must the interval between the first and last be imperceptible?&lt;/li&gt;
&lt;li&gt;Does “correct state” mean firmware accepted a command, or that the driver or a sensor confirmed physical output?&lt;/li&gt;
&lt;li&gt;Must phone control use Mi Home, or is a custom app acceptable?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If Mi Home is mandatory, the supported product category, onboarding process and target gateway are constraints to check before developing the wireless layer. With a custom gateway, establish access to device protocols, key management and local interfaces early.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Filter by ecosystem requirements first; validate performance second.&lt;/strong&gt; Reversing that order can turn a successful development-board demonstration into an unsupported delivery promise.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. Choose by responsibility boundaries, not protocol rankings
&lt;/h2&gt;

&lt;p&gt;Custom Mesh, SIG Mesh and Xiaomi Mesh are not three equivalent standards. Custom networking comprises design choices; SIG Mesh defines standardized networking and models; Xiaomi integration also involves product identity, function definitions and platform processes.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Main project objective&lt;/th&gt;
&lt;th&gt;Route to evaluate&lt;/th&gt;
&lt;th&gt;Evidence needed early&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Maintain both endpoints yourself, with a narrow feature scope&lt;/td&gt;
&lt;td&gt;A custom implementation can be considered&lt;/td&gt;
&lt;td&gt;Defined messages, security, provisioning, compatibility and maintenance ownership, with reproducible validation&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Manage multiple device types through a custom gateway and reuse standard models&lt;/td&gt;
&lt;td&gt;A specific SIG Mesh chipset and SDK implementation&lt;/td&gt;
&lt;td&gt;Matching elements, models, optional features, provisioning and key management—not merely a standards label&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Deliver through Mi Home and a supported gateway&lt;/td&gt;
&lt;td&gt;Xiaomi's currently supported integration route&lt;/td&gt;
&lt;td&gt;Supported category, product identity, platform template, firmware and target-gateway compatibility&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;These routes need not be mutually exclusive, but combining them does not automatically combine their benefits. Choosing a standard is not a completed cross-vendor interoperability test; choosing an ecosystem does not guarantee every offline operation.&lt;/p&gt;

&lt;p&gt;Bluetooth SIG's primer explains models, publish/subscribe and multihop communication. Xiaomi documentation additionally describes gateway conversion, cloud message paths and product templates. Support at one layer is not proof of support at another.&lt;/p&gt;

&lt;h2&gt;
  
  
  3. Split “works offline” into three tests
&lt;/h2&gt;

&lt;p&gt;Draw the path of each action. A wall switch might send Mesh messages directly, or notify a host that forwards them. Removing the gateway has different consequences for each design.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Disconnect the internet while local equipment keeps running.&lt;/strong&gt; Test the wall switch, phone control and configured automations separately, recording cloud dependencies.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Stop the gateway while preserving other equipment and networking.&lt;/strong&gt; Determine which operations truly happen between devices. Do not report this as merely an internet-outage test.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Power down a relay node.&lt;/strong&gt; Observe reachability of distant lights and behavior after power returns, provided the deployment actually contains a relay-dependent path.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;SIG Mesh mechanisms allow models to exchange messages without requiring every business action to pass through a cloud service. Whether a product implements that behavior depends on its models, configuration and application.&lt;/p&gt;

&lt;p&gt;Xiaomi's current BLE Mesh fundamentals documentation distinguishes gateway communication, direct phone access and relaying. It says the non-low-power devices described can relay messages but cannot control each other. &lt;strong&gt;Forwarding packets is not the same as independently implementing a wall-switch-to-light action.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Write “this switch still controlled this group with the internet disconnected,” rather than simply “supports offline operation.”&lt;/p&gt;

&lt;h2&gt;
  
  
  4. One working light does not validate group control
&lt;/h2&gt;

&lt;p&gt;A nearby light responding only demonstrates a simple path. Groups add relaying, retransmissions, reporting and radio-environment effects.&lt;/p&gt;

&lt;p&gt;Silicon Labs warns that excessive relays, high publication rates and unsuitable retransmission settings increase traffic and can impair operation. More relays and denser retransmissions are not automatically more reliable.&lt;/p&gt;

&lt;p&gt;For each group action, observe at least:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Whether &lt;strong&gt;every target light&lt;/strong&gt; reaches the requested state within the agreed observation window.&lt;/li&gt;
&lt;li&gt;The interval between the first and last light reaching that state.&lt;/li&gt;
&lt;li&gt;When the controller has sufficient state evidence, and whether it falsely marks nonresponding nodes as successful.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;One reply cannot prove success for an entire group. With unacknowledged messages, judge results using test observation or subsequent state checks, not the absence of an error.&lt;/p&gt;

&lt;p&gt;Establish a baseline in normal positions, then add devices and background traffic, then vary relay placement. Change one factor at a time where possible. Record firmware, configuration, power, distance, walls and interference so different “latency tests” remain comparable.&lt;/p&gt;

&lt;h2&gt;
  
  
  5. Separate command replies, device state and physical output
&lt;/h2&gt;

&lt;p&gt;As discussed in article four, Xiaomi describes server–gateway–device communication as asynchronous. An immediate gateway reply does not establish device execution; properties may also be cached or filtered before reporting.&lt;/p&gt;

&lt;p&gt;Custom systems can make the same mistake. A successful serial write, SDK return, remote model status and visible light output are distinct evidence.&lt;/p&gt;

&lt;p&gt;For prototype acceptance, correlate logs with fixed-camera video: record action initiation, host submission and device reports, then observe physical changes. A light sensor can add measurement if available. If only firmware state is available, label it “protocol state,” not verified physical load feedback.&lt;/p&gt;

&lt;p&gt;Do not subtract timestamps from unsynchronized devices and call the result end-to-end latency. Use a common acquisition clock or establish and document synchronization first.&lt;/p&gt;

&lt;h2&gt;
  
  
  6. Recovery and replacement expose maintenance costs
&lt;/h2&gt;

&lt;p&gt;Provisioning is the start of maintenance, not its completion. Check:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Whether addresses, keys and model configuration remain consistent when the host and radio module restart independently.&lt;/li&gt;
&lt;li&gt;Whether interrupted configuration resumes, rechecks or repeats after power loss, with intelligible results.&lt;/li&gt;
&lt;li&gt;How the old identity is removed and a replacement joins existing application groups.&lt;/li&gt;
&lt;li&gt;What configuration backups contain, their restoration dependencies, and how sensitive information is protected.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Test restoration in an isolated environment, checking sequence numbers, replay protection and persistence requirements in chipset and SDK documentation. Do not casually clone an entire storage image onto another device. Platform identity and certificate data must follow supplier-supported handling; a full-chip erase is not a universal recovery procedure.&lt;/p&gt;

&lt;p&gt;Use pseudonymous device identifiers in shared reports. Do not include NetKey, AppKey, DevKey or device private keys.&lt;/p&gt;

&lt;h2&gt;
  
  
  7. Deliver a conclusion with explicit conditions
&lt;/h2&gt;

&lt;p&gt;Use the following table to organize prototype tests. &lt;strong&gt;Agree thresholds before testing, rather than changing the pass mark after seeing results.&lt;/strong&gt; This is not evidence of Bluetooth certification.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Test&lt;/th&gt;
&lt;th&gt;Agree beforehand&lt;/th&gt;
&lt;th&gt;Record at minimum&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Individual and group control&lt;/td&gt;
&lt;td&gt;Targets, observation window, success definition&lt;/td&gt;
&lt;td&gt;Attempts, per-light results, timeouts and retries&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Control experience&lt;/td&gt;
&lt;td&gt;Timing method, deadline, allowed group skew&lt;/td&gt;
&lt;td&gt;Typical and slow samples, maximum and failures; percentiles only with enough samples&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Outages and failures&lt;/td&gt;
&lt;td&gt;What is disconnected, functions that must remain&lt;/td&gt;
&lt;td&gt;Functional changes, fault indications and restoration&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;State consistency&lt;/td&gt;
&lt;td&gt;Protocol-state or physical-output evidence&lt;/td&gt;
&lt;td&gt;Commands, reports, observations and duration of disagreements&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Expansion and recovery&lt;/td&gt;
&lt;td&gt;Node/traffic scale, configuration version, restart order&lt;/td&gt;
&lt;td&gt;Before/after differences and configuration persistence/restoration&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;“One hundred operations” alone proves little. State whether each action addressed one light or a group, and whether failures are counted per command or per target. Do not silently remove timeouts from latency results and retain only an attractive successful-sample average.&lt;/p&gt;

&lt;p&gt;A useful conclusion names the devices, firmware, settings, layout and load, states which user actions met requirements and which did not, and identifies the next change to test.&lt;/p&gt;

&lt;p&gt;That is narrower than claiming a protocol is faster, more efficient or more stable, but it guides procurement, development and deployment. &lt;strong&gt;The protocol supplies mechanisms; products supply capabilities; validation determines what we can promise.&lt;/strong&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  References
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://www.bluetooth.com/bluetooth-mesh-networking-primer/" rel="noopener noreferrer"&gt;Bluetooth SIG: The Bluetooth Mesh Networking Primer&lt;/a&gt;: networking mechanisms and model communication.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://docs.silabs.com/btmesh/latest/btmesh-network-optimization/03-bluetooth-mesh-networking-principles" rel="noopener noreferrer"&gt;Silicon Labs: Bluetooth Mesh Networking Principles&lt;/a&gt;: relays, TTL, retransmission, publication rates and replay protection. The page displayed version 11.0.2 when consulted; use your actual SDK version.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://iot.mi.com/v2/new/doc/embedded-dev/ble-mesh/mesh_basic" rel="noopener noreferrer"&gt;Xiaomi IoT: BLE Mesh fundamentals&lt;/a&gt;: gateway/device messaging, asynchronous replies, caching and integration templates. The page is dated August 4, 2026 and describes template changes from August 6, 2026.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Sources checked November 5, 2026. Test organization, observation methods and acceptance tables are engineering recommendations; no hardware testing was performed for this article.&lt;/p&gt;

&lt;p&gt;Cover: &lt;a href="https://commons.wikimedia.org/wiki/File:Tapo_smart_LED_bulb_lighting_sample.jpg" rel="noopener noreferrer"&gt;Japanwikisan&lt;/a&gt;, &lt;a href="https://creativecommons.org/licenses/by/4.0/" rel="noopener noreferrer"&gt;CC BY 4.0&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Originally published at &lt;a href="https://ay3s.com/en/articles/bluetooth-mesh-selection-validation-checklist/" rel="noopener noreferrer"&gt;ay3s.com&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>iot</category>
      <category>bluetooth</category>
      <category>embedded</category>
    </item>
    <item>
      <title>Supports SIG Mesh, but Cannot Join Mi Home? Xiaomi Mesh Product Identity and Integration Boundaries</title>
      <dc:creator>weiyi</dc:creator>
      <pubDate>Sat, 07 Nov 2026 01:17:48 +0000</pubDate>
      <link>https://dev.to/weiyi/supports-sig-mesh-but-cannot-join-mi-home-xiaomi-mesh-product-identity-and-integration-boundaries-15mi</link>
      <guid>https://dev.to/weiyi/supports-sig-mesh-but-cannot-join-mi-home-xiaomi-mesh-product-identity-and-integration-boundaries-15mi</guid>
      <description>&lt;p&gt;A light can already join a SIG Mesh network, and a development board can control its power and brightness. To add it to Mi Home, is changing its advertising name and connecting a Xiaomi gateway enough?&lt;/p&gt;

&lt;p&gt;The reverse question is equally common: if a Mi Home Bluetooth Mesh light uses a standard underneath, can a custom gateway take it over and bridge it to Matter?&lt;/p&gt;

&lt;p&gt;Neither question can be answered by the label “supports SIG Mesh.”&lt;/p&gt;

&lt;p&gt;The &lt;a href="https://ay3s.com/en/articles/bluetooth-mesh-provisioning-appkey-model-binding/" rel="noopener noreferrer"&gt;previous article&lt;/a&gt; covered provisioning, application keys and model binding. This article moves up a layer: how a device becomes a product Mi Home recognizes, how platform functions become wireless messages, and what a gateway actually promises.&lt;/p&gt;

&lt;p&gt;This discussion follows Xiaomi BLE Mesh documentation accessible on November 5, 2026. Product generations, SDKs and gateway firmware must be checked separately; this is not a universal capability list for everything marketed as Xiaomi Mesh. The lights and diagnostic steps are design examples, not interoperability test results.&lt;/p&gt;

&lt;h2&gt;
  
  
  A light must answer three kinds of questions
&lt;/h2&gt;

&lt;p&gt;Standard Mesh development deals with node addresses, keys, elements and models. Mi Home additionally needs to know what the product is, which functions it offers and how users operate it.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Layer&lt;/th&gt;
&lt;th&gt;Questions to answer&lt;/th&gt;
&lt;th&gt;What is insufficient&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Mesh network and application&lt;/td&gt;
&lt;td&gt;How does it join, which models accept messages, and how are keys configured?&lt;/td&gt;
&lt;td&gt;Detecting an advertisement&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Product definition and identity&lt;/td&gt;
&lt;td&gt;Which product and individual device is this, and can it complete platform binding?&lt;/td&gt;
&lt;td&gt;Implementing a light-control model&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Platform operation and maintenance&lt;/td&gt;
&lt;td&gt;Can the app, voice assistant and gateway understand its functions, state and updates?&lt;/td&gt;
&lt;td&gt;Completing one binding operation&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;These layers are related but not interchangeable. Article three covered the transition from joining a network to being configured for application communication. Mi Home integration must also fit those capabilities into a supported product workflow.&lt;/p&gt;

&lt;p&gt;When a chip supplier says “supports SIG Mesh,” the next questions should be: &lt;strong&gt;which integration scheme, which SDK version, and does it support our intended product category?&lt;/strong&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  MIoT Spec and Mesh Model describe different interfaces
&lt;/h2&gt;

&lt;p&gt;Xiaomi’s &lt;a href="https://github.com/MiEcosystem/miio_open/blob/master/ble/04-%E8%93%9D%E7%89%99Mesh%E6%8E%A5%E5%85%A5%E5%BC%80%E5%8F%91.md" rel="noopener noreferrer"&gt;historical integration guide&lt;/a&gt; distinguishes MIoT Spec from Mesh Spec. The former describes product services, properties and operations; the latter concerns SIG Mesh models, messages and states. The current &lt;a href="https://iot.mi.com/v2/new/doc/embedded-dev/ble-mesh/mesh_basic" rel="noopener noreferrer"&gt;BLE Mesh basics&lt;/a&gt; still describe the gateway translating between Spec and Mesh messages.&lt;/p&gt;

&lt;p&gt;Turning on a light might be represented at the platform as setting its power property to on. On the wireless side, that must become a message the target device can process. Reported state must be translated in the opposite direction.&lt;/p&gt;

&lt;p&gt;This involves more than renaming fields. Platform and firmware must agree on function identifiers, data types, ranges and reporting behavior. A working brightness slider in the app does not prove its values are correctly mapped to the lighting model.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fjazdq9x6vdt3x5lu2nal.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fjazdq9x6vdt3x5lu2nal.png" alt="Conceptual cloud control path: app or voice request, cloud Spec processing, gateway translation, device execution and state reporting" width="800" height="933"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The diagram summarizes the cloud control path described by Xiaomi and omits network details such as relaying. It does not say all control must use the cloud; phone connections and product-specific local automation require separate examination.&lt;/p&gt;

&lt;p&gt;Standard models and vendor extensions can coexist. The historical color-temperature light example includes both standard lighting models and Xiaomi models. It illustrates the architecture, but does not guarantee that today’s devices have the same element layout or model identifiers.&lt;/p&gt;

&lt;p&gt;Adding a custom platform function likewise does not automatically teach existing gateways, firmware or voice interfaces how to use it. Each part’s support must be checked against the current scheme.&lt;/p&gt;

&lt;h2&gt;
  
  
  Product model, device identity and Mesh keys are different
&lt;/h2&gt;

&lt;p&gt;Two meanings of “model” are easy to confuse. A platform product model name identifies a product type; a Mesh Model defines application communication behavior. Putting “light” in the product name does not implement a lighting model in firmware.&lt;/p&gt;

&lt;p&gt;PID, or Product ID, is not an individual device’s Mesh unicast address either. Product identification and addressing within a network have different purposes.&lt;/p&gt;

&lt;p&gt;Platform integration also has identity requirements. Xiaomi’s &lt;a href="https://iot.mi.com/v2/new/doc/embedded-dev/ble-mesh/mesh-faq" rel="noopener noreferrer"&gt;BLE Mesh FAQ&lt;/a&gt; states that, for its documented module scheme, the certificate chain, Product ID and MAC become associated after first binding. Changing that information can cause subsequent provisioning failures; a full-chip erase can remove the certificate chain.&lt;/p&gt;

&lt;p&gt;A development module therefore should not be treated as an empty demo board that can always be erased and assigned another PID. Before flashing, confirm where identity data resides and which update, reset and recovery procedures the supplier supports.&lt;/p&gt;

&lt;p&gt;This comes from Xiaomi’s particular module scheme, not a SIG Mesh requirement for every device. It does not establish a common flash layout for every chip or one recovery procedure for every product.&lt;/p&gt;

&lt;p&gt;The previous article’s NetKey, AppKey and DevKey protect Mesh network, application and configuration communication. They do not replace product identity requirements, and a product certificate is not a Mesh application key.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;A working standard Mesh demonstration proves that technical path works. Turning it into your own Mi Home product still requires the corresponding platform and identity configuration.&lt;/strong&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  A real documentation difference: old templates cannot simply be copied
&lt;/h2&gt;

&lt;p&gt;The most useful discovery in this research was a difference between newer and older documentation, rather than a code snippet.&lt;/p&gt;

&lt;p&gt;Xiaomi’s BLE Mesh basics page is dated August 4, 2026. It announces template changes from August 6 for newly created BLE Mesh products, excluding test products already created. Brightness-light and brightness/color-temperature-light templates remain unchanged. Templates for one-, two- and three-key switches and fans move to &lt;code&gt;MI_MESH_TEMPLATE_CLOUD&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;The page warns that mismatched platform and firmware templates may break control or reporting. After switching firmware to &lt;code&gt;MI_MESH_TEMPLATE_CLOUD&lt;/code&gt;, periodic publication properties must be added manually.&lt;/p&gt;

&lt;p&gt;However, the FAQ dated November 6, 2024 still uses &lt;code&gt;MI_MESH_TEMPLATE_THREE_KEY_SWITCH&lt;/code&gt; in its three-key switch example.&lt;/p&gt;

&lt;p&gt;This does not mean every old firmware must change. First establish when the product was created, its category, the scheme currently available in the platform, and the SDK and firmware configuration in use.&lt;/p&gt;

&lt;p&gt;Products covered by the new rule should be checked against the newer template notice. Existing products should not be switched merely because a new macro appears in documentation.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;A tutorial that compiles is not necessarily consistent with today’s platform configuration.&lt;/strong&gt; Record the product definition, firmware version and target gateway version together, rather than recording only the chip model.&lt;/p&gt;

&lt;h2&gt;
  
  
  A gateway saying “received” is not a light saying “executed”
&lt;/h2&gt;

&lt;p&gt;Once the device appears in Mi Home, the next puzzle is often: the button was pressed and the interface returned, so why did the light not change?&lt;/p&gt;

&lt;p&gt;Xiaomi’s BLE Mesh basics explicitly describe server–gateway–device communication as asynchronous: the gateway replies immediately to a command from the server.&lt;/p&gt;

&lt;p&gt;That reply alone cannot establish device execution. Distinguish request handling, wireless delivery and device state reporting, and interpret status codes according to the actual interface definition.&lt;/p&gt;

&lt;p&gt;A property query may not mean the device has just been queried over the radio. The same documentation explains that immediately after binding, a gateway without cached properties may return &lt;code&gt;-4004&lt;/code&gt; to the app. Proactively reporting properties after binding is one suggested remedy.&lt;/p&gt;

&lt;p&gt;Property reporting is also filtered: the gateway caches properties and forwards them to the cloud when the applicable interval or change condition is met. Events follow another path; the document says they are forwarded immediately. “Immediately” describes gateway handling, not guaranteed end-to-end latency or delivery.&lt;/p&gt;

&lt;p&gt;A light can therefore change while the cloud interface has not updated, or a device can remain reachable without a property being reported again. Investigate control, reporting, caches and filters separately instead of immediately blaming radio loss.&lt;/p&gt;

&lt;p&gt;In a custom gateway, I would retain desired state, the last device-reported state and its timestamp, rather than marking every interface “on” as soon as a command is sent. This is an engineering recommendation, not a mandated Xiaomi interface design.&lt;/p&gt;

&lt;h2&gt;
  
  
  A Bluetooth speaker is not necessarily a suitable Mesh gateway
&lt;/h2&gt;

&lt;p&gt;Xiaomi’s FAQ lists BLE Mesh gateway support, whether the function is enabled, and firmware version among checks for discovery and control failures.&lt;/p&gt;

&lt;p&gt;“We have a XiaoAI speaker” is therefore incomplete compatibility information. Check the exact model and firmware, then the target product’s functions. Ordinary Bluetooth audio support does not imply BLE Mesh gateway support.&lt;/p&gt;

&lt;p&gt;Relaying is not a substitute for gateway functionality either. The current basics document says non-low-power devices with a FULL scan window relay by default, while also saying devices cannot control each other in that scheme.&lt;/p&gt;

&lt;p&gt;There is no contradiction: relaying helps deliver messages, whereas control requires application roles and configuration. The &lt;a href="https://www.bluetooth.com/bluetooth-mesh-networking-primer/" rel="noopener noreferrer"&gt;Bluetooth SIG primer&lt;/a&gt; describes switches, sensors and lights exchanging local control messages. Whether a Xiaomi integration scheme implements and exposes that path is a different question.&lt;/p&gt;

&lt;p&gt;A scheme’s restrictions are not universal Bluetooth Mesh restrictions. Conversely, a capability allowed by the standard does not prove a particular Mi Home product implements it.&lt;/p&gt;

&lt;h2&gt;
  
  
  Test offline operation by control path
&lt;/h2&gt;

&lt;p&gt;Xiaomi says remote control needs a Mesh gateway, while a direct Bluetooth control function can be developed when no gateway is present. This does not guarantee the same direct-connection experience in every retail device, or that all automation executes locally.&lt;/p&gt;

&lt;p&gt;Before development or procurement, test the same functions under different conditions:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Test condition&lt;/th&gt;
&lt;th&gt;What to observe&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Internet disconnected; router, gateway and devices powered&lt;/td&gt;
&lt;td&gt;Which configured controls and automations continue, and which fail?&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Gateway powered off; devices powered&lt;/td&gt;
&lt;td&gt;Do physical buttons, explicitly supported phone connections and device interactions work?&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;State changed locally on a device&lt;/td&gt;
&lt;td&gt;Do the gateway and app update, and does stale state appear after reconnection?&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Gateway and devices restarted separately&lt;/td&gt;
&lt;td&gt;Are binding and configuration retained, and is state re-established?&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;This is a proposed test plan, not a report of completed measurements. Record device and gateway models, firmware, app version and the control entry point so that results apply to a specific combination.&lt;/p&gt;

&lt;p&gt;A light still working with its physical button after gateway shutdown does not establish that all automation is independent of the gateway. Limit conclusions to the path actually tested.&lt;/p&gt;

&lt;h2&gt;
  
  
  For a custom gateway or Matter, first choose the integration point
&lt;/h2&gt;

&lt;p&gt;Can a custom gateway manage an existing Mi Home light? First establish which integration methods the product supports and permits. Joining a self-managed network, configuring the required models, and obtaining usable identity and provisioning implementations all require device-specific verification. A factory reset does not guarantee openness to every Provisioner.&lt;/p&gt;

&lt;p&gt;Using an officially available platform API instead integrates the functions, permissions and control path offered by that API. It is not automatically direct management of the underlying Mesh network. Cloud-based control cannot be called local control on that basis.&lt;/p&gt;

&lt;p&gt;Developing the device firmware yourself gives more scope to align models, reporting and maintenance. Supporting both a self-managed scheme and a Mi Home version still requires evaluating their identities, configurations and capabilities; do not promise lossless migration of existing devices by toggling a setting.&lt;/p&gt;

&lt;p&gt;Matter bridging is another layer: mapping reliably manageable functions into Matter devices and states. It does not solve missing management permission, unsupported functions or unavailable state on the Bluetooth side. See &lt;a href="https://ay3s.com/en/articles/rust-rs-matter-bridge-apple-home/" rel="noopener noreferrer"&gt;building a Matter gateway in Rust&lt;/a&gt; for that layer.&lt;/p&gt;

&lt;h2&gt;
  
  
  Make compatibility a concrete agreement before starting
&lt;/h2&gt;

&lt;p&gt;For a Mi Home Mesh product, I would first confirm with the solution supplier:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Supported schemes for the category, and SDK versions that can be obtained and maintained.&lt;/li&gt;
&lt;li&gt;How product identifiers and device identities are supplied, which data flashing must preserve, and available recovery support.&lt;/li&gt;
&lt;li&gt;Models or mappings for power, dimming, color temperature and custom functions, including state reports.&lt;/li&gt;
&lt;li&gt;Exact gateway and firmware combinations for acceptance tests, with separate app, voice and offline capabilities.&lt;/li&gt;
&lt;li&gt;Responsibility for updates, existing products and adaptation when the platform scheme changes.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This checklist does not replace platform admission and launch procedures. A technical demonstration does not confer sales approval, certification or brand rights. Confirm current commercial terms with the platform and supplier rather than adopting fees or promises from old tutorials.&lt;/p&gt;

&lt;p&gt;A useful compatibility statement is specific: this product, with these versions and settings, performs these operations through this path, with verifiable state. That reveals where standards can be reused, where platform adaptation is needed and where testing is still missing.&lt;/p&gt;

&lt;p&gt;The next article brings the three approaches back to concrete scenarios: choosing custom Mesh, standard SIG Mesh or Mi Home integration according to control needs, offline behavior and maintenance cost, then designing a fair, repeatable evaluation.&lt;/p&gt;

&lt;h2&gt;
  
  
  References
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://iot.mi.com/v2/new/doc/embedded-dev/ble-mesh/mesh_basic" rel="noopener noreferrer"&gt;Xiaomi IoT: BLE Mesh basics&lt;/a&gt;, marked 2026-08-04; template changes, message flow and reporting.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://iot.mi.com/v2/new/doc/embedded-dev/ble-mesh/mesh-faq" rel="noopener noreferrer"&gt;Xiaomi IoT: BLE Mesh FAQ&lt;/a&gt;, marked 2024-11-06; identity, flashing and gateway diagnostics. Read template examples alongside newer notices.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://github.com/MiEcosystem/miio_open/blob/master/ble/04-%E8%93%9D%E7%89%99Mesh%E6%8E%A5%E5%85%A5%E5%BC%80%E5%8F%91.md" rel="noopener noreferrer"&gt;MiEcosystem: Bluetooth Mesh integration&lt;/a&gt;, historical architecture reference, not a current chip, template or launch guide.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.bluetooth.com/bluetooth-mesh-networking-primer/" rel="noopener noreferrer"&gt;Bluetooth SIG: The Bluetooth Mesh Networking Primer&lt;/a&gt;, for standard local communication and model capabilities versus ecosystem implementation.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Cover: &lt;a href="https://commons.wikimedia.org/wiki/File:Tapo_smart_LED_bulb_lighting_sample.jpg" rel="noopener noreferrer"&gt;Japanwikisan&lt;/a&gt;, &lt;a href="https://creativecommons.org/licenses/by/4.0/" rel="noopener noreferrer"&gt;CC BY 4.0&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Originally published at &lt;a href="https://ay3s.com/en/articles/xiaomi-mesh-sig-mesh-mijia-integration-boundaries/" rel="noopener noreferrer"&gt;ay3s.com&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>iot</category>
      <category>bluetooth</category>
      <category>embedded</category>
    </item>
    <item>
      <title>Bluetooth Mesh Provisioning Succeeded—Why Won’t the Light Respond?</title>
      <dc:creator>weiyi</dc:creator>
      <pubDate>Sat, 07 Nov 2026 01:17:29 +0000</pubDate>
      <link>https://dev.to/weiyi/bluetooth-mesh-provisioning-succeeded-why-wont-the-light-respond-1ai6</link>
      <guid>https://dev.to/weiyi/bluetooth-mesh-provisioning-succeeded-why-wont-the-light-respond-1ai6</guid>
      <description>&lt;p&gt;A device appears in the scan results. You click Add, the log reports successful provisioning, and the gateway gains a new entry. Everything looks finished.&lt;/p&gt;

&lt;p&gt;Then you send an On command. Nothing happens.&lt;/p&gt;

&lt;p&gt;It is tempting to blame radio coverage, chip compatibility or serial framing. But in SIG Mesh, another question deserves attention first: &lt;strong&gt;joining the network does not mean the device is configured to participate in the application.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The &lt;a href="https://ay3s.com/en/articles/bluetooth-mesh-custom-broadcast-multihop-design/" rel="noopener noreferrer"&gt;previous article&lt;/a&gt; explored turning custom advertising into a multihop network. Here we return to the standard, following a controller adding one light through discovery, provisioning, keys, model binding and publish/subscribe.&lt;/p&gt;

&lt;p&gt;This is an explanation of the mechanisms, not a completed hardware test report or a guide to one vendor's serial protocol.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Ftyvga1ehgznrpwro6gii.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Ftyvga1ehgznrpwro6gii.png" alt="Bluetooth Mesh setup: discover, provision, read composition, configure application models, then verify control and reported state" width="720" height="1180"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Discovery only tells you a device is available
&lt;/h2&gt;

&lt;p&gt;An unprovisioned device can advertise an Unprovisioned Device Beacon. A phone or gateway discovers it, and whichever component acts as the Provisioner initiates the process.&lt;/p&gt;

&lt;p&gt;Provisioner is a role. It does not have to be a phone or be permanently tied to the gateway. A product may combine provisioning, configuration and everyday control in one application, but separating those responsibilities helps explain the protocol.&lt;/p&gt;

&lt;p&gt;Finding an advertisement does not prove it belongs to the light you intend to add. Discovery identifies a candidate; onboarding still needs identity confirmation and the appropriate security procedure.&lt;/p&gt;

&lt;p&gt;With several identical lights nearby, how does the installer select the right one? A button, product-supplied information or supported input/output authentication may be involved. Design that interaction before the installer faces a list of indistinguishable names.&lt;/p&gt;

&lt;h2&gt;
  
  
  Provisioning establishes network identity
&lt;/h2&gt;

&lt;p&gt;Provisioning is more than writing a password.&lt;/p&gt;

&lt;p&gt;The Provisioner and device exchange capabilities, select a supported authentication method, perform public-key-related exchanges and authentication, and securely establish the state needed to join. Input/output capabilities, authentication choices and implementation all matter. Encrypted communication alone does not establish that this is the intended device.&lt;/p&gt;

&lt;p&gt;Afterward, the device is a Mesh node with an initial NetKey, IV Index, allocated unicast addressing and its DevKey. &lt;strong&gt;The two sides independently derive the DevKey; it is not sent over the air as a plaintext setting.&lt;/strong&gt; It has a different purpose from the shared NetKey.&lt;/p&gt;

&lt;p&gt;The node now has a network identity. The application key for lighting, the model that accepts commands and the group it should listen to may still need configuration. I would label this state “Provisioned; configuration pending,” rather than “Ready to use.”&lt;/p&gt;

&lt;h2&gt;
  
  
  Three keys with different jobs
&lt;/h2&gt;

&lt;p&gt;Treating NetKey, AppKey and DevKey as interchangeable Bluetooth passwords makes troubleshooting harder.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Key&lt;/th&gt;
&lt;th&gt;Main responsibility&lt;/th&gt;
&lt;th&gt;What it does not imply&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;NetKey&lt;/td&gt;
&lt;td&gt;Network/subnet security and network-layer processing&lt;/td&gt;
&lt;td&gt;Access to every application's plaintext&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;AppKey&lt;/td&gt;
&lt;td&gt;Protect application messages, with model binding&lt;/td&gt;
&lt;td&gt;Every model can use a key merely because it is stored&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;DevKey&lt;/td&gt;
&lt;td&gt;Protect configuration communication for that node&lt;/td&gt;
&lt;td&gt;A shared everyday control key for the lighting group&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;A hallway light may relay other devices' traffic. It needs network-layer processing, not automatic access to every application's contents. Separating NetKey and AppKey separates carrying a message from understanding it. Relaying does not prove the node has the permission or model to execute the command.&lt;/p&gt;

&lt;p&gt;An AppKey Index in a log is an index, not the key. Matching numbers in two places do not prove matching key material and context. Verify mappings through trusted configuration records without printing real keys into ordinary logs or screenshots.&lt;/p&gt;

&lt;h2&gt;
  
  
  Read composition before guessing addresses
&lt;/h2&gt;

&lt;p&gt;The Configuration Client communicates with the node's Configuration Server to inspect and change settings. Composition Data identifies elements, their models and relevant capabilities.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Node, element and model are different levels.&lt;/strong&gt; One enclosure may contain several independently described elements, each implementing multiple models.&lt;/p&gt;

&lt;p&gt;For a multichannel controller, inspect its actual composition. Do not assume every channel lives in the primary element or that the primary address plus an OnOff command controls all outputs. Address allocation must reserve the required space for elements and avoid collisions between nodes.&lt;/p&gt;

&lt;p&gt;For our example, identify the light's element and confirm that it implements Generic OnOff Server. The controller must send the corresponding messages and handle the required status responses.&lt;/p&gt;

&lt;p&gt;Discovering or provisioning a device does not prove support for your desired application model. Increasing transmit power cannot fix a model mismatch.&lt;/p&gt;

&lt;h2&gt;
  
  
  AppKey Add and Model App Bind are separate operations
&lt;/h2&gt;

&lt;p&gt;First, add the required AppKey to the target node with the appropriate NetKey association. Then bind that AppKey to the application model that needs it.&lt;/p&gt;

&lt;p&gt;Neither step substitutes for the other. A stored key does not automatically authorize every model to process its protected messages. Binding the wrong element or model may change configuration without making the intended light controllable.&lt;/p&gt;

&lt;p&gt;The sender also needs the appropriate key and model configuration. Configuring only the lamp does not establish the whole communication relationship. Nor does every model use AppKey binding: Configuration models use DevKey and must not be treated like lighting models.&lt;/p&gt;

&lt;p&gt;The &lt;a href="https://docs.silabs.com/btmesh/latest/bluetooth-mesh-api/sl-btmesh-config-client" rel="noopener noreferrer"&gt;Silicon Labs Configuration Client API&lt;/a&gt; exposes adding an AppKey and binding a model separately, with result events. This makes three distinct facts visible: &lt;strong&gt;the local interface accepted a request, the remote node reported a configuration result, and the required capability actually works.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;A successful host function return is not a reason to mark every subsequent stage complete. Follow the selected SDK's result handling and check node, element, model and status. A timeout leaves the outcome uncertain; it does not prove nothing happened remotely.&lt;/p&gt;

&lt;h2&gt;
  
  
  Make one light respond before adding groups
&lt;/h2&gt;

&lt;p&gt;Start with the shortest diagnostic path: send a unicast command to the confirmed lighting element and observe the corresponding status response.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Unicast control does not require adding that element's model to a group subscription first.&lt;/strong&gt; Likewise, an API that lets the caller specify a destination explicitly does not necessarily require a preset model publication address for every send.&lt;/p&gt;

&lt;p&gt;Once unicast works, introduce grouping. For a wall switch controlling several hallway lights:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The switch's relevant client model publishes to the hallway group address.&lt;/li&gt;
&lt;li&gt;Each light's relevant server model subscribes to that address.&lt;/li&gt;
&lt;li&gt;Both sides have matching application keys and model configuration.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;A new light can join after provisioning, application configuration and subscription, without rewriting an explicit list of lamps in the switch.&lt;/p&gt;

&lt;p&gt;The human-readable group name is just a label. “Hallway lights” does not itself establish any subscription. Subscriptions apply to particular models; dragging a device into a room in an app does not prove the radio-side configuration is complete.&lt;/p&gt;

&lt;h2&gt;
  
  
  Publication also determines where state goes
&lt;/h2&gt;

&lt;p&gt;Control traffic is only half the system. A light can return status for a request that calls for a response. A local button change may instead require an unsolicited report. These are different paths.&lt;/p&gt;

&lt;p&gt;Model publication settings can include destination, AppKey and supported publication parameters. Setting a destination does not guarantee every model reports at the period you imagine, or that the application handles every local change correctly.&lt;/p&gt;

&lt;p&gt;“Can turn the light on” and “knows its current reported state” deserve separate acceptance checks. For a Matter bridge, a wall-switch change that never reaches the gateway leaves the upper-level app displaying the last command rather than fresh device state.&lt;/p&gt;

&lt;p&gt;Even a state report has limits: an output reported as on does not prove the lamp physically works unless the product has appropriate feedback.&lt;/p&gt;

&lt;h2&gt;
  
  
  Configuration needs recovery, not just a command sequence
&lt;/h2&gt;

&lt;p&gt;Power loss halfway through setup, a missing reply and a host restart are ordinary failure cases. A program that only sends Add Key, Bind Model, Add Subscription and Set Publication has little basis for deciding where to resume.&lt;/p&gt;

&lt;p&gt;Record desired configuration and confirmed results. On recovery, inspect the necessary state and reconcile differences. After an AppKey Add timeout, use the protocol and SDK's query capabilities before deciding whether to retry. Repeated-operation behavior depends on the command; not every configuration operation is automatically harmless to repeat.&lt;/p&gt;

&lt;p&gt;Persist address allocations, node identities and required key/configuration records, with access control and backups. Otherwise devices can remain in a network the manager has forgotten how to manage.&lt;/p&gt;

&lt;p&gt;Factory reset is not the first response to every error: it changes state and may break existing bindings. Distinguish unprovisioned devices, provisioned-but-unconfigured nodes, and working nodes whose management records were lost.&lt;/p&gt;

&lt;h2&gt;
  
  
  Match the symptom to the layer
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Symptom&lt;/th&gt;
&lt;th&gt;Check first&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Discovered, but provisioning fails&lt;/td&gt;
&lt;td&gt;Onboarding mode, bearer support, authentication and reported errors&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Provisioned, but configuration times out&lt;/td&gt;
&lt;td&gt;Addresses, DevKey/network context, reachability and response association; LPN receive timing&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Configuration works, unicast control does not&lt;/td&gt;
&lt;td&gt;Element/model, AppKey addition and binding, sender configuration&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Unicast works, group control does not&lt;/td&gt;
&lt;td&gt;Actual destination, model subscriptions, keys and sending settings&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Control works, displayed state does not update&lt;/td&gt;
&lt;td&gt;Responses, unsolicited publication, reception and upper-layer mapping&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Failure after restart&lt;/td&gt;
&lt;td&gt;Persistence, address records, configuration recovery and key context&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;This is a troubleshooting order, not a diagnosis based on symptoms alone. Use state queries, logs and packet captures where necessary to locate the failed stage.&lt;/p&gt;

&lt;p&gt;Prove unicast and state feedback first, then groups and reports after local changes, then interrupted setup and restart recovery. Explicit success criteria are more useful than a final note that “the light came on.”&lt;/p&gt;

&lt;h2&gt;
  
  
  Adding a device is a workflow
&lt;/h2&gt;

&lt;p&gt;The UI may show one Add button, but the implementation has several states: discovered, provisioned, composition identified, application configured, and control/state verified.&lt;/p&gt;

&lt;p&gt;Separating them lets the program explain what is done, what remains and where it can resume, without requiring users to learn every protocol detail.&lt;/p&gt;

&lt;p&gt;SIG Mesh supplies shared mechanisms. It does not promise automatic interoperability across every brand, model and ecosystem after provisioning. The gateway's work includes the distance between a node joining the network and a device becoming reliably manageable.&lt;/p&gt;

&lt;p&gt;Next, we return to Xiaomi Mesh: beyond standard networking and models, what product definitions, identities and platform requirements does Xiaomi Home integration add?&lt;/p&gt;

&lt;h2&gt;
  
  
  References
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://www.bluetooth.com/bluetooth-mesh-networking-primer/" rel="noopener noreferrer"&gt;Bluetooth SIG: Mesh Networking Primer&lt;/a&gt; — addresses, publish/subscribe, keys, provisioning and configuration.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://docs.silabs.com/btmesh/latest/bluetooth-mesh-api/sl-btmesh-config-client" rel="noopener noreferrer"&gt;Silicon Labs: Configuration Client API&lt;/a&gt; — composition, application keys, binding, subscriptions and publication. Use documentation matching your SDK version.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Cover: &lt;a href="https://commons.wikimedia.org/wiki/File:Tapo_smart_LED_bulb_lighting_sample.jpg" rel="noopener noreferrer"&gt;Japanwikisan&lt;/a&gt;, &lt;a href="https://creativecommons.org/licenses/by/4.0/" rel="noopener noreferrer"&gt;CC BY 4.0&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Originally published at &lt;a href="https://ay3s.com/en/articles/bluetooth-mesh-provisioning-appkey-model-binding/" rel="noopener noreferrer"&gt;ay3s.com&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>iot</category>
      <category>bluetooth</category>
      <category>embedded</category>
    </item>
    <item>
      <title>From Custom Bluetooth Broadcasts to Mesh: What Multihop Networking Requires</title>
      <dc:creator>weiyi</dc:creator>
      <pubDate>Sat, 07 Nov 2026 01:17:10 +0000</pubDate>
      <link>https://dev.to/weiyi/from-custom-bluetooth-broadcasts-to-mesh-what-multihop-networking-requires-2410</link>
      <guid>https://dev.to/weiyi/from-custom-bluetooth-broadcasts-to-mesh-what-multihop-networking-requires-2410</guid>
      <description>&lt;p&gt;Suppose you already have a Bluetooth broadcast-control system: a controller sends “turn on,” nearby lamps receive it, and the lights come on. You own the devices and application, and the protocol is simple.&lt;/p&gt;

&lt;p&gt;Now you want more coverage. The controller cannot reach the bedroom, so a hallway lamp forwards its message. The first implementation seems obvious: receive a packet, recognize the protocol and broadcast it again.&lt;/p&gt;

&lt;p&gt;With two hallway lamps, complications begin. Both forward the message, copies arrive along different paths, and neighbors can send those copies back. The questions become: &lt;strong&gt;have I seen this message, should I relay it, have I executed it, and does the originator know the result?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://ay3s.com/en/articles/bluetooth-mesh-private-sig-xiaomi-comparison/" rel="noopener noreferrer"&gt;Part one&lt;/a&gt; explained the relationship between custom Mesh, SIG Mesh and Xiaomi Mesh. This article examines what must be added to an existing custom Bluetooth broadcast protocol to support real multihop operation.&lt;/p&gt;

&lt;p&gt;The controller–relay–lamp network below is a design example, not a measurement of a particular product. We will examine reliability before deciding whether maintaining our own Mesh is worthwhile.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 1: give each message an identity that survives forwarding
&lt;/h2&gt;

&lt;p&gt;In single-hop control, developers naturally focus on command fields: which byte represents power and which represents brightness. With relays, message identity becomes equally important.&lt;/p&gt;

&lt;p&gt;Controller A sends one request. Relays B and C both forward it, so lamp D may receive two copies. D must recognize them as copies of the same transmission.&lt;/p&gt;

&lt;p&gt;A relay must not turn the message into a new application command originating from itself. Otherwise the destination cannot identify duplicates by the original message. The immediate radio transmitter may change, while the protocol preserves the original source and message identity.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Information&lt;/th&gt;
&lt;th&gt;Question it answers&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Network or security-domain identifier&lt;/td&gt;
&lt;td&gt;Which system does this belong to? The identifier alone does not establish trust&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Original source and destination&lt;/td&gt;
&lt;td&gt;Who initiated it, and is it addressed to a device or group?&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Message sequence and necessary generation information&lt;/td&gt;
&lt;td&gt;Is this a new transport message or a previously seen copy?&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Forwarding budget&lt;/td&gt;
&lt;td&gt;How many more relay operations are permitted?&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Application request identifier&lt;/td&gt;
&lt;td&gt;Do multiple transmissions belong to the same business operation?&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Operation, parameters and authentication&lt;/td&gt;
&lt;td&gt;What is requested, is it trustworthy, and has it been altered?&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;This is a list of responsibilities, not a ready-to-use packet format. Field placement, size and authentication coverage must be designed together with addressing, key management and fragmentation.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;A duplicate packet in the network and a fresh transmission retrying the same application operation are not necessarily the same thing.&lt;/strong&gt; This distinction determines whether a retried command gets executed twice.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 2: make forwarding a bounded action
&lt;/h2&gt;

&lt;p&gt;A forwarding budget limits propagation: each relay reduces it, and no further relay is permitted once it is exhausted. It bounds travel even when the topology contains loops.&lt;/p&gt;

&lt;p&gt;But it does not determine how often an individual node forwards a message. If B has already relayed A’s packet and later receives it from C, forwarding again adds unnecessary traffic. A recent-message cache can suppress a second forwarding procedure for the same identity.&lt;/p&gt;

&lt;p&gt;That does not mean “discard every duplicate everywhere.” The network layer may suppress repeated propagation, while the application still needs to return a saved result for a retried request. One global “already seen” flag cannot replace both responsibilities.&lt;/p&gt;

&lt;p&gt;Cache retention and capacity have costs. Short retention can admit late copies as new messages. Long retention uses more memory and complicates identity reuse. Estimate them from message rate, propagation lifetime and retry windows, then validate under load.&lt;/p&gt;

&lt;p&gt;Reception order matters too. Perform the necessary format, network-membership and authentication checks before admitting a message into trusted processing state. A forged message should not reserve an entry that causes the genuine command to be rejected as a duplicate.&lt;/p&gt;

&lt;p&gt;The &lt;a href="https://www.bluetooth.com/bluetooth-mesh-networking-primer/" rel="noopener noreferrer"&gt;Bluetooth SIG Mesh primer&lt;/a&gt; describes standard relaying and TTL. A custom forwarding budget can address similar problems without having the same field semantics. Its numerical values should not automatically be equated with SIG Mesh TTL.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 3: decide who relays and when
&lt;/h2&gt;

&lt;p&gt;Many devices may receive a packet; that does not mean all should relay immediately. If they receive together and transmit together, the extra copies can increase collisions rather than improve delivery.&lt;/p&gt;

&lt;p&gt;Relay eligibility, transmission timing, bounded retransmission and queue limits need to be considered together. Controlled random delays can reduce synchronized contention, while limits on transmissions per message prevent queues growing indefinitely.&lt;/p&gt;

&lt;p&gt;Longer random delays are not always better: they add response time that accumulates over hops. More repetitions are not always more reliable either; in a congested network they can further crowd out useful traffic. “Enable every lamp as a relay” and “double retries whenever packets are lost” are poor universal defaults. Placement, power and workload matter.&lt;/p&gt;

&lt;p&gt;Power is particularly important. Continuous scanning and forwarding consume energy. A battery switch able to send its own button event is not automatically suitable as a permanent relay.&lt;/p&gt;

&lt;p&gt;SIG Mesh Low Power and Friend mechanisms divide these responsibilities: a Friend temporarily stores messages so the low-power node need not listen continuously. A custom solution that delivers commands to sleeping devices needs receive windows, buffering or another coordination scheme. Merely listing “battery support” is insufficient.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 4: define the layer at which success occurs
&lt;/h2&gt;

&lt;p&gt;This deserves discussion before packet design. When a controller hands a packet to a Bluetooth module and receives “transmission complete,” that describes the module’s operation. It does not prove the bedroom lamp received the command, much less that it illuminated.&lt;/p&gt;

&lt;p&gt;Even a destination response needs a defined meaning: received, accepted, executed, or physically observed? A relay-output controller can report that it set its output. Without current sensing or other feedback, it cannot know whether the load actually worked. The interface must reflect what the device can observe.&lt;/p&gt;

&lt;p&gt;Nor should every intermediate relay report success on behalf of the final destination. That only confirms arrival at an intermediate hop. Operations needing final-state confirmation require a defined end-to-end response correlated with the request.&lt;/p&gt;

&lt;p&gt;Acknowledging everything creates another issue: group control. One command switches off a group of lamps; immediate replies from every lamp, relayed back through the network, can exceed the original downlink traffic. The SIG primer also notes that acknowledged messaging works well for individual destinations but scales poorly to large groups.&lt;/p&gt;

&lt;p&gt;Policies can vary by operation: individually acknowledge important configuration, use bounded repetition for ordinary group control and query states over time, or define aggregation and timeouts when a complete result is required. Be explicit about the guarantee. If state reconciliation is omitted, the interface must not claim that every device executed successfully.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 5: retries must not turn a lamp on and then off again
&lt;/h2&gt;

&lt;p&gt;Imagine the lamp executes a command but its response is lost. The controller times out and retries. If the command is “toggle,” executing twice restores the original state. The user may see a flash followed by darkness.&lt;/p&gt;

&lt;p&gt;“Set power to on” usually avoids that particular problem. For target-state operations, preserving the same effect across repeated execution is valuable.&lt;/p&gt;

&lt;p&gt;But not all operations are safe to repeat. “Move the motor one step,” “decrement once” and “start a timer” may have duplicate side effects. They need request identities, result records and recovery policies.&lt;/p&gt;

&lt;p&gt;Transport sequences and application request IDs can perform separate duties: a new transmission follows the security rules for message identity, while the application recognizes the previous operation and returns its result rather than repeating it.&lt;/p&gt;

&lt;p&gt;A subtler failure remains. First the user requests 30% brightness, then changes it to 80%. A late retry of the first command arrives last, restoring 30%. Both commands individually set a target state and tolerate repetition, yet the state has regressed.&lt;/p&gt;

&lt;p&gt;Ordering and validity must therefore be handled, for example through versions within a control stream, request expiry, or cancellation of old retries by newer operations. Multiple controllers also require an overwrite policy.&lt;/p&gt;

&lt;p&gt;Repeatability alone does not guarantee correctness. Nor should a device promise absolute exactly-once execution if power can fail after acting but before saving the result.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 6: restarting must not reset security
&lt;/h2&gt;

&lt;p&gt;Anyone able to receive nearby broadcasts may record a valid command and transmit it later. Encryption alone does not completely address this: an unmodified, previously valid ciphertext can still be resubmitted at the wrong time.&lt;/p&gt;

&lt;p&gt;Short-term duplicate caches and replay-protection state are therefore different. Clearing a cache to save RAM must not automatically reauthorize old commands.&lt;/p&gt;

&lt;p&gt;Both sender and receiver matter. How does a restarted sender avoid unsafe reuse of security-related sequence numbers or nonces? How does a receiver avoid accepting old messages after forgetting its security state? What changes during a factory reset, reprovisioning or rekeying?&lt;/p&gt;

&lt;p&gt;For authenticated-encryption algorithms requiring nonce uniqueness under a key, a RAM-only counter starting at zero on every boot is not enough. Multiple senders sharing a key must also avoid nonce collisions. Construction must follow the algorithm and a mature protocol’s requirements.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.rfc-editor.org/rfc/rfc5116.html" rel="noopener noreferrer"&gt;RFC 5116&lt;/a&gt; discusses authenticated encryption and nonce usage, and explicitly separates its interface from complete anti-replay and access-control services. Saying “we use AES” can obscure that distinction.&lt;/p&gt;

&lt;p&gt;Persistence adds flash-write frequency, power-loss consistency and recovery concerns. One engineering approach reserves a range of counter values using a persisted boundary. But its implementation still needs evidence that interrupted writes cannot cause rollback or reuse; ordinary reboot testing is insufficient.&lt;/p&gt;

&lt;p&gt;Key lifecycle also belongs in the initial design: securely adding devices, removing lost or resold devices, and revoking their authority. Deleting a device row from an application does not revoke keys stored inside the device.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 7: establish small messages before fragmentation and updates
&lt;/h2&gt;

&lt;p&gt;Switch commands are short, so prototypes often ignore size. Bulk configuration, long properties and firmware transfer expose another set of questions.&lt;/p&gt;

&lt;p&gt;How are messages fragmented and reassembled? How is each fragment identified? What happens when one is missing, how long are buffers retained, and how many reassemblies may run simultaneously?&lt;/p&gt;

&lt;p&gt;Do not equate theoretical BLE advertising, extended-advertising or SDK capacity with usable application payload. Headers, security fields, bearer choice and device support all constrain it.&lt;/p&gt;

&lt;p&gt;Fragmentation multiplies traffic: one business operation becomes several radio packets, each potentially relayed. Poor retry policy can let a small configuration workload crowd out normal control.&lt;/p&gt;

&lt;p&gt;I would first establish short commands, state reporting and recovery. Firmware updates need separate design for transport, traffic control, signature verification and failure recovery. Moving data over Mesh does not itself provide a dependable OTA system.&lt;/p&gt;

&lt;h2&gt;
  
  
  How to test beyond a working demonstration
&lt;/h2&gt;

&lt;p&gt;Start with a small network that exposes failure paths rather than chasing a large node count. These are proposed tests, not measured results.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Scenario&lt;/th&gt;
&lt;th&gt;What to observe&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;One command arrives through two relays&lt;/td&gt;
&lt;td&gt;Whether copies are bounded and execution is duplicated&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Response lost after execution&lt;/td&gt;
&lt;td&gt;Whether retries repeat side effects or return the known result&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;New command arrives before an old retry&lt;/td&gt;
&lt;td&gt;Whether late requests overwrite newer state&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;A relay loses power or is moved&lt;/td&gt;
&lt;td&gt;Continued operation with an alternative path; honest failure without one&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Simultaneous reporting and group responses&lt;/td&gt;
&lt;td&gt;Latency, failure rate, transmissions and queue pressure&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Sender and receiver lose power at critical points&lt;/td&gt;
&lt;td&gt;Recovery of sequences, nonces, request records and replay protection&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;A device is removed or reprovisioned&lt;/td&gt;
&lt;td&gt;Whether old keys, packets or bindings permit unintended operations&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Define measurement endpoints: application submission to radio transmission, or to the destination’s execution report? Without a sensor observing the actual load, the latter must not be called physical light-response time.&lt;/p&gt;

&lt;p&gt;Track slow-tail latency, timeouts, duplicate executions and transmission counts, not only averages. When reporting median and P95, include sample size and failures separately. Excluding every timeout and showing only successful samples produces misleadingly good numbers.&lt;/p&gt;

&lt;p&gt;Record placement, power, Wi-Fi interference, scan settings and traffic rates too. Otherwise results collected on different days may not be comparable.&lt;/p&gt;

&lt;h2&gt;
  
  
  Then decide how much to build yourself
&lt;/h2&gt;

&lt;p&gt;Forwarding a broadcast once may take a few lines. A maintainable network needs coordinated rules for identities, addresses, bounded relaying, duplicates, responses, application retries, security state, recovery and diagnostics.&lt;/p&gt;

&lt;p&gt;That does not require every product to reimplement SIG Mesh. A focused application, fully controlled devices and a substantial installed base may justify a custom solution. Know which capabilities you omit and whether those omissions fit the product.&lt;/p&gt;

&lt;p&gt;If the reasoning is merely “our broadcast protocol is simple, so relaying should be simple,” estimate the lifecycle costs while still prototyping. A mature vendor solution or standard stack may leave more time for device functionality and gateway behavior.&lt;/p&gt;

&lt;p&gt;For our Matter gateway, product behavior, state mapping and error handling are especially valuable areas to own. The amount of wireless networking we implement ourselves should depend on sustained validation and maintenance, not only whether the first prototype works.&lt;/p&gt;

&lt;p&gt;Next we return to SIG Mesh: &lt;strong&gt;what happens between discovering a new device, completing Provisioning and successfully switching it?&lt;/strong&gt; Network keys, application keys, model bindings and publication/subscription will provide concrete counterparts to these design problems.&lt;/p&gt;

&lt;p&gt;If you already operate a proprietary broadcast system, start with why relaying is needed, which devices have continuous power and which failures are unacceptable. &lt;a href="https://linktr.ee/weiyii" rel="noopener noreferrer"&gt;Get in touch&lt;/a&gt; to discuss your scenario.&lt;/p&gt;

&lt;p&gt;Cover: &lt;a href="https://commons.wikimedia.org/wiki/File:Bluegiga_BLE112_Module.jpg" rel="noopener noreferrer"&gt;Phooto&lt;/a&gt;, &lt;a href="https://creativecommons.org/licenses/by-sa/3.0/" rel="noopener noreferrer"&gt;CC BY-SA 3.0&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Originally published at &lt;a href="https://ay3s.com/en/articles/bluetooth-mesh-custom-broadcast-multihop-design/" rel="noopener noreferrer"&gt;ay3s.com&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>iot</category>
      <category>bluetooth</category>
      <category>embedded</category>
    </item>
    <item>
      <title>Custom Mesh, SIG Mesh and Xiaomi Mesh: How They Relate</title>
      <dc:creator>weiyi</dc:creator>
      <pubDate>Sat, 07 Nov 2026 01:16:52 +0000</pubDate>
      <link>https://dev.to/weiyi/custom-mesh-sig-mesh-and-xiaomi-mesh-how-they-relate-3e00</link>
      <guid>https://dev.to/weiyi/custom-mesh-sig-mesh-and-xiaomi-mesh-how-they-relate-3e00</guid>
      <description>&lt;p&gt;When building Bluetooth devices and gateways, one question inevitably appears: which kind of Mesh should we use?&lt;/p&gt;

&lt;p&gt;A chip supplier offers a Mesh SDK, a module vendor advertises SIG Mesh, the product team wants Xiaomi Home support, and the developers may already maintain a proprietary advertising protocol. Everyone says “Mesh,” but they may be solving different problems.&lt;/p&gt;

&lt;p&gt;In the earlier &lt;a href="https://ay3s.com/en/articles/sig-mesh-or-private-protocol-for-gateway/" rel="noopener noreferrer"&gt;Matter gateway article&lt;/a&gt;, I discussed proprietary protocols and SIG Mesh from the device-integration perspective. This series looks more closely at the Bluetooth side. &lt;strong&gt;Custom Mesh, SIG Mesh and Xiaomi Mesh are not three entirely parallel protocol choices.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Custom Mesh describes who designs and controls the networking mechanism. SIG Mesh refers to an open Bluetooth networking standard. Xiaomi Mesh also involves how a product enters Xiaomi Home, is identified, and works through gateways and platform services. Separating those layers makes selection much easier.&lt;/p&gt;

&lt;h2&gt;
  
  
  First, what does your “Mesh” actually do?
&lt;/h2&gt;

&lt;p&gt;Imagine a controller in the living room and a lamp in the bedroom. At short range, sending a command directly is straightforward. Behind several walls, however, the message may no longer arrive. We want a device in the hallway to forward it. Mesh networking concerns this cooperation between nodes, together with addressing, forwarding and network management.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Broadcasting once to many receivers does not, by itself, create a Mesh network.&lt;/strong&gt; A custom BLE advertising protocol without multihop forwarding is still a broadcast-control solution. It may suit one room perfectly, but it cannot automatically reach beyond radio coverage.&lt;/p&gt;

&lt;p&gt;Conversely, a “Mesh” label does not mean every device forwards messages. Roles, power supply and firmware configuration determine that. Before comparing solutions, ask whether they use direct connections, broadcasting or multihop forwarding—and, in the last case, which nodes relay messages and how endless repetition is prevented.&lt;/p&gt;

&lt;h2&gt;
  
  
  Custom Mesh: freedom comes with responsibility
&lt;/h2&gt;

&lt;p&gt;There is no single specification for “proprietary Mesh.” Vendors can use different packets, forwarding rules, addresses and enrollment procedures. One implementation cannot represent all of them.&lt;/p&gt;

&lt;p&gt;If you own the devices, controller and application, you can tailor the protocol to a focused product. A lighting-only system need not cover a wide range of general device models immediately. Existing products may also require continued compatibility with an older protocol.&lt;/p&gt;

&lt;p&gt;Adding relaying brings further questions:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;How are duplicate messages identified when they arrive along several paths, and how is repeated execution avoided?&lt;/li&gt;
&lt;li&gt;When should forwarding stop, and which devices should relay?&lt;/li&gt;
&lt;li&gt;How does a new device authenticate and receive keys? Can a removed device still control the network?&lt;/li&gt;
&lt;li&gt;How does replay protection survive a power cycle?&lt;/li&gt;
&lt;li&gt;How is radio traffic controlled when many devices report or respond together?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;You can implement these mechanisms yourself or buy a module vendor’s proprietary solution. Buying reduces engineering work but creates dependencies: can you replace the gateway, maintain firmware and obtain the protocol documentation? Those questions belong in the initial discussion.&lt;/p&gt;

&lt;p&gt;Proprietary Mesh is not inherently faster, cheaper or insecure. Its suitability depends on the implementation, product boundaries and maintenance capacity. Comparing only the time needed to light the first lamp overlooks the following years.&lt;/p&gt;

&lt;h2&gt;
  
  
  SIG Mesh: common rules for networking, security and behavior
&lt;/h2&gt;

&lt;p&gt;SIG Mesh normally means Bluetooth Mesh, standardized by the Bluetooth SIG. It is based on Bluetooth LE, rather than being a chain of ordinary Bluetooth connections.&lt;/p&gt;

&lt;p&gt;The standard covers provisioning, addressing, message delivery, security and application-level device behavior. The official &lt;a href="https://www.bluetooth.com/bluetooth-mesh-networking-primer/" rel="noopener noreferrer"&gt;Bluetooth Mesh Networking primer&lt;/a&gt; provides a detailed introduction. Three ideas are particularly useful.&lt;/p&gt;

&lt;h3&gt;
  
  
  Joining a network is followed by configuration
&lt;/h3&gt;

&lt;p&gt;Provisioning securely brings an unprovisioned device into a network, assigns addresses and establishes the necessary security information. Application keys, model bindings, publication and subscription relationships must then be configured.&lt;/p&gt;

&lt;p&gt;Discovering, adding and successfully controlling a device are therefore different states. Radio visibility does not mean a device is authorized to receive a particular command.&lt;/p&gt;

&lt;h3&gt;
  
  
  Relaying a message does not mean understanding its application data
&lt;/h3&gt;

&lt;p&gt;SIG Mesh distinguishes the network key, NetKey, from application keys, AppKeys. The former enables network-layer participation in the corresponding subnet; the latter protect application messages.&lt;/p&gt;

&lt;p&gt;A node can consequently relay traffic without receiving control rights for every application. Helping a lighting message reach its destination does not necessarily authorize that node to control the lights. Products must still configure, store and update keys correctly. Standard mechanisms do not eliminate implementation or operational mistakes.&lt;/p&gt;

&lt;h3&gt;
  
  
  Models give “turn on” a shared meaning
&lt;/h3&gt;

&lt;p&gt;Standard models such as Generic OnOff, Light Lightness and Light CTL define behavior related to switching, brightness and color temperature. Devices can understand messages and states according to common rules, rather than merely receive bytes.&lt;/p&gt;

&lt;p&gt;SIG Mesh also permits Vendor Models for functions not covered by standard models. &lt;strong&gt;A proprietary application command does not automatically imply a proprietary Mesh network underneath.&lt;/strong&gt; A device can use standard networking and security while implementing vendor-specific features. Always ask which layer is proprietary.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why SIG Mesh does not guarantee out-of-the-box interoperability
&lt;/h2&gt;

&lt;p&gt;The earlier gateway article emphasized the value of standard models across vendors. That value depends on the actual capabilities and configuration of the products.&lt;/p&gt;

&lt;p&gt;Two lamps may both advertise SIG Mesh. One exposes switching through a standard model; the other also offers special effects through a Vendor Model. A generic controller might operate the basic switch without understanding every effect.&lt;/p&gt;

&lt;p&gt;You also need a supported way to provision devices into a network you manage and configure their keys, models and subscriptions. Using a standard does not require a manufacturer to expose all provisioning and management capabilities to arbitrary third-party controllers.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Question&lt;/th&gt;
&lt;th&gt;What must be checked&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Can it join and participate in the network?&lt;/td&gt;
&lt;td&gt;Provisioning method, management rights, keys and required node features&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Can it perform a particular operation?&lt;/td&gt;
&lt;td&gt;Matching models, messages, states and configuration&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Can it work in the target platform over time?&lt;/td&gt;
&lt;td&gt;Platform integration, device identity, function mapping, firmware maintenance and support&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;The SIG primer discusses optional features, configuration flexibility and interoperability, and introduces Bluetooth NLC device profiles that further constrain device behavior. Standards provide common foundations; product compatibility still needs validation for the intended functions.&lt;/p&gt;

&lt;h2&gt;
  
  
  Xiaomi Mesh adds the Xiaomi Home integration system
&lt;/h2&gt;

&lt;p&gt;Treating Xiaomi Mesh as a wireless protocol unrelated to SIG Mesh misses the relationship. Xiaomi’s public &lt;a href="https://github.com/MiEcosystem/miio_open/blob/master/ble/04-%E8%93%9D%E7%89%99Mesh%E6%8E%A5%E5%85%A5%E5%BC%80%E5%8F%91.md" rel="noopener noreferrer"&gt;Bluetooth Mesh integration guide&lt;/a&gt; distinguishes SIG Mesh models and messages from MIoT Spec, Xiaomi’s description of product services, properties and operations. The gateway translates between them.&lt;/p&gt;

&lt;p&gt;Its color-temperature lamp example includes standard models such as Generic OnOff Server and Light Lightness Server alongside Xiaomi models. Standard Mesh and ecosystem extensions can coexist in one device.&lt;/p&gt;

&lt;p&gt;That is an older guide: its chip lists and procedures should not be treated as current development requirements. The current &lt;a href="https://iot.mi.com/v2/new/doc/embedded-dev/ble-mesh/mesh_basic" rel="noopener noreferrer"&gt;BLE Mesh basics documentation&lt;/a&gt; still describes Spec-to-Mesh translation and specifies product templates, firmware configuration and property reporting requirements.&lt;/p&gt;

&lt;p&gt;Using SIG Mesh and joining Xiaomi Home are therefore separate objectives. The first concerns technical foundations; the second also involves product identity, platform definitions, provisioning and binding, gateway support and presentation of functions.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Renaming an ordinary SIG Mesh device will not make it appear in Xiaomi Home.&lt;/strong&gt; Likewise, buying a Xiaomi Home Bluetooth Mesh lamp does not guarantee that your own generic gateway can take over all its functions.&lt;/p&gt;

&lt;p&gt;Before choosing a chip or writing application code for a Xiaomi Home version, confirm current support for the product category, SDK access and target gateway capabilities. These requirements shape the product; integration is usually more than a final interface added before release.&lt;/p&gt;

&lt;h2&gt;
  
  
  “Works without a gateway” and “works offline” are different questions
&lt;/h2&gt;

&lt;p&gt;Properly configured SIG Mesh nodes can exchange local messages without sending every switch command to an internet service. The intended function must actually be implemented in the nodes and local configuration.&lt;/p&gt;

&lt;p&gt;A finished product depends on its control path. Xiaomi’s current BLE Mesh guide says remote control requires a Mesh gateway, while Bluetooth direct control can be developed for use without one. “Can be developed” does not mean every shipping product includes identical direct-control capabilities.&lt;/p&gt;

&lt;p&gt;The same guide says non-low-power devices can relay messages but cannot control each other in the described solution. &lt;strong&gt;Relaying helps a message arrive; control requires application functionality.&lt;/strong&gt; Do not generalize this statement into an unchanging rule for all Xiaomi products and versions.&lt;/p&gt;

&lt;p&gt;I would test three situations separately:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Disconnect the internet while keeping the router, gateway and devices powered. Does local control and automation continue?&lt;/li&gt;
&lt;li&gt;Turn off the gateway. Which physical switches, device interactions or nearby phone controls remain available?&lt;/li&gt;
&lt;li&gt;Restart devices and the gateway. Are states and control relationships restored correctly?&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;These are different failures. One successful offline switching test cannot establish that the whole system is independent of gateways and cloud services.&lt;/p&gt;

&lt;h2&gt;
  
  
  Node counts and latency do not provide a ready-made ranking
&lt;/h2&gt;

&lt;p&gt;Capacity and response time matter, but a Mesh label alone cannot answer either question.&lt;/p&gt;

&lt;p&gt;Classic SIG Mesh forwarding uses Managed Flooding, which is not unconditional repetition by every device. Relay configuration, TTL and message caching regulate it. Mesh 1.1 introduced &lt;a href="https://www.bluetooth.com/mesh-directed-forwarding/" rel="noopener noreferrer"&gt;Directed Forwarding&lt;/a&gt;, using path-related mechanisms to improve efficiency. Support and activation depend on the stack and configuration.&lt;/p&gt;

&lt;p&gt;Battery-operated devices should not be assumed to act as constantly available relays. Low Power and Friend mechanisms let low-power nodes reduce continuous reception while a Friend temporarily stores messages. Saving energy affects delivery timing, so battery life must be considered alongside interaction requirements.&lt;/p&gt;

&lt;p&gt;Device placement, reporting frequency, relay count, retransmissions and application load are more useful than an isolated maximum-node number. A few devices reporting frequently create different pressure from many lamps occasionally receiving a group command.&lt;/p&gt;

&lt;p&gt;Later articles will examine concrete arrangements, messages and metrics. Without common test conditions, there is no defensible ranking of which solution is faster or more reliable.&lt;/p&gt;

&lt;h2&gt;
  
  
  Choose what you need to control and maintain
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Direction&lt;/th&gt;
&lt;th&gt;Main purpose&lt;/th&gt;
&lt;th&gt;Responsibility or prerequisite&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Custom/proprietary Mesh&lt;/td&gt;
&lt;td&gt;Tailor communication and networking to a product&lt;/td&gt;
&lt;td&gt;Protocol quality, security, maintenance, supplier dependence and integration costs&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;SIG Mesh&lt;/td&gt;
&lt;td&gt;Use common networking, security and device-model standards&lt;/td&gt;
&lt;td&gt;Stack capabilities, model compatibility, provisioning, configuration and interoperability tests&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Xiaomi Mesh integration&lt;/td&gt;
&lt;td&gt;Bring eligible devices into Xiaomi Home&lt;/td&gt;
&lt;td&gt;Current platform process, product definition, SDK, identity, binding and gateway support&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;This is not necessarily an exclusive choice. A product can use SIG Mesh and implement Xiaomi Home requirements, use SIG Mesh with a privately managed gateway and application, or retain a proprietary solution for existing products and specific needs.&lt;/p&gt;

&lt;p&gt;For our Mesh-to-Matter gateway, standard models provide useful boundaries: define the Bluetooth device behavior first, then map devices and states into Matter. That mapping must handle supported functions, state changes and recovery. Similar model names do not finish the bridge for us.&lt;/p&gt;

&lt;p&gt;If the objective is integrating existing Xiaomi Home products, start with their permitted integration methods and available capabilities. If you also own device firmware, you can design models, key management and gateway interfaces together. Those starting points imply very different workloads.&lt;/p&gt;

&lt;p&gt;Next: &lt;strong&gt;what must be added to a custom Bluetooth broadcast protocol to build a real multihop Mesh?&lt;/strong&gt; We will examine duplicates, forwarding limits, acknowledgements and security before deciding whether to build it ourselves.&lt;/p&gt;

&lt;p&gt;If you work on Bluetooth devices, lighting or gateways, &lt;a href="https://linktr.ee/weiyii" rel="noopener noreferrer"&gt;get in touch&lt;/a&gt;. Device counts, power arrangements and the intended platform make a more useful starting point than “I want Mesh.”&lt;/p&gt;

&lt;p&gt;Cover: &lt;a href="https://commons.wikimedia.org/wiki/File:Tapo_smart_LED_bulb_lighting_sample.jpg" rel="noopener noreferrer"&gt;Japanwikisan&lt;/a&gt;, &lt;a href="https://creativecommons.org/licenses/by/4.0/" rel="noopener noreferrer"&gt;CC BY 4.0&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Originally published at &lt;a href="https://ay3s.com/en/articles/bluetooth-mesh-private-sig-xiaomi-comparison/" rel="noopener noreferrer"&gt;ay3s.com&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>iot</category>
      <category>bluetooth</category>
      <category>embedded</category>
    </item>
    <item>
      <title>Making Monitoring Alerts Useful: Fleetd Triggers, Recovery and Delivery</title>
      <dc:creator>weiyi</dc:creator>
      <pubDate>Sat, 07 Nov 2026 01:16:33 +0000</pubDate>
      <link>https://dev.to/weiyi/making-monitoring-alerts-useful-fleetd-triggers-recovery-and-delivery-353e</link>
      <guid>https://dev.to/weiyi/making-monitoring-alerts-useful-fleetd-triggers-recovery-and-delivery-353e</guid>
      <description>&lt;p&gt;Putting servers and routers in one dashboard makes life easier, but monitoring is only half finished if you still have to open the page every day to discover a problem. Alerts are the obvious next step: high CPU, a nearly full disk, a missing machine.&lt;/p&gt;

&lt;p&gt;Writing a threshold rule is easy. Making the notification useful is harder. If every brief spike produces mail and every continuing fault repeats every few seconds, important messages become easy to ignore. Conversely, no email does not necessarily mean everything is healthy.&lt;/p&gt;

&lt;p&gt;This fifth Fleetd article describes v0.3.0. After &lt;a href="https://ay3s.com/en/articles/fleetd-linux-openwrt-agent-deployment/" rel="noopener noreferrer"&gt;deploying the agent on Linux and OpenWrt&lt;/a&gt;, we now follow reports into alert records, notifications and resolution.&lt;/p&gt;

&lt;h2&gt;
  
  
  What does an alert actually mean?
&lt;/h2&gt;

&lt;p&gt;Fleetd checks offline reporting, CPU, memory, disk space, inodes, failed services, abnormal containers and WireGuard handshake age. Connection-address changes are separate, one-off events.&lt;/p&gt;

&lt;p&gt;These signals have different meanings. Disk pressure may soon block writes; high CPU may be a planned build; an old WireGuard handshake may reflect an idle peer. Crossing a threshold does not, by itself, prove a business outage.&lt;/p&gt;

&lt;p&gt;A useful alert first identifies &lt;strong&gt;the machine, the object and the condition&lt;/strong&gt;. Diagnosis and response depend on the machine's role. Fleetd provides concrete checks, not automatic root-cause analysis, and it does not restart services simply because CPU is high.&lt;/p&gt;

&lt;h2&gt;
  
  
  Separate spikes from sustained load
&lt;/h2&gt;

&lt;p&gt;CPU and memory default to 90%, with a five-minute sustained window:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;alerts&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;offline&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;40s&lt;/span&gt;
  &lt;span class="na"&gt;cpu_percent&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="m"&gt;90&lt;/span&gt;
  &lt;span class="na"&gt;mem_percent&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="m"&gt;90&lt;/span&gt;
  &lt;span class="na"&gt;sustain&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;5m&lt;/span&gt;
  &lt;span class="na"&gt;disk_percent&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="m"&gt;90&lt;/span&gt;
  &lt;span class="na"&gt;inode_percent&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="m"&gt;90&lt;/span&gt;
  &lt;span class="na"&gt;wg_handshake&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;5m&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;These are the v0.3.0 defaults, not universal recommendations. They are server-wide settings; there are no independent thresholds per machine in this configuration.&lt;/p&gt;

&lt;p&gt;Consider a short task that drives CPU to 98% and then finishes, versus a machine whose load stays high. These are illustrative cases, not measured incidents. A sustained window filters the first and draws attention to the second, where you might investigate a queue, an abnormal process or expected heavy work.&lt;/p&gt;

&lt;p&gt;Fleetd takes the minimum CPU and memory values among samples in the recent window. &lt;strong&gt;If the minimum exceeds the threshold, all received samples in that set exceed it.&lt;/strong&gt; This is neither an average nor a count of isolated violations. A value exactly equal to 90% does not exceed 90%.&lt;/p&gt;

&lt;p&gt;It also requires the oldest sample to be sufficiently old, allowing a thirty-second coverage tolerance. The five-minute default therefore does not imply waiting exactly five full minutes. The implementation does not require a minimum sample count or verify that every sampling gap is small. It evaluates received samples with a coverage allowance, not uninterrupted observation.&lt;/p&gt;

&lt;p&gt;Memory usage is calculated from total memory minus &lt;code&gt;MemAvailable&lt;/code&gt;, divided by total memory. It does not simply treat all Linux cache as unavailable, and a memory alert is not a diagnosis of an application leak.&lt;/p&gt;

&lt;h2&gt;
  
  
  Offline means reports stopped arriving
&lt;/h2&gt;

&lt;p&gt;Agents normally report basic metrics every ten seconds; the server evaluates alerts every five seconds. With the default threshold, about forty seconds without a report makes a machine eligible for an offline alert at a subsequent evaluation.&lt;/p&gt;

&lt;p&gt;The server uses its own receipt timestamp rather than the agent's clock for this check. Still, the cause could be a stopped agent, power loss, a router outage, DNS failure or an unreachable Fleetd server path. The alert alone cannot distinguish them.&lt;/p&gt;

&lt;p&gt;The threshold tolerates several missed reports rather than reacting to one missing sample. Evaluation scheduling, database work and mail delivery also affect notification time: this is not a promise of an email exactly forty seconds after disconnection.&lt;/p&gt;

&lt;p&gt;Two safeguards reduce false alarms. An approved machine that has never reported is not treated as an outage. After server startup, new offline alerts wait through a grace period of &lt;code&gt;offline + 15s&lt;/code&gt;, about fifty-five seconds with defaults, allowing agents to reconnect.&lt;/p&gt;

&lt;p&gt;That means enrollment still requires checking a real first report: silence from a newly approved machine does not prove successful setup. And if the Fleetd server itself stops, it cannot evaluate or send alerts. Monitoring the monitoring service requires an independent external check.&lt;/p&gt;

&lt;h2&gt;
  
  
  Losing contact must not resolve an existing fault
&lt;/h2&gt;

&lt;p&gt;Suppose a machine has an active disk alert and then loses its connection. There is no new disk information. Resolving the disk alert merely because no current violation was observed would give a misleading recovery message.&lt;/p&gt;

&lt;p&gt;Fleetd preserves active alerts on offline machines. It neither opens nor resolves other state alerts from their stale data, and adds an offline alert once allowed by the grace period.&lt;/p&gt;

&lt;p&gt;When reports resume, evaluation continues from the available data. The offline alert may resolve while the disk alert remains. Restored communication is not restored disk capacity.&lt;/p&gt;

&lt;h2&gt;
  
  
  Slow collectors have a different timescale
&lt;/h2&gt;

&lt;p&gt;Disk, service, container and WireGuard data are normally collected every six basic reporting rounds, roughly once a minute. Evaluating every five seconds cannot turn that into five-second real-time observation.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Check&lt;/th&gt;
&lt;th&gt;Current trigger&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Disk space&lt;/td&gt;
&lt;td&gt;Mount usage exceeds its threshold&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Inodes&lt;/td&gt;
&lt;td&gt;Used inode percentage exceeds its threshold&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Services&lt;/td&gt;
&lt;td&gt;A failed systemd unit is reported&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Containers&lt;/td&gt;
&lt;td&gt;Restarting, unhealthy status, or nonzero exit&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;WireGuard&lt;/td&gt;
&lt;td&gt;A previously handshaking peer exceeds the handshake-age limit&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Disk and inode alerts do not use the CPU five-minute window. They evaluate the latest stored slow report. Inodes matter separately because a filesystem can have bytes available but no capacity to create more files.&lt;/p&gt;

&lt;p&gt;Containers exiting successfully with code 0 are ignored: a finished one-off task is not necessarily a fault. Nonzero exits, unhealthy status and the &lt;code&gt;restarting&lt;/code&gt; state trigger alerts. This is not restart-frequency analysis; the evaluator does not count restarts per minute. A running container also does not prove its business endpoint works.&lt;/p&gt;

&lt;p&gt;WireGuard checks only peers with a previous handshake, skipping peers that have never handshaken. It compares the agent's report time with the handshake timestamp rather than mixing in the server's clock. An old handshake is a clue, not a complete connectivity test. Understand traffic and keepalive behavior before enabling the rule for intermittently active peers. &lt;code&gt;wg_handshake: 0&lt;/code&gt; disables it globally; there are no per-peer exclusions here.&lt;/p&gt;

&lt;h2&gt;
  
  
  Resolution means the rule no longer matches
&lt;/h2&gt;

&lt;p&gt;Each evaluation calculates the desired set of alerts and compares it with unresolved records in the database. New entries open, absent entries resolve and continuing entries remain. Keys distinguish machines and monitored objects, such as individual mounts or containers.&lt;/p&gt;

&lt;p&gt;For an online machine, a rule that no longer matches can resolve the existing alert. With CPU and memory, one sample at or below the threshold breaks the “all samples above” condition. There is no separate lower recovery threshold or “healthy for another two minutes” requirement. A sustained opening condition does not imply a sustained recovery condition.&lt;/p&gt;

&lt;p&gt;Slow data has another boundary. A basic report without new slow data preserves the previous slow report. But if a new slow report contains an empty list because a collector tool disappeared or failed, an old object-specific alert can disappear too.&lt;/p&gt;

&lt;p&gt;For example, a previously failed service may no longer be listed after its collection command fails. The implementation does not fully distinguish a successful healthy check from an unavailable check for each collector. A resolved record therefore is not independent proof of business recovery. As the previous article explained, failed-service collection uses systemd commands, not a complete procd health check on OpenWrt.&lt;/p&gt;

&lt;h2&gt;
  
  
  Deduplication does not guarantee delivery
&lt;/h2&gt;

&lt;p&gt;Fleetd does not create a fresh record or send a fresh opening notification every five seconds for the same continuing alert. When the rule clears, it generates a resolution change. Opening and resolution changes from one evaluation are combined into one email.&lt;/p&gt;

&lt;p&gt;The aggregation boundary is that evaluation, not a multi-minute window. There is no recurring reminder schedule for an unresolved fault. One-off events such as address changes have their own notification path and are not all merged into periodic evaluation mail.&lt;/p&gt;

&lt;p&gt;Alert state is written before email is sent asynchronously. If sending fails, the server logs an error; there is no durable delivery queue or automatic retry. A record in the dashboard does not prove an email arrived. Continued silence might mean the same fault remains open, and the next evaluation will not automatically resend a failed opening notification.&lt;/p&gt;

&lt;p&gt;Deduplication reduces noise but does not replace reliable delivery, reminders, acknowledgment or escalation. Those remain possible improvements.&lt;/p&gt;

&lt;h2&gt;
  
  
  Email is an output channel, not the only record
&lt;/h2&gt;

&lt;p&gt;SMTP sends changes to configured recipients. Without a host or recipients, notifications are logged and alert state remains visible in the dashboard. &lt;code&gt;language: zh&lt;/code&gt; selects Chinese server alerts and email; the web interface language is a separate browser-side choice.&lt;/p&gt;

&lt;p&gt;Metrics are retained for seven days and resolved alerts for ninety days, with periodic cleanup. An old alert can therefore remain after its detailed metric history is gone. Longer-term investigations require an explicit retention plan.&lt;/p&gt;

&lt;p&gt;A changed connection address is a one-off event when an existing address changes, not an ongoing fault that waits for the old IP to return. It may simply reflect a different network exit.&lt;/p&gt;

&lt;h2&gt;
  
  
  Validate the complete notification chain
&lt;/h2&gt;

&lt;p&gt;For a small fleet, first make opening, recording, notification and resolution understandable, then tune thresholds. These are suggested acceptance scenarios, not faults already induced in production.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Scenario&lt;/th&gt;
&lt;th&gt;What to observe&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Brief CPU spike&lt;/td&gt;
&lt;td&gt;One high sample should not create a sustained alert&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Sustained high test samples&lt;/td&gt;
&lt;td&gt;Coverage requirements produce one opening, not repeated openings&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Reports stop during an active fault&lt;/td&gt;
&lt;td&gt;Preserve the existing fault and add offline when eligible&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Reports resume but the fault remains&lt;/td&gt;
&lt;td&gt;Resolve offline while retaining the original fault&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;SMTP unavailable&lt;/td&gt;
&lt;td&gt;Dashboard record and delivery error log; no assumed retry&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Collector unavailable&lt;/td&gt;
&lt;td&gt;Check whether missing data affects resolution&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Use controlled data in an isolated environment for thresholds and time windows. There is no need to fill a production root filesystem or disconnect a router carrying your remote access.&lt;/p&gt;

&lt;p&gt;Existing tests cover parts of slow-alert classification, including disks, normal and abnormal container exits, and WireGuard handshake conditions. An end-to-end test also covers a report producing a disk alert. They do not establish complete coverage of all transitions and mail delivery.&lt;/p&gt;

&lt;p&gt;Fleetd currently aims for explainable alerts in a small self-hosted environment: what triggered them, why they are not repeated, when they close and where notification can fail. Explicit collector availability and data freshness, reliable mail delivery and per-machine rules are useful next steps.&lt;/p&gt;

&lt;p&gt;The next article returns to agent maintenance: signed update verification, version checks and the boundaries of failure recovery.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://github.com/weiyi0/fleetd" rel="noopener noreferrer"&gt;Fleetd repository&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://weiyi0.github.io/fleetd/guide/alerts.html" rel="noopener noreferrer"&gt;Alert documentation&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/weiyi0/fleetd/blob/v0.3.0/server/internal/server/alerts.go" rel="noopener noreferrer"&gt;v0.3.0 evaluation and transitions&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/weiyi0/fleetd/blob/v0.3.0/server/internal/server/agents.go" rel="noopener noreferrer"&gt;Report storage and memory calculation&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/weiyi0/fleetd/blob/v0.3.0/server/internal/server/mail.go" rel="noopener noreferrer"&gt;Email delivery&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/weiyi0/fleetd/blob/v0.3.0/deploy/server.example.yaml" rel="noopener noreferrer"&gt;Example configuration&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Originally published at &lt;a href="https://ay3s.com/en/articles/fleetd-useful-monitoring-alerts/" rel="noopener noreferrer"&gt;ay3s.com&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>linux</category>
      <category>opensource</category>
      <category>go</category>
      <category>devops</category>
    </item>
    <item>
      <title>One Go Agent on Linux and OpenWrt: Fleetd Deployment Choices</title>
      <dc:creator>weiyi</dc:creator>
      <pubDate>Sat, 07 Nov 2026 01:16:14 +0000</pubDate>
      <link>https://dev.to/weiyi/one-go-agent-on-linux-and-openwrt-fleetd-deployment-choices-1l8o</link>
      <guid>https://dev.to/weiyi/one-go-agent-on-linux-and-openwrt-fleetd-deployment-choices-1l8o</guid>
      <description>&lt;p&gt;Installing an agent on a cloud server and on a home router initially looks like the same job: copy an executable, write a configuration file and start it. Long-term operation raises different questions. Who starts it after a reboot? What if the network is not ready? Where are the logs? Will device identity and command records survive a restart?&lt;/p&gt;

&lt;p&gt;Fleetd manages Linux servers alongside OpenWrt and iStoreOS routers. After covering &lt;a href="https://ay3s.com/en/articles/fleetd-nat-router-agent-enrollment/" rel="noopener noreferrer"&gt;enrollment&lt;/a&gt; and &lt;a href="https://ay3s.com/en/articles/fleetd-browser-command-signing-trust-boundaries/" rel="noopener noreferrer"&gt;browser-signed commands&lt;/a&gt;, this article focuses on making the agent a persistent, diagnosable system service. The implementation described is v0.3.0. Its installer supports amd64 and arm64, with systemd or OpenWrt's procd; that does not mean every Linux-based device is supported.&lt;/p&gt;

&lt;h2&gt;
  
  
  One codebase, architecture-specific binaries
&lt;/h2&gt;

&lt;p&gt;OpenWrt is Linux too. Connections, authentication, command authorization and basic kernel metrics can share code. Fleetd therefore does not maintain separate server-machine and router agents. It builds the same source for Linux, producing amd64 and arm64 executables.&lt;/p&gt;

&lt;p&gt;“The same agent” means shared source and protocol, not an interchangeable binary. An amd64 executable cannot simply run on arm64.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Reported architecture&lt;/th&gt;
&lt;th&gt;Installer selection&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;code&gt;x86_64&lt;/code&gt;, &lt;code&gt;amd64&lt;/code&gt;
&lt;/td&gt;
&lt;td&gt;&lt;code&gt;amd64&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;code&gt;aarch64&lt;/code&gt;, &lt;code&gt;arm64&lt;/code&gt;
&lt;/td&gt;
&lt;td&gt;&lt;code&gt;arm64&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Anything else&lt;/td&gt;
&lt;td&gt;The current installer stops&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;OpenWrt supports many more devices, including MIPS and 32-bit ARM, which this installation path does not cover. Go's cross-compilation support is not a project compatibility guarantee. Adding an architecture also requires checking dependencies, artifacts, installer detection, updates and behavior on real hardware.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;uname -m&lt;/code&gt; is a useful first check. The kernel, userspace and available system facilities still matter.&lt;/p&gt;

&lt;h2&gt;
  
  
  A single executable reduces runtime preparation
&lt;/h2&gt;

&lt;p&gt;The agent is built with &lt;code&gt;CGO_ENABLED=0&lt;/code&gt;, reducing reliance on the target's dynamically linked C environment. Target machines need neither a Go compiler nor a Node.js or Python runtime to start the agent. That helps on routers with limited storage and a small software installation.&lt;/p&gt;

&lt;p&gt;It does not remove every prerequisite. The network must be reachable, HTTPS needs a working certificate trust environment, configuration storage must be writable, and the kernel must provide the required facilities. Some collectors also call external programs: container information uses &lt;code&gt;docker&lt;/code&gt;, while WireGuard information uses &lt;code&gt;wg&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;The useful distinction is between a lighter base deployment and optional capabilities that still have dependencies.&lt;/p&gt;

&lt;h2&gt;
  
  
  Detect the environment before installing a service
&lt;/h2&gt;

&lt;p&gt;The installer follows this sequence:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Require root and identify the CPU architecture.&lt;/li&gt;
&lt;li&gt;Detect systemd or an OpenWrt procd environment.&lt;/li&gt;
&lt;li&gt;Download the matching agent from your Fleetd server.&lt;/li&gt;
&lt;li&gt;Run its &lt;code&gt;version&lt;/code&gt; command to check that the executable can at least start.&lt;/li&gt;
&lt;li&gt;Create or preserve configuration, install the binary, and register and start its service.&lt;/li&gt;
&lt;li&gt;Print the device fingerprint for verification and approval in the dashboard.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Downloading successfully only proves that a file arrived. Running &lt;code&gt;version&lt;/code&gt; also checks basic executability. Neither proves that long-lived connections, collection, permissions, boot startup or firmware-upgrade recovery work correctly.&lt;/p&gt;

&lt;p&gt;The installer prefers &lt;code&gt;curl&lt;/code&gt; and falls back to &lt;code&gt;wget&lt;/code&gt;. On a minimal system, check that the installed tool supports the required HTTPS requests. A universal package-manager command would be misleading because OpenWrt versions and firmware bundles differ.&lt;/p&gt;

&lt;p&gt;Initial installation has a specific trust boundary. The server extracts the executable from an uploaded release bundle whose signature it verifies. The installation script trusts that server and HTTPS; it does not independently verify the downloaded binary's signature on the target. Later agent-verified update bundles use a different flow, covered in the update article.&lt;/p&gt;

&lt;h2&gt;
  
  
  systemd and procd supervise the same process
&lt;/h2&gt;

&lt;p&gt;After installation, the existing service manager owns the process lifecycle.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Item&lt;/th&gt;
&lt;th&gt;systemd machine&lt;/th&gt;
&lt;th&gt;OpenWrt / procd machine&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Executable&lt;/td&gt;
&lt;td&gt;&lt;code&gt;/usr/local/bin/fleetd-agent&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;/usr/bin/fleetd-agent&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Configuration&lt;/td&gt;
&lt;td&gt;&lt;code&gt;/etc/fleetd/agent.yaml&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;/etc/fleetd/agent.yaml&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Service definition&lt;/td&gt;
&lt;td&gt;&lt;code&gt;/etc/systemd/system/fleetd-agent.service&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;/etc/init.d/fleetd-agent&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;State on a fresh install&lt;/td&gt;
&lt;td&gt;&lt;code&gt;/var/lib/fleetd&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;/etc/fleetd&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Logs&lt;/td&gt;
&lt;td&gt;systemd journal&lt;/td&gt;
&lt;td&gt;OpenWrt system log&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;The systemd unit points &lt;code&gt;ExecStart&lt;/code&gt; at the agent, uses &lt;code&gt;Restart=always&lt;/code&gt; with a five-second restart delay, and orders startup against &lt;code&gt;network-online.target&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;The OpenWrt branch creates a &lt;code&gt;USE_PROCD=1&lt;/code&gt; init file with a boot order, process command and respawn settings. Standard output and standard error go to the system log. Both branches run the same agent entry point and read the same kind of YAML configuration. Distribution-specific details remain in installation and service integration rather than spreading through the connection protocol.&lt;/p&gt;

&lt;p&gt;There are two recovery mechanisms: &lt;strong&gt;the service manager handles process exit; the agent handles connection loss.&lt;/strong&gt; An unreachable server need not kill the process: the agent can retry with backoff. Conversely, reconnection code cannot run after its process exits.&lt;/p&gt;

&lt;p&gt;Startup order is not proof of remote availability either. A network target or late boot position cannot ensure DNS, the upstream connection and the Fleetd server are all ready. Handling connection failure remains necessary.&lt;/p&gt;

&lt;h2&gt;
  
  
  On OpenWrt, storage location matters
&lt;/h2&gt;

&lt;p&gt;This difference directly affects the replay protection discussed previously. &lt;code&gt;/var/lib/fleetd&lt;/code&gt; is normally suitable for persistent state on a server. In common OpenWrt layouts, &lt;code&gt;/var&lt;/code&gt; relies on temporary RAM storage. Restarting a process and rebooting the device have different consequences for files there.&lt;/p&gt;

&lt;p&gt;The OpenWrt installer therefore sets &lt;code&gt;state_dir&lt;/code&gt; to &lt;code&gt;/etc/fleetd&lt;/code&gt;. Three files have distinct roles:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;File&lt;/th&gt;
&lt;th&gt;Purpose&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;agent.yaml&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Connection, trusted keys, permissions and state-directory settings&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;agent.key&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;The agent's own identity key&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;seen.json&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Accepted request IDs for replay protection&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;The first two default to &lt;code&gt;/etc/fleetd&lt;/code&gt;. &lt;code&gt;seen.json&lt;/code&gt; follows &lt;code&gt;state_dir&lt;/code&gt;: &lt;code&gt;/var/lib/fleetd&lt;/code&gt; on a fresh systemd installation and &lt;code&gt;/etc/fleetd&lt;/code&gt; on a fresh OpenWrt installation.&lt;/p&gt;

&lt;p&gt;Regenerating a lost identity key produces a different device identity. Losing replay records also removes the basis for promising that previously accepted requests still within their validity window will be recognized as duplicates.&lt;/p&gt;

&lt;p&gt;Ask whether the configured path actually maps to persistent storage, not just whether writing a file succeeds. Custom firmware, read-only layouts and unusual mounts need their own checks.&lt;/p&gt;

&lt;p&gt;Flash persistence also has a write cost. The current agent updates replay records when it accepts new authorized requests; it does not write each ten-second metrics report into this file. If it evolves into a high-frequency task executor, persistence frequency and flash characteristics will need reassessment. There is no measured endurance or throughput guarantee here.&lt;/p&gt;

&lt;h2&gt;
  
  
  Preserving configuration does not restore the service automatically
&lt;/h2&gt;

&lt;p&gt;The OpenWrt installer adds &lt;code&gt;/etc/fleetd/&lt;/code&gt; to &lt;code&gt;/etc/sysupgrade.conf&lt;/code&gt;. That helps retain configuration and identity during upgrade procedures that support and enable configuration preservation. It does not also guarantee retention of &lt;code&gt;/usr/bin/fleetd-agent&lt;/code&gt; or &lt;code&gt;/etc/init.d/fleetd-agent&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;After upgrading firmware, configuration may survive while the executable or init file needs reinstalling. Factory resets and upgrades explicitly discarding configuration are outside that preservation mechanism.&lt;/p&gt;

&lt;p&gt;Before treating recovery as complete, check:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Whether configuration and identity survived.&lt;/li&gt;
&lt;li&gt;Whether the executable and service definition exist and still work.&lt;/li&gt;
&lt;li&gt;Whether the restored agent has the same fingerprint.&lt;/li&gt;
&lt;li&gt;Whether missing reports reflect a stopped service, unavailable network or pending approval.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;These are recommended checks, not a claim that a firmware-flashing experiment was performed for this article.&lt;/p&gt;

&lt;p&gt;Rerunning the current installer preserves an existing &lt;code&gt;agent.yaml&lt;/code&gt;, replaces the executable and rewrites the service definition. That is useful for recovery, but newly supplied &lt;code&gt;--permission&lt;/code&gt;, &lt;code&gt;--server&lt;/code&gt; and &lt;code&gt;--signer&lt;/code&gt; options will not automatically override the preserved configuration. An old, incorrect OpenWrt state path will not fix itself either. Inspect the configuration and restart the agent after changing it.&lt;/p&gt;

&lt;h2&gt;
  
  
  A shared agent does not mean identical monitoring coverage
&lt;/h2&gt;

&lt;p&gt;Basic metrics primarily come from Linux &lt;code&gt;/proc&lt;/code&gt;: CPU, memory, load, uptime and cumulative interface traffic. These interfaces provide a common foundation. CPU utilization and network rates need two samples. The first sample after startup is not a complete measurement interval. If an interface is recreated and counters decrease, the agent skips that rate calculation instead of reporting an invalid difference.&lt;/p&gt;

&lt;p&gt;Extended collection depends on the environment:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Collector&lt;/th&gt;
&lt;th&gt;Current dependency&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Failed services&lt;/td&gt;
&lt;td&gt;&lt;code&gt;systemctl list-units --state=failed&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Containers&lt;/td&gt;
&lt;td&gt;&lt;code&gt;docker ps -a&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;WireGuard peers&lt;/td&gt;
&lt;td&gt;&lt;code&gt;wg show all dump&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Running under procd does not mean procd service-health collection is implemented. Failed-service collection still uses systemd. If a tool is absent or fails, that collector returns no data while basic monitoring can continue. This avoids making Docker a requirement for every router, but &lt;strong&gt;missing fault data does not prove that every service is healthy&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;The current implementation does not fully explain every missing-capability condition. Troubleshooting must distinguish an inapplicable feature, missing tool, failed invocation and genuinely empty result. They are not all “zero faults.”&lt;/p&gt;

&lt;p&gt;Basic reports are scheduled every ten seconds. Disks, services, containers and WireGuard are collected every six reporting rounds. That is a scheduling policy, not a strict real-time guarantee: external commands, network problems and system load can affect timing.&lt;/p&gt;

&lt;h2&gt;
  
  
  Validate the operating chain
&lt;/h2&gt;

&lt;p&gt;For a resident agent, the important chain is startup, supervision, reconnection and preservation of identity and configuration after reboot. On systemd, start with status and recent logs:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;systemctl status fleetd-agent
journalctl -u fleetd-agent -n 50 --no-pager
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;On OpenWrt, inspect the system log:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;logread -e fleetd
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;These are diagnostic commands, not device reboots. To apply changed configuration, restart the agent with &lt;code&gt;systemctl restart fleetd-agent&lt;/code&gt; on systemd or &lt;code&gt;/etc/init.d/fleetd-agent restart&lt;/code&gt; on OpenWrt.&lt;/p&gt;

&lt;p&gt;Then verify approval and advancing report timestamps in the dashboard, allowing subsequent CPU and network samples to arrive. A monitoring-only device can remain on &lt;code&gt;monitor&lt;/code&gt;; validation does not require enabling root commands.&lt;/p&gt;

&lt;p&gt;Schedule whole-device reboots and firmware-upgrade checks in a maintenance window, especially on a router providing your internet or remote access. Returning automatically with the same fingerprint after a controlled reboot is stronger operational evidence than repeatedly running &lt;code&gt;version&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;The project's CI includes tests and amd64/arm64 builds. Successful cross-compilation does not validate every OpenWrt image on real hardware. This article provides no measured RAM, CPU-overhead or minimum-flash figures; check free space and observe your own workload.&lt;/p&gt;

&lt;p&gt;Fleetd shares protocol and agent logic while keeping service-manager and filesystem differences explicit. That reuses code without treating a router as a small server with an identical filesystem. Next, we will look at making alerts useful once metrics are being collected.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://github.com/weiyi0/fleetd" rel="noopener noreferrer"&gt;Fleetd repository&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://weiyi0.github.io/fleetd/guide/machines.html" rel="noopener noreferrer"&gt;Agent enrollment documentation&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/weiyi0/fleetd/blob/v0.3.0/server/internal/server/install.sh.tmpl" rel="noopener noreferrer"&gt;v0.3.0 installer and service configuration&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/weiyi0/fleetd/blob/v0.3.0/agent/cmd/fleetd-agent/main.go" rel="noopener noreferrer"&gt;Agent startup and reporting schedule&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/weiyi0/fleetd/blob/v0.3.0/agent/internal/collect/collect.go" rel="noopener noreferrer"&gt;Metrics collection&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/weiyi0/fleetd/blob/v0.3.0/deploy/build.sh" rel="noopener noreferrer"&gt;Build configuration&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Originally published at &lt;a href="https://ay3s.com/en/articles/fleetd-linux-openwrt-agent-deployment/" rel="noopener noreferrer"&gt;ay3s.com&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>linux</category>
      <category>opensource</category>
      <category>go</category>
      <category>devops</category>
    </item>
    <item>
      <title>Why Sign Remote Commands in the Browser? Fleetd Authorization and Trust Boundaries</title>
      <dc:creator>weiyi</dc:creator>
      <pubDate>Sat, 07 Nov 2026 01:15:55 +0000</pubDate>
      <link>https://dev.to/weiyi/why-sign-remote-commands-in-the-browser-fleetd-authorization-and-trust-boundaries-38lc</link>
      <guid>https://dev.to/weiyi/why-sign-remote-commands-in-the-browser-fleetd-authorization-and-trust-boundaries-38lc</guid>
      <description>&lt;p&gt;Once a machine is connected to a dashboard, running commands from the browser is an obvious next step. Checking a disk, restarting a service or opening a terminal makes managing servers and routers easier. It also gives the dashboard the ability to change those machines. A monitoring outage and a compromised command interface have very different consequences.&lt;/p&gt;

&lt;p&gt;The &lt;a href="https://ay3s.com/en/articles/fleetd-nat-router-agent-enrollment/" rel="noopener noreferrer"&gt;previous article&lt;/a&gt; covered outbound connections, device approval and identity. This article follows the next decision: if an agent already trusts its server, why verify a browser signature before running a command? The details below describe Fleetd v0.3.0. Signing adds an independent check, but its assumptions include the code served to the browser and what happens after an interactive terminal opens.&lt;/p&gt;

&lt;h2&gt;
  
  
  A dashboard session is not unlimited authority
&lt;/h2&gt;

&lt;p&gt;In a conventional design, the administrator logs in, the server authorizes an operation, and the agent executes the server's message. Execution authority is concentrated at the server.&lt;/p&gt;

&lt;p&gt;Fleetd adds a local question: &lt;strong&gt;did a key trusted by this machine authorize this operation?&lt;/strong&gt; The browser constructs and signs a request, the server forwards it, and the agent checks the signature against its own configuration. Login and connection authentication remain necessary; they answer different questions.&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Confirm targets and command → Browser signs the request
→ Server forwards it → Agent checks authorization → Execution
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;A message arriving through an authenticated connection does not automatically qualify for execution.&lt;/p&gt;

&lt;h2&gt;
  
  
  Sign the whole operation
&lt;/h2&gt;

&lt;p&gt;Signing only the word &lt;code&gt;uptime&lt;/code&gt; leaves unanswered which machine may run it, when, and whether the same request can be submitted again. Fleetd signs an envelope containing these fields:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Field&lt;/th&gt;
&lt;th&gt;Purpose&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;v&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Protocol version&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;id&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Identify this authorization and detect repeated requests&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;kind&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Command execution or terminal opening&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;targets&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Authorized machine fingerprints&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;code&gt;argv&lt;/code&gt; or &lt;code&gt;action&lt;/code&gt;
&lt;/td&gt;
&lt;td&gt;Program and arguments, or a locally configured action&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;code&gt;issued_at&lt;/code&gt;, &lt;code&gt;expires_at&lt;/code&gt;
&lt;/td&gt;
&lt;td&gt;Acceptance window&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;timeout&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Runtime timeout, subject to the agent's limit&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;The current command form wraps its input as &lt;code&gt;['sh', '-c', input]&lt;/code&gt;. Entering &lt;code&gt;uptime&lt;/code&gt; signs a request containing those arguments. Pipes and &lt;code&gt;&amp;amp;&amp;amp;&lt;/code&gt; work because the interface explicitly invokes a shell.&lt;/p&gt;

&lt;p&gt;The browser serializes the request into JSON bytes and signs them with Ed25519. The agent verifies those exact bytes before decoding the JSON. Changing &lt;code&gt;uptime&lt;/code&gt; to &lt;code&gt;reboot&lt;/code&gt;, or adding another target, invalidates the existing signature. If several machines were included originally, each may legitimately execute the request: target binding constrains scope rather than requiring a single target.&lt;/p&gt;

&lt;h2&gt;
  
  
  The agent evaluates the authorization
&lt;/h2&gt;

&lt;p&gt;Each agent stores a &lt;code&gt;trusted_signers&lt;/code&gt; list. A public key included with a request must already be trusted locally. Otherwise anyone could generate a key and authorize their own commands.&lt;/p&gt;

&lt;p&gt;Beyond the signature, the agent checks the request type, its own fingerprint in the target list, timestamps and local permissions. Unknown JSON fields are rejected to avoid inconsistent interpretations of the request.&lt;/p&gt;

&lt;p&gt;The browser creates requests valid for five minutes. The agent allows two minutes of clock skew and rejects declared validity intervals longer than ten minutes. Five minutes describes the acceptance window, not how long a command may run. Runtime timeout is separate. The skew allowance also means acceptance does not stop at an exact five-minute boundary. Both ends still need reasonably correct clocks.&lt;/p&gt;

&lt;p&gt;Together these checks ask whether this trusted authorization applies to this machine now.&lt;/p&gt;

&lt;h2&gt;
  
  
  Replay protection is not exactly-once execution
&lt;/h2&gt;

&lt;p&gt;An unchanged, correctly signed request can still be sent repeatedly. Fleetd gives each request an ID generated from 16 random bytes. After authorization succeeds, the agent records the ID and rejects another use of it.&lt;/p&gt;

&lt;p&gt;The record is persisted in &lt;code&gt;seen.json&lt;/code&gt; in the state directory, which defaults to &lt;code&gt;/var/lib/fleetd&lt;/code&gt;. With that state retained, an ordinary process restart does not make still-valid requests reusable. If persistence fails, execution does not proceed.&lt;/p&gt;

&lt;p&gt;This is not an exactly-once guarantee for business effects. The ID is recorded before the concurrency check and process launch. A request can therefore consume its ID without starting because all execution slots are occupied. Conversely, a command may already have changed the machine before a disconnect prevents the dashboard from receiving its result.&lt;/p&gt;

&lt;p&gt;Clicking Run again creates a new ID and a new authorization. The agent cannot infer whether you are replacing a failed attempt or repeating a completed operation. For upgrades, configuration changes and database migrations, inspect the real state and design for idempotency where possible. State loss or disk rollback also differs from an ordinary process restart; persistent replay records do not magically survive either.&lt;/p&gt;

&lt;h2&gt;
  
  
  Local permission still applies
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Permission&lt;/th&gt;
&lt;th&gt;What the agent accepts&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;monitor&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Monitoring; no commands or terminals&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;allowlist&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Trusted, signed requests for locally configured actions&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;full&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Trusted, signed arbitrary commands and terminal requests&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;A newly enrolled monitoring-only machine can stay on &lt;code&gt;monitor&lt;/code&gt;. For a small set of maintenance actions, an allowlist can narrow authority. For example, on a systemd machine with nginx installed:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;permission&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;allowlist&lt;/span&gt;
&lt;span class="na"&gt;allowlist&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;nginx-status&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="pi"&gt;[&lt;/span&gt;&lt;span class="nv"&gt;systemctl&lt;/span&gt;&lt;span class="pi"&gt;,&lt;/span&gt; &lt;span class="nv"&gt;is-active&lt;/span&gt;&lt;span class="pi"&gt;,&lt;/span&gt; &lt;span class="nv"&gt;nginx&lt;/span&gt;&lt;span class="pi"&gt;]&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This is only a permission configuration fragment; connection settings and trusted public keys are still required. A signed request carries &lt;code&gt;action: nginx-status&lt;/code&gt;, while the agent obtains the actual executable and arguments from its own configuration. The sender cannot append arbitrary arguments, and a request cannot contain both &lt;code&gt;action&lt;/code&gt; and &lt;code&gt;argv&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The v0.3.0 command form sends shell commands and has no preset-action selector.&lt;/strong&gt; Typing &lt;code&gt;nginx-status&lt;/code&gt; into it will not invoke this action on an allowlist-only machine. The protocol and UI do not yet offer the same level of support.&lt;/p&gt;

&lt;p&gt;Under the current deployment model the agent runs as root, so &lt;code&gt;full&lt;/code&gt; commands have corresponding authority. A signature cannot determine whether a command is mistaken or destructive. Nor is local configuration immutable: an authorized root command can modify it. Local policy limits unauthorized requests, not the power of an already authorized root process.&lt;/p&gt;

&lt;h2&gt;
  
  
  Browser keys have a lifecycle
&lt;/h2&gt;

&lt;p&gt;WebCrypto generates the Ed25519 key pair with a non-extractable private key, and IndexedDB stores the pair. The normal registration flow sends the public key to the server, not the private signing key.&lt;/p&gt;

&lt;p&gt;Switching computers or clearing browser site data can therefore remove the ability to sign requests that existing agents recognize, even when login still works. A new browser needs a new key, and the agents must trust its public key. Registering it on the server does not automatically update existing installations.&lt;/p&gt;

&lt;p&gt;Revocation also has to reach the agents. &lt;strong&gt;Deleting a public key from the dashboard does not revoke it on already configured machines.&lt;/strong&gt; Remove it from their &lt;code&gt;trusted_signers&lt;/code&gt; lists and restart the agents using the appropriate service manager.&lt;/p&gt;

&lt;p&gt;The release-signing key is separate. Command signing authorizes an operation; release signing authenticates an agent update package. A later article will cover that update lifecycle.&lt;/p&gt;

&lt;h2&gt;
  
  
  Two important trust boundaries
&lt;/h2&gt;

&lt;h3&gt;
  
  
  The server also distributes the frontend
&lt;/h3&gt;

&lt;p&gt;Non-extractable means normal WebCrypto APIs cannot export the private key material. It does not prevent malicious same-origin code from invoking the key to sign.&lt;/p&gt;

&lt;p&gt;Fleetd serves its management UI from the server. A compromised server may distribute modified JavaScript during a later visit. That page could display one command and sign another, or otherwise misuse an existing key. A confirmation dialog supplied by the same page cannot independently prove the page is trustworthy.&lt;/p&gt;

&lt;p&gt;The agent can reject modified requests without valid signatures, but &lt;strong&gt;trusted frontend code remains an assumption&lt;/strong&gt;. Distributing a signing tool separately could reduce this dependency. The design document mentions a CLI signer; v0.3.0 does not implement it.&lt;/p&gt;

&lt;h3&gt;
  
  
  Only opening a terminal is signed
&lt;/h3&gt;

&lt;p&gt;Opening a terminal uses a signed &lt;code&gt;kind: shell&lt;/code&gt; request and requires local &lt;code&gt;full&lt;/code&gt; permission. Subsequent keystrokes use the existing session without individual browser signatures. A compromised server could inject input into an already-open terminal.&lt;/p&gt;

&lt;p&gt;Open interactive sessions when needed and close them afterwards. A clearly scoped one-shot command is often easier to review than an ongoing interactive session. The initial signature does not protect every later input in the same way.&lt;/p&gt;

&lt;p&gt;Signing also does not hide commands or output. Encryption between agent and server protects the network path, but the server is an endpoint. This is not browser-to-agent confidentiality that excludes the server.&lt;/p&gt;

&lt;h2&gt;
  
  
  Look at rejection paths
&lt;/h2&gt;

&lt;p&gt;Successful output is the obvious demo. Authorization also needs clear failure cases. Existing Fleetd tests cover modified payloads, untrusted keys, wrong targets, expired or future requests, insufficient permissions and duplicate IDs after replay state is reloaded. These tests constrain individual rules; they are not a complete security audit and do not automatically test malicious frontend delivery, terminal input or every deployment environment.&lt;/p&gt;

&lt;p&gt;For a self-hosted operator, the useful result is an explainable chain: which keys are trusted, which machines were authorized, when a request is acceptable, what local policy permits and how duplicates are handled. The preset-action UI, independent signing and terminal protection remain concrete areas to improve.&lt;/p&gt;

&lt;p&gt;Next comes a deployment question: how does the same Go agent run on both ordinary Linux servers and OpenWrt routers?&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://github.com/weiyi0/fleetd" rel="noopener noreferrer"&gt;Fleetd repository&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://weiyi0.github.io/fleetd/guide/commands.html" rel="noopener noreferrer"&gt;Commands and terminals&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/weiyi0/fleetd/blob/v0.3.0/web/src/signer.js" rel="noopener noreferrer"&gt;Browser signing, v0.3.0&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/weiyi0/fleetd/blob/v0.3.0/agent/internal/authz/authz.go" rel="noopener noreferrer"&gt;Agent authorization and replay protection&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/weiyi0/fleetd/blob/v0.3.0/agent/internal/authz/authz_test.go" rel="noopener noreferrer"&gt;Authorization tests&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Originally published at &lt;a href="https://ay3s.com/en/articles/fleetd-browser-command-signing-trust-boundaries/" rel="noopener noreferrer"&gt;ay3s.com&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>linux</category>
      <category>opensource</category>
      <category>go</category>
      <category>devops</category>
    </item>
  </channel>
</rss>
