<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://devzone.nordicsemi.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>how to use Mesh &amp;quot;group&amp;quot; in Serial example</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/35036/how-to-use-mesh-group-in-serial-example</link><description>In simple on/off example, the client can turn on several server nodes in the same group in the same time, 
 but in serial example mix simple on/off server, the info center only show to set on to one server node, 
 
 1. is it possible to turn on all the</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 11 Jun 2018 11:54:51 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/35036/how-to-use-mesh-group-in-serial-example" /><item><title>RE: how to use Mesh "group" in Serial example</title><link>https://devzone.nordicsemi.com/thread/135557?ContentTypeID=1</link><pubDate>Mon, 11 Jun 2018 11:54:51 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:87788cce-ff02-4175-8327-2402cf2ed67d</guid><dc:creator>Jui-Chou (Rick) Chung</dc:creator><description>&lt;p&gt;Hello AgathaKuan,&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;A1: Yes, it is possible. The procedure is like this:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Provisioned and configured each node
&lt;ol&gt;
&lt;li&gt;During configure a node, please also set a node to subscribe to a group address&lt;/li&gt;
&lt;/ol&gt;
&lt;/li&gt;
&lt;li&gt;Register the group address to be an active address subscription&lt;/li&gt;
&lt;li&gt;Set the SimpleOnOff&amp;nbsp;client model to publish the message to the group address&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="powershell"&gt;db = MeshDB(&amp;quot;database/example_database.json&amp;quot;)
db.provisioners
p = Provisioner(device, db)

p.scan_start()
p.scan_stop()
p.provision(uuid = &amp;quot;0059XXXXXXXXXXXXXXXXXXXXXXXXXXXX&amp;quot;) #Provisioning for first node
cc = ConfigurationClient(db)
cc.publish(8, 0)
cc.appkey_add(0)
cc.model_app_bind(db.node[0].unicast_address, 0, mt.ModelId(0, 0x59))
cc.model_subscription(db.node[0].unicast_address, 0xc001, mt.ModelId(0, 0x59)

p.provision(uuid = &amp;quot;0059YYYYYYYYYYYYYYYYYYYYYYYYYYYY&amp;quot;) #Provisioning for second node
cc.publish(9, 0)
cc.appkey_add(0)
cc.model_app_bind(db.node[1].unicast_address, 0, mt.ModelId(0, 0x59))
cc.model_subscription(db.node[1].unicast_address, 0xc001, mt.ModelId(0, 0x59)

device.send(cmd.AddrsubscriptionAdd(0xc001) # You will get an address handle for 0xc001

sc_group = SimpleOnOffClient()
device.model_add(sc_group)
sc_group.publish_set(0, 1) # The second parameter is the group address handle we just got
sc_group.set(True) &lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;A2: If devices are under different subnet, they are using different network key, and messages won&amp;#39;t be relayed. Since every relay node will check if it has the correct network key for the received packets. If the network key is not correct, the relay node will drop it simply.&lt;/p&gt;
&lt;p&gt;A3: I believe the reason why device key handle starts from 8 is because&amp;nbsp;this will help developers to distinguish between device key handle and ordinary application key handle easier.&lt;/p&gt;
&lt;p&gt;Hope the upon information can do help.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Rick&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>