[Zephyr-devel] Zephyr Based Bluetooth Mesh implementation on nRF52840-PDK boards


Steve Brown
 

Hi Vikrant,

On Wed, 2017-11-15 at 13:58 +0530, Vikrant More wrote:
Hello,
I to want build Zephyr based lighting system & for testing I have 3
nRF52840-PDK boards.

I've flashed zephyr/samples/bluetooth/mesh firmware on all three
board.
They are advertising themselves as any other GATT peripheral devices.

As per my understanding they are in unprovisioned state.

Using "NRF connect" Android app I can send data to service (Mesh
Provisioning Service) running on it.

I think this service is for provisioning purpose. Am I right ?

How to do provisioning using meshctl utility (BlueZ 5.47) ?

When I execute meshctl on my ubuntu laptop it gives me following
error -

Local config directory not provided.
Failed to parse local node configuration file local_node.json

I assume you built the bluez 5.47 from source.

The json files live in bluez/mesh. You either have to run meshctl in
that directory or point to it with the "-c" option.

Once in meshctl, the commands:
discover-unprovisioned on
provision <Device UUID>

should get you going.

In the mesh sample the UUID is hardwired to
"dddd0000000000000000000000000000"

Steve


Vikrant More <vikrant8051@...>
 

Thank very much !!

I used your suggested commands. And I got following response - 

[meshctl]# discover-unprovisioned on
set_scan_filter_uuids 00001827-0000-1000-8000-00805f9b34fb
SetDiscoveryFilter failed: org.bluez.Error.InvalidArguments
Discovery started
Adapter property changed 
[CHG] Controller F0:03:8C:B7:5A:18 Discovering: yes



meshctl]# provision dddd0000000000000000000000000000
Device with UUID dddd0000000000000000000000000000 not found.
Stale services? Remove device and re-discover


On Wed, Nov 15, 2017 at 2:32 PM, Steve Brown <sbrown@...> wrote:
Hi Vikrant,

On Wed, 2017-11-15 at 13:58 +0530, Vikrant More wrote:
> Hello,
> I to want build Zephyr based lighting system & for testing I have 3
> nRF52840-PDK boards.
>
> I've flashed  zephyr/samples/bluetooth/mesh firmware on all three
> board.
> They are advertising themselves as any other GATT peripheral devices.
>
> As per my understanding they are in unprovisioned state.
>
> Using "NRF connect" Android app I can send data to service (Mesh
> Provisioning Service) running on it.
>
> I think this service is for provisioning purpose. Am I right ?
>
> How to do provisioning using meshctl utility (BlueZ 5.47) ?
>
> When I execute meshctl on my ubuntu laptop it gives me following
> error -
>
>        Local config directory not provided.
>    Failed to parse local node configuration file local_node.json
>
>
I assume you built the bluez 5.47 from source.

The json files live in bluez/mesh. You either have to run meshctl in
that directory or point to it with the "-c" option.

Once in meshctl, the commands:
discover-unprovisioned on
provision <Device UUID>

should get you going.

In the mesh sample the UUID is hardwired to
"dddd0000000000000000000000000000"

Steve



Steve Brown
 

It looks like you have some kind of problem on the bluez end.

I get the following on the same board.

[meshctl]# discover-unprovisioned on
set_scan_filter_uuids 00001827-0000-1000-8000-00805f9b34fb
SetDiscoveryFilter success
Discovery started
Adapter property changed
[CHG] Controller B8:27:EB:06:2E:57 Discovering: yes
Mesh Provisioning Service (00001827-0000-1000-8000-00805f9b34fb)
Device UUID: dddd0000000000000000000000000000
OOB: 0000


Are you sure you have a 5.47 bluetoothd running?

Steve

On Wed, 2017-11-15 at 16:29 +0530, Vikrant More wrote:
Thank very much !!

I used your suggested commands. And I got following response -

[meshctl]# discover-unprovisioned on
set_scan_filter_uuids 00001827-0000-1000-8000-00805f9b34fb
SetDiscoveryFilter failed: org.bluez.Error.InvalidArguments
Discovery started
Adapter property changed
[CHG] Controller F0:03:8C:B7:5A:18 Discovering: yes



meshctl]# provision dddd0000000000000000000000000000
Device with UUID dddd0000000000000000000000000000 not found.
Stale services? Remove device and re-discover


On Wed, Nov 15, 2017 at 2:32 PM, Steve Brown <sbrown@cortland.com>
wrote:
Hi Vikrant,

On Wed, 2017-11-15 at 13:58 +0530, Vikrant More wrote:
Hello,
I to want build Zephyr based lighting system & for testing I have
3
nRF52840-PDK boards.

I've flashed zephyr/samples/bluetooth/mesh firmware on all three
board.
They are advertising themselves as any other GATT peripheral
devices.

As per my understanding they are in unprovisioned state.

