<?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 subscribe to group address in mesh</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/103664/how-to-subscribe-to-group-address-in-mesh</link><description>Hello, 
 Could someone point to a tutorial or doc, where I can learn how to subscribe to a group in mesh in code. I can do this using the nRF app, however, I would like to do this in code. 
 The purpose for this is that instead of the client asking for</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 19 Sep 2023 15:43:30 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/103664/how-to-subscribe-to-group-address-in-mesh" /><item><title>RE: How to subscribe to group address in mesh</title><link>https://devzone.nordicsemi.com/thread/446716?ContentTypeID=1</link><pubDate>Tue, 19 Sep 2023 15:43:30 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1fcb8bb7-bd02-4e53-ae40-4e8a7c387a52</guid><dc:creator>Shahin97</dc:creator><description>&lt;p&gt;All sorted,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Seems I missed&amp;nbsp;&lt;/p&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;pre class="ui-code" data-mode="text"&gt;.send_ttl = BT_MESH_TTL_DEFAULT,&lt;/pre&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;/div&gt;
&lt;div&gt;Thank you for your help!&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to subscribe to group address in mesh</title><link>https://devzone.nordicsemi.com/thread/446054?ContentTypeID=1</link><pubDate>Thu, 14 Sep 2023 11:49:27 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:95c9dfd7-a0ce-479e-9696-a49b574f6cd4</guid><dc:creator>tesc</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
[quote user=""]The purpose for this is that instead of the client asking for the temperature, I would like the server to periodically send the temperature.[/quote]
&lt;p&gt;Please note that through use of periodic publishing you can configure the device once to periodically send the temperature. If periodic publishing to the configured publish address covers your needs, then you can rely on functionality already implemented in the stack.&lt;/p&gt;
[quote user=""]&lt;p&gt;I believe the way to do this is through:&amp;nbsp;&lt;/p&gt;
&lt;div&gt;&lt;div style="max-width:100%;overflow:auto;max-height:none;"&gt;&lt;div&gt;&lt;a href="#"&gt;Fullscreen&lt;/a&gt;&lt;div style="width:100%;height:14.1667px;"&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;[/quote]
&lt;p&gt;Yes, for publishing to a different address than the currently configured publish address, you can use &lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrf/libraries/bluetooth_services/mesh/sensor_srv.html#c.bt_mesh_sensor_srv_pub"&gt;bt_mesh_sensor_srv_pub()&lt;/a&gt;. If you want to publish to the currently configured publish address, then you can instead use &lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrf/libraries/bluetooth_services/mesh/sensor_srv.html#c.bt_mesh_sensor_srv_sample"&gt;bt_mesh_sensor_srv_sample()&lt;/a&gt; which in addition handles getting the current sensor reading before publishing.&lt;/p&gt;
[quote user=""]I am unsure what to change ctx (if that even is the correct variable) for a group address or a specific address.[/quote]
&lt;p&gt;The ctx parameter is a &lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/zephyr/connectivity/bluetooth/api/mesh/msg.html#c.bt_mesh_msg_ctx"&gt;struct bt_mesh_msg_ctx&lt;/a&gt;, where the uint16_t addr field is the one to use for the address. You can use that field both for unicast addresses and group addresses.&lt;/p&gt;
&lt;p&gt;Regards,&lt;br /&gt;Terje&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>