<?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 Serial Example?</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/29282/how-to-use-mesh-serial-example</link><description>I have a PCA10040 working with the mesh sdk.v1.0.0 serial example. I can do an Echo via the Python interactive_syaci and get a back a response. I have seen the documentation with the commands and events. However, other than the example showing how to</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 11 Jan 2018 10:44:34 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/29282/how-to-use-mesh-serial-example" /><item><title>RE: How to use Mesh Serial Example?</title><link>https://devzone.nordicsemi.com/thread/116474?ContentTypeID=1</link><pubDate>Thu, 11 Jan 2018 10:44:34 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4274c396-3094-4d80-b6c9-8502bf6b3cda</guid><dc:creator>Thomas Stenersen</dc:creator><description>&lt;p&gt;The devices in the example are connected on UART, but the provisioning is happening via the normal provisioning protocol. You can use the same method for any provisionee device, e.g., the light switch server.
In &lt;code&gt;provisioning.py&lt;/code&gt; there is two simple provisionee and provisioner interfaces. Using the provisioner as in the example documentation is as easy as:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;p = Provisioner(d[0])
p.scan_start()
p.provision()
&lt;/code&gt;&lt;/pre&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to use Mesh Serial Example?</title><link>https://devzone.nordicsemi.com/thread/116473?ContentTypeID=1</link><pubDate>Wed, 10 Jan 2018 12:24:04 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b5f89fd8-10de-4791-88ce-9d370524d3ae</guid><dc:creator>Simon</dc:creator><description>&lt;p&gt;Thanks for pointer to sample but as I mentioned in original question, I have seen that. It&amp;#39;s not the same as my scenario as I need to provision nearby unprovisioned deviced not connected via UART.
I now have the serial example seeing my unprovisioned devices. I am getting multiple:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;2018-01-10 12:14:00,611 - INFO - COM6: {event: ProvUnprovisionedReceived, data: {&amp;#39;uuid&amp;#39;: bytearray(b&amp;#39;\xc2\xa8\xd0\xbe\x8
1\xc6\x1co\xce\x12}\x19\xd5LQz&amp;#39;), &amp;#39;adv_addr_type&amp;#39;: 1, &amp;#39;rssi&amp;#39;: 208, &amp;#39;gatt_supported&amp;#39;: 0, &amp;#39;adv_addr&amp;#39;: bytearray(b&amp;#39;\xce\x12
}\x19\xd5\xcc&amp;#39;)}}
2018-01-10 12:16:41,936 - INFO - COM6: {event: ProvUnprovisionedReceived, data: {&amp;#39;uuid&amp;#39;: bytearray(b&amp;quot;v\r5\n\x0b\x89ZT~\x
bf\x1d\x10\&amp;#39;\x84\xa3\xf9&amp;quot;), &amp;#39;adv_addr_type&amp;#39;: 1, &amp;#39;rssi&amp;#39;: 205, &amp;#39;gatt_supported&amp;#39;: 0, &amp;#39;adv_addr&amp;#39;: bytearray(b&amp;quot;~\xbf\x1d\x10\
&amp;#39;\xc4&amp;quot;)}}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;How do I provision these devices via the PyACI command line?&lt;/p&gt;
&lt;p&gt;Thanks
Simon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to use Mesh Serial Example?</title><link>https://devzone.nordicsemi.com/thread/116470?ContentTypeID=1</link><pubDate>Tue, 09 Jan 2018 15:01:19 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c58a7a30-2424-4f03-b644-6aafb4ec6def</guid><dc:creator>Thomas Stenersen</dc:creator><description>&lt;p&gt;ScanStart should start make your device start listening for unprovisioned device beacons. If you connect two devices, the following set of commands should give:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;In [7]: d[0].send(cmd.ScanStart())
2018-01-09 15:58:34,881 - DEBUG - ttyACM1: parsed_packet {event: CmdRsp, data: {&amp;#39;opcode&amp;#39;: 97, &amp;#39;}
2018-01-09 15:58:34,881 - INFO - ttyACM1: Success
In [8]: d[1].send(cmd.Listen())
2018-01-09 15:58:43,279 - DEBUG - ttyACM2: parsed_packet {event: CmdRsp, data: {&amp;#39;opcode&amp;#39;: 100, }
2018-01-09 15:58:43,280 - INFO - ttyACM2: Success
2018-01-09 15:58:44,520 - DEBUG - ttyACM1: parsed_packet {event: ProvUnprovisionedReceived, data: {&amp;#39;uui...
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;code&gt;cmd.Listen()&lt;/code&gt; starts the unprovisioned node beacon for the second device. Have you tested this example &lt;a href="http://infocenter.nordicsemi.com/topic/com.nordic.infocenter.meshsdk.v1.0.0/md_scripts_interactive_pyaci_README.html?cp=4_1_0_4_1_3"&gt;infocenter.nordicsemi.com/.../md_scripts_interactive_pyaci_README.html&lt;/a&gt; ?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to use Mesh Serial Example?</title><link>https://devzone.nordicsemi.com/thread/116469?ContentTypeID=1</link><pubDate>Tue, 09 Jan 2018 12:32:57 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5ac90bcc-6886-4718-a79c-8fbb1bb6a6e2</guid><dc:creator>Simon</dc:creator><description>&lt;p&gt;I still don&amp;#39;t understand what the ScanStart does and how to use it to provision devices.&lt;/p&gt;
&lt;p&gt;With an unprovisioned device (the light server sample + beacon sample mix as discussed in &lt;a href="https://devzone.nordicsemi.com/question/160939/mesh-sdk-beaconing-instructions/"&gt;devzone.nordicsemi.com/.../&lt;/a&gt; except using v1.0 mesh) in range, a ScanStart just returns &amp;quot;Success&amp;quot;. How do I then see them and then provision them?&lt;/p&gt;
&lt;p&gt;Also, I think there might be another bug. If I start the Serial sample while the unprovisioned device is powered, the python UI returns a timeout, even for a simple Echo. If I power off the unprovisioned device, start the serial sample, and then power the unprovisioned device, the Python commands work ok. Looks like something in the Serial init gets mixed up when there are unprovisioned devices present.&lt;/p&gt;
&lt;p&gt;Thanks&lt;/p&gt;
&lt;p&gt;Simon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to use Mesh Serial Example?</title><link>https://devzone.nordicsemi.com/thread/116467?ContentTypeID=1</link><pubDate>Tue, 09 Jan 2018 11:48:21 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8db91720-1750-4920-963b-97f73b532fae</guid><dc:creator>Thomas Stenersen</dc:creator><description>&lt;p&gt;Great :) We&amp;#39;ll put the fix in the next release.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to use Mesh Serial Example?</title><link>https://devzone.nordicsemi.com/thread/116468?ContentTypeID=1</link><pubDate>Tue, 09 Jan 2018 11:46:23 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5a0ce881-654d-44a2-8969-a345ed44b487</guid><dc:creator>Simon</dc:creator><description>&lt;p&gt;I have the BeacoNStart working now thanks. It was the data I was sending to BeaconStart that was preventing it working.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to use Mesh Serial Example?</title><link>https://devzone.nordicsemi.com/thread/116471?ContentTypeID=1</link><pubDate>Tue, 09 Jan 2018 11:38:25 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d1bbeaba-875b-46d0-ad38-2ce8f35a1335</guid><dc:creator>Thomas Stenersen</dc:creator><description>&lt;p&gt;I tested this on my desk, so that&amp;#39;s a bit weird :/ It&amp;#39;s no problem that the advertiser is enabled with no packets in its queue. It will start sending the advertisements as soon as there is a packet ready. I&amp;#39;ve updated my answer with my testing. Are you able to send an echo command to the device?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to use Mesh Serial Example?</title><link>https://devzone.nordicsemi.com/thread/116472?ContentTypeID=1</link><pubDate>Tue, 09 Jan 2018 11:22:41 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6cf628f6-10b3-42b9-884b-9c475815ebdb</guid><dc:creator>Simon</dc:creator><description>&lt;p&gt;Thomas&lt;/p&gt;
&lt;p&gt;Thanks for the fix but the BeaconStart still doesn&amp;#39;t work. Breakpoint shows it gets to advertiser_enable() but there&amp;#39;s still no advertising. p_adv-&amp;gt;p_packet is null in advertiser_enable().&lt;/p&gt;
&lt;p&gt;Simon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to use Mesh Serial Example?</title><link>https://devzone.nordicsemi.com/thread/116466?ContentTypeID=1</link><pubDate>Tue, 09 Jan 2018 08:28:36 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6cd99eb9-27c4-4740-bfc6-8d487eeb6ae4</guid><dc:creator>Thomas Stenersen</dc:creator><description>&lt;p&gt;Hi Simon,&lt;/p&gt;
&lt;p&gt;Unfortunately it looks like you&amp;#39;ve hit an bug caused by a change in our advertiser API. For the beacon to be sent, its advertiser instance has to be enabled. To fix this, apply the following diff to &lt;code&gt;mesh/serial/src/serial_handler_device.c&lt;/code&gt;:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;@@ -156,6 +156,16 @@ static void handle_cmd_device_beacon_start(const serial_packet_t * p_cmd)
     }
     else
     {
+        if (m_beacons[p_cmd-&amp;gt;payload.cmd.device.beacon_stop.beacon_slot].state != BEACON_STATE_RUNNING)
+        {
+            advertiser_enable(&amp;amp;m_beacons[p_cmd-&amp;gt;payload.cmd.device.beacon_start.beacon_slot].advertiser);
+        }
+        else
+        {
+            /* Clear the previous beacon. */
+            advertiser_flush(&amp;amp;m_beacons[p_cmd-&amp;gt;payload.cmd.device.beacon_start.beacon_slot].advertiser);
+        }
+
         uint32_t data_length = p_cmd-&amp;gt;length -
             SERIAL_PACKET_LENGTH_OVERHEAD -
             BEACON_START_CMD_DATA_OVERHEAD;
@@ -195,6 +205,7 @@ static void handle_cmd_device_beacon_stop(const serial_packet_t * p_cmd)
     }
     else
     {
+        advertiser_flush(&amp;amp;m_beacons[p_cmd-&amp;gt;payload.cmd.device.beacon_start.beacon_slot].advertiser);
         advertiser_disable(&amp;amp;m_beacons[p_cmd-&amp;gt;payload.cmd.device.beacon_stop.beacon_slot].advertiser);
         m_beacons[p_cmd-&amp;gt;payload.cmd.device.beacon_stop.beacon_slot].state = BEACON_STATE_UNUSED;
     }
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;code&gt;cmd.ScanStart()&lt;/code&gt; should start scanning for nearby unprovisioned beacons. The example actually provisions the connected devices over BLE, the UART is just to control them. You can, e.g., program the light switch server on a separate device and use the serial interface to provision it.&lt;/p&gt;
&lt;p&gt;The PB-remote serial interface is unfortunately not very well supported at this point. It is not a part of the example in the current Mesh SDK version.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Edit:&lt;/strong&gt; The beacon slot is a configurable parameter that allows you to run multiple beacon instances. The number of slots is defined in &lt;code&gt;mesh/serial/api/nrf_mesh_config_serial.h&lt;/code&gt; in the &lt;code&gt;NRF_MESH_SERIAL_BEACON_SLOTS&lt;/code&gt; define. It defaults to 1.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Edit 2:&lt;/strong&gt; Attached pre-compiled serial example for nrf52832 with s132 v5.0. Compiled on Ubuntu/Linux with &lt;code&gt;arm-none-eabi-gcc&lt;/code&gt;:&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/serial_5F00_nrf52832_5F00_xxAA_5F00_s132_5F00_5.0.0.hex"&gt;serial_nrf52832_xxAA_s132_5.0.0.hex&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Running this:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;python interactive_pyaci.py -d /dev/ttyACM1 --no-logfile    

To control your device, use d[x], where x is the device index.
Devices are indexed based on the order of the COM ports specified by the -d option.
The first device, d[0], can also be accessed using device.

Type d[x]. and hit tab to see the available methods.

Python 3.5.2 (default, Nov 17 2016, 17:05:23) 
Type &amp;#39;copyright&amp;#39;, &amp;#39;credits&amp;#39; or &amp;#39;license&amp;#39; for more information
IPython 6.1.0 -- An enhanced Interactive Python. Type &amp;#39;?&amp;#39; for help.

In [1]: device.send(cmd.BeaconStart(0, [0x01 + len(&amp;quot;test&amp;quot;), 0x09] + list(map(ord, &amp;quot;test&amp;quot;))))

2018-01-09 12:32:28,999 - INFO - ttyACM1: Success
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Gives:&lt;/p&gt;
&lt;p&gt;&lt;img src="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/61104.Capture.PNG" alt="nRF Connect output" /&gt;&lt;/p&gt;
&lt;p&gt;Hope this helps,&lt;br /&gt;
Thomas&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>