Using "NRF connect" Android app I can send data to service (Mesh
Provisioning Service) running on it.

I think this service is for provisioning purpose. Am I right ?

How to do provisioning using meshctl utility (BlueZ 5.47) ?

When I execute meshctl on my ubuntu laptop it gives me following
error -

Local config directory not provided.
Failed to parse local node configuration file local_node.json

I assume you built the bluez 5.47 from source.

The json files live in bluez/mesh. You either have to run meshctl
in
that directory or point to it with the "-c" option.

Once in meshctl, the commands:
discover-unprovisioned on
provision <Device UUID>

should get you going.

In the mesh sample the UUID is hardwired to
"dddd0000000000000000000000000000"

Steve


Vikrant More <vikrant8051@...>
 

It is working now !!
I run hcitool lescan on another terminal & { discover-unprovisioned on , provision dddd0000000000000000000000000000 } on messhctl terminal.

Output -->
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

[meshctl]# discover-unprovisioned on
set_scan_filter_uuids 00001827-0000-1000-8000-00805f9b34fb
SetDiscoveryFilter success
Discovery started
Adapter property changed 
[CHG] Controller F0:03:8C:B7:5A:18 Discovering: yes
Mesh Provisioning Service (00001827-0000-1000-8000-00805f9b34fb)
Device UUID: dddd0000000000000000000000000000
OOB: 0000
[NEW] Device EA:E8:05:9B:16:1D Zephyr
[meshctl]# provision dddd0000000000000000000000000000
Trying to connect Device EA:E8:05:9B:16:1D Zephyr
Adapter property changed 
[CHG] Controller F0:03:8C:B7:5A:18 Discovering: no
[Zephyr]# Connection successful
[Zephyr]# Service added /org/bluez/hci0/dev_EA_E8_05_9B_16_1D/service0006
Service added /org/bluez/hci0/dev_EA_E8_05_9B_16_1D/service000a
Char added /org/bluez/hci0/dev_EA_E8_05_9B_16_1D/service000a/char000b:
Char added /org/bluez/hci0/dev_EA_E8_05_9B_16_1D/service000a/char000d:
Services resolved yes
Found matching char: path /org/bluez/hci0/dev_EA_E8_05_9B_16_1D/service000a/char000b, uuid 00002adb-0000-1000-8000-00805f9b34fb
Found matching char: path /org/bluez/hci0/dev_EA_E8_05_9B_16_1D/service000a/char000d, uuid 00002adc-0000-1000-8000-00805f9b34fb
Start notification on /org/bluez/hci0/dev_EA_E8_05_9B_16_1D/service000a/char000d
Characteristic property changed /org/bluez/hci0/dev_EA_E8_05_9B_16_1D/service000a/char000d
Notify started
Notify for Mesh Provisioning Out Data started
Open-Node: 0x1444640
Open-Prov: 0x1446380
Open-Prov: proxy 0x144a150
GATT-TX:  03 00 10 
Attempting to write /org/bluez/hci0/dev_EA_E8_05_9B_16_1D/service000a/char000b
Initiated provisioning
Characteristic property changed /org/bluez/hci0/dev_EA_E8_05_9B_16_1D/service000a/char000d
GATT-RX: 03 01 01 00 01 00 00 04 00 08 00 00 00 
Got provisioning data (12 bytes)
01 01 00 01 00 00 04 00 08 00 00 00 
GATT-TX:  03 02 00 00 02 03 04 
Attempting to write /org/bluez/hci0/dev_EA_E8_05_9B_16_1D/service000a/char000b
GATT-TX:  03 03 a8 09 93 50 18 6f 0d 3a cb af 39 40 28 60 
GATT-TX:  9b fa 15 c9 
Attempting to write /org/bluez/hci0/dev_EA_E8_05_9B_16_1D/service000a/char000b
Characteristic property changed /org/bluez/hci0/dev_EA_E8_05_9B_16_1D/service000a/char000d
GATT-RX: 03 03 3a bd 0b 6e 8a d8 dd a9 92 22 a9 3c e4 c7 
GATT-RX: fe c3 f1 08 d9 5b ef ff 56 49 87 aa 64 ca 74 af 
GATT-RX: ed 3d 89 b9 60 9c b8 19 a3 54 16 a4 dd 12 8d 3c 
GATT-RX: f3 79 1c 18 15 2e 64 3a 4a e2 c1 34 19 c7 39 ab 
GATT-RX: 9f e3 
Got provisioning data (65 bytes)
03 3a bd 0b 6e 8a d8 dd a9 92 22 a9 3c e4 c7 fe 
c3 f1 08 d9 5b ef ff 56 49 87 aa 64 ca 74 af ed 
3d 89 b9 60 9c b8 19 a3 54 16 a4 dd 12 8d 3c f3 
79 1c 18 15 2e 64 3a 4a e2 c1 34 19 c7 39 ab 9f 
e3 
Request decimal key (0 - 9999)
[mesh] Enter Numeric key: 1234
GATT-TX:  03 05 79 75 31 d9 3c ce a3 27 2c d7 1b 5d 90 f3 
GATT-TX:  30 27 
Attempting to write /org/bluez/hci0/dev_EA_E8_05_9B_16_1D/service000a/char000b
Characteristic property changed /org/bluez/hci0/dev_EA_E8_05_9B_16_1D/service000a/char000d
GATT-RX: 03 05 eb 68 f7 99 be 18 ef 71 6e 51 10 f6 f5 05 
GATT-RX: d2 40 
Got provisioning data (17 bytes)
05 eb 68 f7 99 be 18 ef 71 6e 51 10 f6 f5 05 d2 
40 
GATT-TX:  03 06 af 78 37 46 88 64 92 8f f1 f4 9c c1 18 95 
GATT-TX:  a7 8d 
Attempting to write /org/bluez/hci0/dev_EA_E8_05_9B_16_1D/service000a/char000b
[Zephyr]#

--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Now what to do next ??
I've repeat this procedure on all three board.

How to control LEDs on these board using meshctl or any android APP ??

Thank You!!



On Thu, Nov 16, 2017 at 10:10 AM, Vikrant More <vikrant8051@...> wrote:
Now I'm able to run "discover-unprovisioned on" this command & o/p is

set_scan_filter_uuids 00001827-0000-1000-8000-00805f9b34fb
SetDiscoveryFilter success
Discovery started
Adapter property changed 
[CHG] Controller F0:03:8C:B7:5A:18 Discovering: ye


But "provision dddd0000000000000000000000000000" is still giving me this o/p-

Device with UUID dddd0000000000000000000000000000 not found.
Stale services? Remove device and re-discover

I'm able to discover & connect nRF52840-PDK board via nRF connect android app.


On Wed, Nov 15, 2017 at 10:01 PM, Steve Brown <sbrown@...> wrote:
More.

If I run the old bluetoothd, I get

[NEW] Controller B8:27:EB:06:2E:57 raspberrypi [default]
[meshctl]# discover-unprovisioned on
set_scan_filter_uuids 00001827-0000-1000-8000-00805f9b34fb
SetDiscoveryFilter failed: org.bluez.Error.InvalidArguments
Discovery started
Adapter property changed
[CHG] Controller B8:27:EB:06:2E:57 Discovering: yes

The same as you.

I'm pretty sure that's your problem.

Steve


On Wed, 2017-11-15 at 21:17 +0530, Vikrant More wrote:
>
> [meshctl]# discover-unprovisioned on
> set_scan_filter_uuids 00001827-0000-1000-8000-00805f9b34fb
> SetDiscoveryFilter failed: org.bluez.Error.InvalidArguments
> Discovery started
> Adapter property changed
> [CHG] Controller F0:03:8C:B7:5A:18 Discovering: yes
>
> I built BlueZ 5.47 as per your style but I am getting same error
> which is mentioned above.
>
> On Nov 15, 2017 5:47 PM, "Steve Brown" <sbrown@...> wrote:
> > I don't recognize that repository. The one I'm using is
> >
> > https://git.kernel.org/pub/scm/bluetooth/bluez.git
> >
> > The json files are in that repository.
> >
> > I run ./bootstrap-configure, then make and sudo make install.
> >
> > You might want to remove your distribution's bluez from your system
> > so
> > there's no confusion over version.
> >
> > Lastly, are you sure that the bluetooth hardware on your computer
> > does
> > ble? If in doubt, try
> > sudo btmgmt info
> >
> > Steve
> >
> > On Wed, 2017-11-15 at 17:12 +0530, Vikrant More wrote:
> > > could you please help how to build https://github.com/hadess/blue
> > z ??
> > >
> > > since here I am not getting configure file to execute -->
> > > ./configure --prefix=/usr  --sysconfdir=/etc  --
> > localstatedir=/var
> > > --enable-library  --disable-systemd  && make
> > >
> > > On Wed, Nov 15, 2017 at 4:52 PM, Steve Brown <sbrown@...
> > >
> > > wrote:
> > > > It looks like you have some kind of problem on the bluez end.
> > > >
> > > > I get the following on the same board.
> > > >
> > > > [meshctl]# discover-unprovisioned on
> > > > set_scan_filter_uuids 00001827-0000-1000-8000-00805f9b34fb
> > > > SetDiscoveryFilter success
> > > > Discovery started
> > > > Adapter property changed
> > > > [CHG] Controller B8:27:EB:06:2E:57 Discovering: yes
> > > >                 Mesh Provisioning Service (00001827-0000-1000-
> > 8000-
> > > > 00805f9b34fb)
> > > >                         Device UUID:
> > > > dddd0000000000000000000000000000
> > > >                         OOB: 0000
> > > >
> > > >
> > > > Are you sure you have a 5.47 bluetoothd running?
> > > >
> > > > Steve
> > > >
> > > >
> > > > On Wed, 2017-11-15 at 16:29 +0530, Vikrant More wrote:
> > > > > Thank very much !!
> > > > >
> > > > > I used your suggested commands. And I got following response
> > -
> > > > >
> > > > > [meshctl]# discover-unprovisioned on
> > > > > set_scan_filter_uuids 00001827-0000-1000-8000-00805f9b34fb
> > > > > SetDiscoveryFilter failed: org.bluez.Error.InvalidArguments
> > > > > Discovery started
> > > > > Adapter property changed
> > > > > [CHG] Controller F0:03:8C:B7:5A:18 Discovering: yes
> > > > >
> > > > >
> > > > >
> > > > > meshctl]# provision dddd0000000000000000000000000000
> > > > > Device with UUID dddd0000000000000000000000000000 not found.
> > > > > Stale services? Remove device and re-discover
> > > > >
> > > > >
> > > > > On Wed, Nov 15, 2017 at 2:32 PM, Steve Brown <sbrown@cortland
> > .com
> > > > >
> > > > > wrote:
> > > > > > Hi Vikrant,
> > > > > >
> > > > > > On Wed, 2017-11-15 at 13:58 +0530, Vikrant More wrote:
> > > > > > > Hello,
> > > > > > > I to want build Zephyr based lighting system & for
> > testing I
> > > > have
> > > > > > 3
> > > > > > > nRF52840-PDK boards.
> > > > > > >
> > > > > > > I've flashed  zephyr/samples/bluetooth/mesh firmware on
> > all
> > > > three
> > > > > > > board.
> > > > > > > They are advertising themselves as any other GATT
> > peripheral
> > > > > > devices.
> > > > > > >
> > > > > > > As per my understanding they are in unprovisioned state.
> > > > > > >
> > > > > > > Using "NRF connect" Android app I can send data to
> > service
> > > > (Mesh
> > > > > > > Provisioning Service) running on it.
> > > > > > >
> > > > > > > I think this service is for provisioning purpose. Am I
> > right
> > > > ?
> > > > > > >
> > > > > > > How to do provisioning using meshctl utility (BlueZ 5.47)
> > ?
> > > > > > >
> > > > > > > When I execute meshctl on my ubuntu laptop it gives me
> > > > following
> > > > > > > error -
> > > > > > >
> > > > > > >        Local config directory not provided.
> > > > > > >    Failed to parse local node configuration file
> > > > local_node.json
> > > > > > >
> > > > > > >
> > > > > > I assume you built the bluez 5.47 from source.
> > > > > >
> > > > > > The json files live in bluez/mesh. You either have to run
> > > > meshctl
> > > > > > in
> > > > > > that directory or point to it with the "-c" option.
> > > > > >
> > > > > > Once in meshctl, the commands:
> > > > > > discover-unprovisioned on
> > > > > > provision <Device UUID>
> > > > > >
> > > > > > should get you going.
> > > > > >
> > > > > > In the mesh sample the UUID is hardwired to
> > > > > > "dddd0000000000000000000000000000"
> > > > > >
> > > > > > Steve
> > > > > >
> > > > >
> > > > >
> > >
> > >



Vikrant More <vikrant8051@...>
 

Could you please share in details documentation for Bluetooth Mesh implementation for Zephyr ?

On Fri, Nov 17, 2017 at 11:43 AM, Vikrant More <vikrant8051@...> wrote:
patch are giving me error. 

So please share original files.

what is original file for bluez-mesh.patch ?


On Fri, Nov 17, 2017 at 11:28 AM, Vikrant More <vikrant8051@...> wrote:
I simply add nrf52840.h & nrf_delay.h from nrf52_SDK into --> zephyr/boards/arm/nrf52840_pca10056.

And include these headder file in main.c ( Zephyr Mesh Example)

After that I add following line for testing of integration of newly added files with Zephyr project.



void main(void)
{
int err;
        
        NRF_P0->DIR |= 0x0001E000;
        NRF_P0->OUTSET |= 0x0001E000;
        
        while(1)
        {
           printk("Initializing...\n");

           NRF_P0->OUT ^= 0x0001E000;
        
          nrf_delay_ms(100);

        } 

/* Initialize the Bluetooth Subsystem */
err = bt_enable(bt_ready);
if (err) {
printk("Bluetooth init failed (err %d)\n", err);
}
}


After executing this on PDK board, I get result as expected .....All four LEDs are blinking continuously.



Next,

I removed above mentioned while loop & edit 

static void gen_onoff_get(struct bt_mesh_model *model,
  struct bt_mesh_msg_ctx *ctx,
  struct net_buf_simple *buf)
{
    NRF_P0->OUT |= 0x0001E000;
}

static void gen_onoff_set(struct bt_mesh_model *model,
  struct bt_mesh_msg_ctx *ctx,
  struct net_buf_simple *buf)
{
    NRF_P0->OUT &= 0xFFFE1FFF;
}


-------------------------------------------------------------------------------------

After giving onoff 1 / get on [on/off: Target=0111]# terminal I get following error -->

Failed to write


After trying same command again it does not reply anything. But LEDs status is also not changes on the Board.

On Thu, Nov 16, 2017 at 7:32 PM, Steve Brown <sbrown@...> wrote:
Here is the code I've been working with.

There is a patch to sample/bluetooth/mesh/main.c and another one to
bluez's mesh stuff.

The first one adds the led code. Some is commented out for working on
another board. I had all 4 leds working at 0100, 0101, 0102 & 0103. Per
the mesh specs, 0100 is the primary element and is the only one with a
config and health server. It also adds an onoff client for the button.
I only hooked up one button. If you want to experiment with group
addresses, you need to configure the button client (element 0100 &
model 1001) to publish to a group address, like c000 and set one or
more buttons to subscribe to c000. That way the button can control more
than one led. Also, the provisioning UUID is set to the MAC address of
the board instead of dddd00...000 so you don't have to power the boards
up one at a time.

You can't use meshctl to send onoff to group addresses. That isn't
implemented yet in the bluez mesh stack.

The bluez's patch adds some informational diagnostics, fixes a bug in
ascii oob input and adds heartbeat and subscribe commands.

I'm certain this is all very buggy, but it's been pretty educational
getting this far.

Steve


On Thu, 2017-11-16 at 19:04 +0530, Vikrant More wrote:
> [meshctl]# configure 0109
> [config: Target = 0109]# add-appkey 1
> [config: Target = 0109]# bind 0 1 1000
> [config: Target = 0109]# back
> [meshctl]# onoff 0109
> [on/off: Target = 0109] onoff 1     // nothing changed on PDK serial
> terminal nor changed LED status
> [on/off: Target = 0109] onoff 0     // nothing changed on PDK serial
> terminal nor changed LED status
>
> I last mail you mentioned that, to change LED status we have to write
> code which will execute after giving onoff 1/0 command.
> So could you please help me it that ?
>
> I know this code to Turn LED1 ON:
> NRF_P0 ->OUT &= ~(1<<13);
>
> & for off -->  NRF_P0 ->OUT |= (1<<13);
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> On Thu, Nov 16, 2017 at 6:42 PM, Steve Brown <sbrown@...>
> wrote:
> > Looks like you are making progress.
> >
> > I'd recommend that you do a "git checkout mesh/*.json" when you
> > start
> > each session. Otherwise, the node/element data accumulates and it's
> > hard to keep track of which node is which. This initializes the
> > first
> > element to 0100.
> >
> > Before you can use the onoff server, you have to issue the
> > following
> > configure commands:
> >
> > add-appkey 1   # that's the appkey that meshctl uses for the onoff
> > app
> > bind 0 1 1000  # this binds that appkey to the onoff server
> >
> > Now the onoff server should be able to accept meshctl onnoff
> > commands.
> >
> > Steve
> >
> > On Thu, 2017-11-16 at 18:26 +0530, Vikrant More wrote:
> > > Thanks !!
> > >
> > > After following your idea,
> > >
> > > On [nRF52840 termianl]-->  provisined ......
> > >                                              Failed to advertise
> > > using Node ID (err -5)
> > >
> > > & after this PDK board stop advertising itself as "Zephyr"
> > >
> > >
> > > If I hit command as "provision dddd0000000000000000000000000000"
> > > then it give as o/p as --> Already provisioned with unicast 0106
> > >
> > > So unicast address is 0106
> > >
> > > Then I run --> configure 0106
> > > [config: Target = 0077]# help
> > >
> > >  Client Configuration Menu
> > > Available commands:
> > >   target <unicast>                          Set target node to
> > > configure
> > >   get-composition [<page_num>]              Get Composition Data
> > >   add-netkey <net_idx>                      Add network key
> > >   del-netkey <net_idx>                      Delete network key
> > >   add-appkey <app_idx>                      Add application key
> > >   del-appkey <app_idx>                      Delete application
> > key
> > >   bind <ele_idx> <app_idx> <mod_id> [cid]   Bind app key to a
> > model
> > >   set-ttl <ttl>                             Set default TTL
> > >   get-ttl                                   Get default TTL
> > >   set-pub <ele_addr> <pub_addr> <app_idx> <period (step|res)>
> > <model>
> > > Set publication
> > >   back                                      Back to main menu
> > >   help                                      Config Commands
> > >
> > >
> > > If I run --> onff 0106       it gives
> > >
> > > [on/off: Target = 0106]# help
> > > Client Configuration Menu
> > > Available commands:
> > >   target <unicast>                          Set node to configure
> > >   get                                       Get ON/OFF status
> > >   onoff <0/1>                               Send "SET ON/OFF"
> > command
> > >   back                                      Back to main menu
> > >   help                                      Config Commands
> > > [on/off: Target = 0106]#
> > >
> > > If I run --> [on/off: Target = 0106]#  onoff 0          it gives
> > > Failed to write
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > > Then we test #
> > >
> > > On Thu, Nov 16, 2017 at 4:53 PM, Steve Brown <sbrown@...
> > >
> > > wrote:
> > > > In the 52840 terminal output, you will see something like:
> > > >
> > > > OOB Number: 6021
> > > >
> > > > That's the number to input to meshctl.
> > > >
> > > > Steve
> > > >
> > > > On Thu, 2017-11-16 at 16:11 +0530, Vikrant More wrote:
> > > > > On [meshctl] --> [mesh] Enter Numeric key:
> > > > > Here I input 1234
> > > > >
> > > > > On [nRF52840 termianl]--> Invalid Confirmation Value
> > > > >
> > > > >
> > > > >
> > > > > -----------------------------------------------------------
> > ----
> > > > ----
> > > > > ------------------------------------------
> > > > >
> > > > > On Thu, Nov 16, 2017 at 2:14 PM, Steve Brown <sbrown@cortland
> > .com
> > > > >
> > > > > wrote:
> > > > > > In looking at the output again, It doesn't look like
> > > > > > provisioningcompleted.
> > > > > >
> > > > > > The out-of-band code is output on the 52840's serial port
> > and
> > > > > > forwarded
> > > > > > to probably /dev/ttyACM0. That's the code you need to
> > enter.
> > > > > >
> > > > > > Steve
> > > > > >
> > > > > > On Thu, 2017-11-16 at 10:45 +0530, Vikrant More wrote:
> > > > > > > It is working now !!
> > > > > > > I run hcitool lescan on another terminal & { discover-
> > > > > > unprovisioned
> > > > > > > on , provision dddd0000000000000000000000000000 } on
> > messhctl
> > > > > > > terminal.
> > > > > > >
> > > > > > > Output -->
> > > > > > > -------------------------------------------------------
> > ----
> > > > ----
> > > > > > ----
> > > > > > > -------------------------------------------------------
> > ----
> > > > ----
> > > > > > ----
> > > > > > > -------------------------------------------------------
> > ----
> > > > ----
> > > > > > ----
> > > > > > > -----------------------------
> > > > > > >
> > > > > > > [meshctl]# discover-unprovisioned on
> > > > > > > set_scan_filter_uuids 00001827-0000-1000-8000-
> > 00805f9b34fb
> > > > > > > SetDiscoveryFilter success
> > > > > > > Discovery started
> > > > > > > Adapter property changed
> > > > > > > [CHG] Controller F0:03:8C:B7:5A:18 Discovering: yes
> > > > > > >               Mesh Provisioning Service (00001827-0000-
> > 1000-
> > > > 8000-
> > > > > > > 00805f9b34fb)
> > > > > > >                       Device UUID:
> > > > > > dddd0000000000000000000000000000
> > > > > > >                       OOB: 0000
> > > > > > > [NEW] Device EA:E8:05:9B:16:1D Zephyr
> > > > > > > [meshctl]# provision dddd0000000000000000000000000000
> > > > > > > Trying to connect Device EA:E8:05:9B:16:1D Zephyr
> > > > > > > Adapter property changed
> > > > > > > [CHG] Controller F0:03:8C:B7:5A:18 Discovering: no
> > > > > > > [Zephyr]# Connection successful
> > > > > > > [Zephyr]# Service added
> > > > > > > /org/bluez/hci0/dev_EA_E8_05_9B_16_1D/service0006
> > > > > > > Service added
> > > > /org/bluez/hci0/dev_EA_E8_05_9B_16_1D/service000a
> > > > > > > Char added
> > > > > > >
> > /org/bluez/hci0/dev_EA_E8_05_9B_16_1D/service000a/char000b:
> > > > > > > Char added
> > > > > > >
> > /org/bluez/hci0/dev_EA_E8_05_9B_16_1D/service000a/char000d:
> > > > > > > Services resolved yes
> > > > > > > Found matching char: path
> > > > > > >
> > /org/bluez/hci0/dev_EA_E8_05_9B_16_1D/service000a/char000b,
> > > > uuid
> > > > > > > 00002adb-0000-1000-8000-00805f9b34fb
> > > > > > > Found matching char: path
> > > > > > >
> > /org/bluez/hci0/dev_EA_E8_05_9B_16_1D/service000a/char000d,
> > > > uuid
> > > > > > > 00002adc-0000-1000-8000-00805f9b34fb
> > > > > > > Start notification on
> > > > > > >
> > /org/bluez/hci0/dev_EA_E8_05_9B_16_1D/service000a/char000d
> > > > > > > Characteristic property changed
> > > > > > >
> > /org/bluez/hci0/dev_EA_E8_05_9B_16_1D/service000a/char000d
> > > > > > > Notify started
> > > > > > > Notify for Mesh Provisioning Out Data started
> > > > > > > Open-Node: 0x1444640
> > > > > > > Open-Prov: 0x1446380
> > > > > > > Open-Prov: proxy 0x144a150
> > > > > > > GATT-TX:  03 00 10
> > > > > > > Attempting to write
> > > > > > >
> > /org/bluez/hci0/dev_EA_E8_05_9B_16_1D/service000a/char000b
> > > > > > > Initiated provisioning
> > > > > > > Characteristic property changed
> > > > > > >
> > /org/bluez/hci0/dev_EA_E8_05_9B_16_1D/service000a/char000d
> > > > > > > GATT-RX:       03 01 01 00 01 00 00 04 00 08 00 00 00
> > > > > > > Got provisioning data (12 bytes)
> > > > > > >        01 01 00 01 00 00 04 00 08 00 00 00
> > > > > > > GATT-TX:  03 02 00 00 02 03 04
> > > > > > > Attempting to write
> > > > > > >
> > /org/bluez/hci0/dev_EA_E8_05_9B_16_1D/service000a/char000b
> > > > > > > GATT-TX:  03 03 a8 09 93 50 18 6f 0d 3a cb af 39 40 28 60
> > > > > > > GATT-TX:  9b fa 15 c9
> > > > > > > Attempting to write
> > > > > > >
> > /org/bluez/hci0/dev_EA_E8_05_9B_16_1D/service000a/char000b
> > > > > > > Characteristic property changed
> > > > > > >
> > /org/bluez/hci0/dev_EA_E8_05_9B_16_1D/service000a/char000d
> > > > > > > GATT-RX:       03 03 3a bd 0b 6e 8a d8 dd a9 92 22 a9 3c
> > e4
> > > > c7
> > > > > > > GATT-RX:       fe c3 f1 08 d9 5b ef ff 56 49 87 aa 64 ca
> > 74
> > > > af
> > > > > > > GATT-RX:       ed 3d 89 b9 60 9c b8 19 a3 54 16 a4 dd 12
> > 8d
> > > > 3c
> > > > > > > GATT-RX:       f3 79 1c 18 15 2e 64 3a 4a e2 c1 34 19 c7
> > 39
> > > > ab
> > > > > > > GATT-RX:       9f e3
> > > > > > > Got provisioning data (65 bytes)
> > > > > > >        03 3a bd 0b 6e 8a d8 dd a9 92 22 a9 3c e4 c7 fe
> > > > > > >        c3 f1 08 d9 5b ef ff 56 49 87 aa 64 ca 74 af ed
> > > > > > >        3d 89 b9 60 9c b8 19 a3 54 16 a4 dd 12 8d 3c f3
> > > > > > >        79 1c 18 15 2e 64 3a 4a e2 c1 34 19 c7 39 ab 9f
> > > > > > >        e3
> > > > > > > Request decimal key (0 - 9999)
> > > > > > > [mesh] Enter Numeric key: 1234
> > > > > > > GATT-TX:  03 05 79 75 31 d9 3c ce a3 27 2c d7 1b 5d 90 f3
> > > > > > > GATT-TX:  30 27
> > > > > > > Attempting to write
> > > > > > >
> > /org/bluez/hci0/dev_EA_E8_05_9B_16_1D/service000a/char000b
> > > > > > > Characteristic property changed
> > > > > > >
> > /org/bluez/hci0/dev_EA_E8_05_9B_16_1D/service000a/char000d
> > > > > > > GATT-RX:       03 05 eb 68 f7 99 be 18 ef 71 6e 51 10 f6
> > f5
> > > > 05
> > > > > > > GATT-RX:       d2 40
> > > > > > > Got provisioning data (17 bytes)
> > > > > > >        05 eb 68 f7 99 be 18 ef 71 6e 51 10 f6 f5 05 d2
> > > > > > >        40
> > > > > > > GATT-TX:  03 06 af 78 37 46 88 64 92 8f f1 f4 9c c1 18 95
> > > > > > > GATT-TX:  a7 8d
> > > > > > > Attempting to write
> > > > > > >
> > /org/bluez/hci0/dev_EA_E8_05_9B_16_1D/service000a/char000b
> > > > > > > [Zephyr]#
> > > > > > >
> > > > > > > -------------------------------------------------------
> > ----
> > > > ----
> > > > > > ----
> > > > > > > -------------------------------------------------------
> > ----
> > > > ----
> > > > > > ----
> > > > > > > -------------------------------------------------------
> > ----
> > > > ----
> > > > > > ----
> > > > > > > -------------------------------------------------------
> > ----
> > > > ----
> > > > > > ----
> > > > > > > -------------------------------------------------------
> > ----
> > > > ----
> > > > > > ----
> > > > > > > ---
> > > > > > >
> > > > > > > Now what to do next ??
> > > > > > > I've repeat this procedure on all three board.
> > > > > > >
> > > > > > > How to control LEDs on these board using meshctl or any
> > > > android
> > > > > > APP
> > > > > > > ??
> > > > > > >
> > > > > > > Thank You!!
> > > > > > >
> > > > > > >
> > > > > > >
> > > > >
> > > > >
> > >
> > >
>
>




Johan Hedberg
 

Hi Vikrant,

On Fri, Nov 17, 2017, Vikrant More wrote:
Could you please share in details documentation for Bluetooth Mesh
implementation for Zephyr ?
The API is documented with the usual doxygen syntax. I'm not sure how
frequently documentation in the master branch gets generated onto the
website, so it might be better for you to generate the documentation
either yourself, or perhaps simpler, look at the header files directly.
They can be found under include/bluetooth/mesh/ in the master branch.

Another good reference is how the mesh sample applications use the API,
so you could look e.g. at samples/bluetooth/src/main.c. Yet another
fairly good reference is the implementation of the foundation models,
which you can find in subsys/bluetooth/host/mesh/cfg_srv.c and
subsys/bluetooth/host/mesh/health_srv.c (note that these are only valid
for the latest master branch since the files were recently renamed).

Johan


Kinder, David B <david.b.kinder@...>
 

The documents from the master branch (including the doxygen API material) are published nightly to docs.zephyrproject.org

-- david kinder

On Nov 16, 2017, at 10:42 PM, Johan Hedberg <johan.hedberg@...> wrote:

Hi Vikrant,

On Fri, Nov 17, 2017, Vikrant More wrote:
Could you please share in details documentation for Bluetooth Mesh
implementation for Zephyr ?

The API is documented with the usual doxygen syntax. I'm not sure how
frequently documentation in the master branch gets generated onto the
website, so it might be better for you to generate the documentation
either yourself, or perhaps simpler, look at the header files directly.
They can be found under include/bluetooth/mesh/ in the master branch.

Another good reference is how the mesh sample applications use the API,
so you could look e.g. at samples/bluetooth/src/main.c. Yet another
fairly good reference is the implementation of the foundation models,
which you can find in subsys/bluetooth/host/mesh/cfg_srv.c and
subsys/bluetooth/host/mesh/health_srv.c (note that these are only valid
for the latest master branch since the files were recently renamed).

Johan
_______________________________________________
Zephyr-devel mailing list
Zephyr-devel@...
https://lists.zephyrproject.org/mailman/listinfo/zephyr-devel


Johan Hedberg
 

Hi David,

On Fri, Nov 17, 2017, Kinder, David B wrote:
The documents from the master branch (including the doxygen API
material) are published nightly to
docs.zephyrproject.org<http://docs.zephyrproject.org>
Thanks, I suppose the right place should then be:

http://docs.zephyrproject.org/api/bluetooth.html#mesh-profile

However, that seems to be broken/incomplete at the moment, since it only
lists the doxygen group bt_mesh but doesn't provide any links to its
subgroups (there are many of them). If I tracked this down right the
page gets generated from doc/api/bluetooth.rst, so that likely needs
fixing. Meanwhile, it seems the best source for Mesh documentation right
now is to look at the header files directly.

Johan


Kinder, David B <david.b.kinder@...>
 

Hmm... indeed something is amiss with generation of the mesh API documentation.
I'm heading out for Thanksgiving vacation, so for now, indeed the header files should be consulted. I'll submit a github issue and look into this more when I return, unless someone else wants to look into this before then.

-- david

-----Original Message-----
From: Johan Hedberg [mailto:johan.hedberg@intel.com]
Sent: Thursday, November 16, 2017 11:43 PM
To: Kinder, David B <david.b.kinder@intel.com>
Cc: Vikrant More <vikrant8051@gmail.com>; zephyr-
users@lists.zephyrproject.org; zephyr-devel@lists.zephyrproject.org
Subject: Re: [Zephyr-devel] Zephyr Based Bluetooth Mesh implementation
on nRF52840-PDK boards

Hi David,

On Fri, Nov 17, 2017, Kinder, David B wrote:
The documents from the master branch (including the doxygen API
material) are published nightly to
docs.zephyrproject.org<http://docs.zephyrproject.org>
Thanks, I suppose the right place should then be:

http://docs.zephyrproject.org/api/bluetooth.html#mesh-profile

However, that seems to be broken/incomplete at the moment, since it only
lists the doxygen group bt_mesh but doesn't provide any links to its
subgroups (there are many of them). If I tracked this down right the page
gets generated from doc/api/bluetooth.rst, so that likely needs fixing.
Meanwhile, it seems the best source for Mesh documentation right now is to
look at the header files directly.

Johan