Topics

Unable to set Static Address on nRF52 using Zephyr v1.11.0

Gurpreet Singh <gurpreet@...>
 

Hi,
I've been chugging along nicely with Zephyr v1.11.0 and the nRF52DK so far, being able to get it to scan and advertise using the hci_uart sample code and my Linux (ubuntu) computer. 
My linux is on BlueZ 5.48 and kernel ​4.15.0-22. This setup is just to get the ball rolling until we get sample boards from our manufacturer. 

I have run into an issue where setting the address on the chip is being rejected. 
I came across this post in the forum, but have been unable to find any clean resolution for it. 
For advertisements, you can see the all zero source mac address in the attached PCAP. 
Interestingly, the same error persists even when following the blog post on how to use the BLE controller with linux's BlueZ. (Step 5 in particular) ​
--- btmgmt
[hci1]# static-addr FF:02:03:04:05:FF
Set static address failed with status 0x0b (Rejected)
[hci1]#

--- btmon
@ MGMT Command: Set Static Address (0x002b) plen 6 {0x0004} [hci1] 9585.454699
Address: FF:02:03:04:05:FF (Static)
@ MGMT Event: Command Status (0x0002) plen 3 {0x0004} [hci1] 9585.454706
Set Static Address (0x002b)
Status: Rejected (0x0b)

To bring up the chip, I ran:
~ 11:49:30>sudo btattach -B /dev/ttyACM0 -S 1000000 -P h4
Attaching Primary controller to /dev/ttyACM0
Switched line discipline from 0 to 15
Device index 1 attached
The btmon log after this is in the attached txt file. 
Do you have any tips or suggestions on what I could do? 
Essentially, I would like to be able to program the BLE chip with a MAC address that uses the Mist OUI. 
Thanks in advance,
Gurpreet 


--
Gurpreet Singh
Member of Technical Staff
Mist Systems

e:gurpreet@...   w:  www.mist.com
Sign up for a live demo of the world's first Virtual Network Assistant. Join Demo!


Carles Cufi
 

Hi there,

 

If you are using a recent version of BlueZ then the sequence that you need to do is different from what’s on that blog post.

Here are updated instructions:

 

http://docs.zephyrproject.org/subsystems/bluetooth/devel.html#using-bluez-with-zephyr

http://docs.zephyrproject.org/subsystems/bluetooth/devel.html#testing-zephyr-based-controllers-with-bluez

 

I will update the blog post to reflect this since I see it’s still being used as a reference.

 

Carles

 

From: users@... <users@...> On Behalf Of Gurpreet Singh
Sent: 28 May 2018 18:40
To: users@...
Subject: [Zephyr-users] Unable to set Static Address on nRF52 using Zephyr v1.11.0

 

Hi,

I've been chugging along nicely with Zephyr v1.11.0 and the nRF52DK so far, being able to get it to scan and advertise using the hci_uart sample code and my Linux (ubuntu) computer. 

My linux is on BlueZ 5.48 and kernel ​4.15.0-22. This setup is just to get the ball rolling until we get sample boards from our manufacturer. 


I have run into an issue where setting the address on the chip is being rejected. 

I came across this post in the forum, but have been unable to find any clean resolution for it. 

For advertisements, you can see the all zero source mac address in the attached PCAP. 

Interestingly, the same error persists even when following the blog post on how to use the BLE controller with linux's BlueZ. (Step 5 in particular) ​

--- btmgmt
[hci1]# static-addr FF:02:03:04:05:FF
Set static address failed with status 0x0b (Rejected)
[hci1]#

--- btmon
@ MGMT Command: Set Static Address (0x002b) plen 6 {0x0004} [hci1] 9585.454699
Address: FF:02:03:04:05:FF (Static)
@ MGMT Event: Command Status (0x0002) plen 3 {0x0004} [hci1] 9585.454706
Set Static Address (0x002b)
Status: Rejected (0x0b)

To bring up the chip, I ran:

~ 11:49:30>sudo btattach -B /dev/ttyACM0 -S 1000000 -P h4
Attaching Primary controller to /dev/ttyACM0
Switched line discipline from 0 to 15
Device index 1 attached

The btmon log after this is in the attached txt file. 

Do you have any tips or suggestions on what I could do? 
Essentially, I would like to be able to program the BLE chip with a MAC address that uses the Mist OUI. 

Thanks in advance,

Gurpreet 

 

 

--

 

 

Gurpreet Singh

 

Member of Technical Staff

 

Mist Systems

 

 

e:

gurpreet@...   w:  www.mist.com

 

Sign up for a live demo of the world's first Virtual Network Assistant. Join Demo!

 

 

 

Gurpreet Singh <gurpreet@...>
 

Hi Carles,

I should have mentioned that I did see those instructions at zephyr and have already updated my  /lib/systemd/system/bluetooth.service file. 
Thats the only real change I've noticed between the blog instructions and the zephyr instructions. 

Is there something else that I need to do as well? 

Gurpreet 

On Tue, May 29, 2018 at 1:47 AM, Cufi, Carles <Carles.Cufi@...> wrote:

Hi there,

 

If you are using a recent version of BlueZ then the sequence that you need to do is different from what’s on that blog post.

Here are updated instructions:

 

http://docs.zephyrproject.org/subsystems/bluetooth/devel.html#using-bluez-with-zephyr

http://docs.zephyrproject.org/subsystems/bluetooth/devel.html#testing-zephyr-based-controllers-with-bluez

 

I will update the blog post to reflect this since I see it’s still being used as a reference.

 

Carles

 

From: users@... <users@...> On Behalf Of Gurpreet Singh
Sent: 28 May 2018 18:40
To: users@...
Subject: [Zephyr-users] Unable to set Static Address on nRF52 using Zephyr v1.11.0

 

Hi,

I've been chugging along nicely with Zephyr v1.11.0 and the nRF52DK so far, being able to get it to scan and advertise using the hci_uart sample code and my Linux (ubuntu) computer. 

My linux is on BlueZ 5.48 and kernel ​4.15.0-22. This setup is just to get the ball rolling until we get sample boards from our manufacturer. 


I have run into an issue where setting the address on the chip is being rejected. 

I came across this post in the forum, but have been unable to find any clean resolution for it. 

For advertisements, you can see the all zero source mac address in the attached PCAP. 

Interestingly, the same error persists even when following the blog post on how to use the BLE controller with linux's BlueZ. (Step 5 in particular) ​

--- btmgmt
[hci1]# static-addr FF:02:03:04:05:FF
Set static address failed with status 0x0b (Rejected)
[hci1]#

--- btmon
@ MGMT Command: Set Static Address (0x002b) plen 6 {0x0004} [hci1] 9585.454699
Address: FF:02:03:04:05:FF (Static)
@ MGMT Event: Command Status (0x0002) plen 3 {0x0004} [hci1] 9585.454706
Set Static Address (0x002b)
Status: Rejected (0x0b)

To bring up the chip, I ran:

~ 11:49:30>sudo btattach -B /dev/ttyACM0 -S 1000000 -P h4
Attaching Primary controller to /dev/ttyACM0
Switched line discipline from 0 to 15
Device index 1 attached

The btmon log after this is in the attached txt file. 

Do you have any tips or suggestions on what I could do? 
Essentially, I would like to be able to program the BLE chip with a MAC address that uses the Mist OUI. 

Thanks in advance,

Gurpreet 

 

 

--

 

 

Gurpreet Singh

 

Member of Technical Staff

 

Mist Systems

 

 

e:

gurpreet@...   w:  www.mist.com

 

Sign up for a live demo of the world's first Virtual Network Assistant. Join Demo!

 

 

 




Carles Cufi
 

Hi Gurpreet,

 

If you are using BlueZ 5.48 then, as stated in the instructions you don’t need to set the static address manually.

Instead you should just do:

 

sudo btmgmt --index 0

[hci0]# auto-power

 

Regards,

 

Carles

 

From: Gurpreet Singh <gurpreet@...>
Sent: 29 May 2018 19:51
To: Cufi, Carles <carles.cufi@...>
Cc: users@...
Subject: Re: [Zephyr-users] Unable to set Static Address on nRF52 using Zephyr v1.11.0

 

Hi Carles,

 

I should have mentioned that I did see those instructions at zephyr and have already updated my  /lib/systemd/system/bluetooth.service file. 

Thats the only real change I've noticed between the blog instructions and the zephyr instructions. 

 

Is there something else that I need to do as well? 

 

Gurpreet 

 

On Tue, May 29, 2018 at 1:47 AM, Cufi, Carles <Carles.Cufi@...> wrote:

Hi there,

 

If you are using a recent version of BlueZ then the sequence that you need to do is different from what’s on that blog post.

Here are updated instructions:

 

http://docs.zephyrproject.org/subsystems/bluetooth/devel.html#using-bluez-with-zephyr

http://docs.zephyrproject.org/subsystems/bluetooth/devel.html#testing-zephyr-based-controllers-with-bluez

 

I will update the blog post to reflect this since I see it’s still being used as a reference.

 

Carles

 

From: users@... <users@...> On Behalf Of Gurpreet Singh
Sent: 28 May 2018 18:40
To: users@...
Subject: [Zephyr-users] Unable to set Static Address on nRF52 using Zephyr v1.11.0

 

Hi,

I've been chugging along nicely with Zephyr v1.11.0 and the nRF52DK so far, being able to get it to scan and advertise using the hci_uart sample code and my Linux (ubuntu) computer. 

My linux is on BlueZ 5.48 and kernel ​4.15.0-22. This setup is just to get the ball rolling until we get sample boards from our manufacturer. 


I have run into an issue where setting the address on the chip is being rejected. 

I came across this post in the forum, but have been unable to find any clean resolution for it. 

For advertisements, you can see the all zero source mac address in the attached PCAP. 

Interestingly, the same error persists even when following the blog post on how to use the BLE controller with linux's BlueZ. (Step 5 in particular) ​

--- btmgmt
[hci1]# static-addr FF:02:03:04:05:FF
Set static address failed with status 0x0b (Rejected)
[hci1]#

--- btmon
@ MGMT Command: Set Static Address (0x002b) plen 6 {0x0004} [hci1] 9585.454699
Address: FF:02:03:04:05:FF (Static)
@ MGMT Event: Command Status (0x0002) plen 3 {0x0004} [hci1] 9585.454706
Set Static Address (0x002b)
Status: Rejected (0x0b)

To bring up the chip, I ran:

~ 11:49:30>sudo btattach -B /dev/ttyACM0 -S 1000000 -P h4
Attaching Primary controller to /dev/ttyACM0
Switched line discipline from 0 to 15
Device index 1 attached

The btmon log after this is in the attached txt file. 

Do you have any tips or suggestions on what I could do? 
Essentially, I would like to be able to program the BLE chip with a MAC address that uses the Mist OUI. 

Thanks in advance,

Gurpreet 

 

 

--

 

 

Gurpreet Singh

 

Member of Technical Staff

 

Mist Systems

 

 

e:

gurpreet@...   w:  www.mist.com

 

Sign up for a live demo of the world's first Virtual Network Assistant. Join Demo!

 

 

 



 

Gurpreet Singh <gurpreet@...>
 

Hi Carles

Yes. I've been doing that but the Mac address comes up as all zeroes. Which is my original  problem. 
So how do I set a Mac address? Or why is it all zeroes? 

Gurpreet 


On May 30, 2018, at 03:43, Cufi, Carles <Carles.Cufi@...> wrote:

Hi Gurpreet,

 

If you are using BlueZ 5.48 then, as stated in the instructions you don’t need to set the static address manually.

Instead you should just do:

 

sudo btmgmt --index 0

[hci0]# auto-power

 

Regards,

 

Carles

 

From: Gurpreet Singh <gurpreet@...>
Sent: 29 May 2018 19:51
To: Cufi, Carles <carles.cufi@...>
Cc: users@...
Subject: Re: [Zephyr-users] Unable to set Static Address on nRF52 using Zephyr v1.11.0

 

Hi Carles,

 

I should have mentioned that I did see those instructions at zephyr and have already updated my  /lib/systemd/system/bluetooth.service file. 

Thats the only real change I've noticed between the blog instructions and the zephyr instructions. 

 

Is there something else that I need to do as well? 

 

Gurpreet 

 

On Tue, May 29, 2018 at 1:47 AM, Cufi, Carles <Carles.Cufi@...> wrote:

Hi there,

 

If you are using a recent version of BlueZ then the sequence that you need to do is different from what’s on that blog post.

Here are updated instructions:

 

http://docs.zephyrproject.org/subsystems/bluetooth/devel.html#using-bluez-with-zephyr

http://docs.zephyrproject.org/subsystems/bluetooth/devel.html#testing-zephyr-based-controllers-with-bluez

 

I will update the blog post to reflect this since I see it’s still being used as a reference.

 

Carles

 

From: users@... <users@...> On Behalf Of Gurpreet Singh
Sent: 28 May 2018 18:40
To: users@...
Subject: [Zephyr-users] Unable to set Static Address on nRF52 using Zephyr v1.11.0

 

Hi,

I've been chugging along nicely with Zephyr v1.11.0 and the nRF52DK so far, being able to get it to scan and advertise using the hci_uart sample code and my Linux (ubuntu) computer. 

My linux is on BlueZ 5.48 and kernel ​4.15.0-22. This setup is just to get the ball rolling until we get sample boards from our manufacturer. 


I have run into an issue where setting the address on the chip is being rejected. 

I came across this post in the forum, but have been unable to find any clean resolution for it. 

For advertisements, you can see the all zero source mac address in the attached PCAP. 

Interestingly, the same error persists even when following the blog post on how to use the BLE controller with linux's BlueZ. (Step 5 in particular) ​

--- btmgmt
[hci1]# static-addr FF:02:03:04:05:FF
Set static address failed with status 0x0b (Rejected)
[hci1]#

--- btmon
@ MGMT Command: Set Static Address (0x002b) plen 6 {0x0004} [hci1] 9585.454699
Address: FF:02:03:04:05:FF (Static)
@ MGMT Event: Command Status (0x0002) plen 3 {0x0004} [hci1] 9585.454706
Set Static Address (0x002b)
Status: Rejected (0x0b)

To bring up the chip, I ran:

~ 11:49:30>sudo btattach -B /dev/ttyACM0 -S 1000000 -P h4
Attaching Primary controller to /dev/ttyACM0
Switched line discipline from 0 to 15
Device index 1 attached

The btmon log after this is in the attached txt file. 

Do you have any tips or suggestions on what I could do? 
Essentially, I would like to be able to program the BLE chip with a MAC address that uses the Mist OUI. 

Thanks in advance,

Gurpreet 

 

 

--

 

 

Gurpreet Singh

 

Member of Technical Staff

 

Mist Systems

 

 

e:

gurpreet@...   w:  www.mist.com

 

Sign up for a live demo of the world's first Virtual Network Assistant. Join Demo!

 

 

 



 

Carles Cufi
 

Hi Gurpreet,

 

I do not know why you get that behavior. Typically BlueZ should detect that this is an LE-only controller with no public address and would assign one to it.

Maybe it’s because you seem to have more than one controller? you are using hci1 on your btmgmt log.

 

I just tested this locally by doing:

 

sudo btattach -B /dev/ttyACM0 -S 1000000 -P h4

Attaching Primary controller to /dev/ttyACM0

Switched line discipline from 0 to 15

Device index 0 attached

 

and then:

 

$ sudo btmgmt --index 0

[hci0]# auto-power

Found controller with index 0

[hci0]# advertising on

hci0 Set Advertising complete, settings: powered bondable le advertising secure-conn static-addr

 

And in btmon it clearly set a random static address:

 

@ MGMT Command: Set Advertising (0x0029) plen 1                                           {0x0004} [hci0] 123.901998

        Advertising: Enabled (0x01)

< HCI Command: LE Set Scan Response Data (0x08|0x0009) plen 32                                 #77 [hci0] 123.902018

        Length: 13

        Name (complete): zephyr-nrf

> HCI Event: Command Complete (0x0e) plen 4                                                    #78 [hci0] 123.904563

      LE Set Scan Response Data (0x08|0x0009) ncmd 1

        Status: Success (0x00)

< HCI Command: LE Set Random Address (0x08|0x0005) plen 6                                      #79 [hci0] 123.904604

        Address: 32:82:D4:FE:B2:0F (Non-Resolvable)

> HCI Event: Command Complete (0x0e) plen 4                                                    #80 [hci0] 123.906514

      LE Set Random Address (0x08|0x0005) ncmd 1

        Status: Success (0x00)

< HCI Command: LE Set Advertising Parameters (0x08|0x0006) plen 15                             #81 [hci0] 123.906548

        Min advertising interval: 1280.000 msec (0x0800)

        Max advertising interval: 1280.000 msec (0x0800)

        Type: Non connectable undirected - ADV_NONCONN_IND (0x03)

        Own address type: Random (0x01)

        Direct address type: Public (0x00)

        Direct address: 00:00:00:00:00:00 (OUI 00-00-00)

        Channel map: 37, 38, 39 (0x07)

        Filter policy: Allow Scan Request from Any, Allow Connect Request from Any (0x00)

> HCI Event: Command Complete (0x0e) plen 4                                                    #82 [hci0] 123.907511

      LE Set Advertising Parameters (0x08|0x0006) ncmd 1

        Status: Success (0x00)

< HCI Command: LE Set Advertise Enable (0x08|0x000a) plen 1                                    #83 [hci0] 123.907569

        Advertising: Enabled (0x01)

> HCI Event: Command Complete (0x0e) plen 4                                                    #84 [hci0] 123.909506

      LE Set Advertise Enable (0x08|0x000a) ncmd 1

        Status: Success (0x00)

 

 

From: Gurpreet Singh <gurpreet@...>
Sent: 30 May 2018 14:32
To: Cufi, Carles <carles.cufi@...>
Cc: users@...
Subject: Re: [Zephyr-users] Unable to set Static Address on nRF52 using Zephyr v1.11.0

 

Hi Carles

 

Yes. I've been doing that but the Mac address comes up as all zeroes. Which is my original  problem. 

So how do I set a Mac address? Or why is it all zeroes? 

 

Gurpreet 

 


On May 30, 2018, at 03:43, Cufi, Carles <Carles.Cufi@...> wrote:

Hi Gurpreet,

 

If you are using BlueZ 5.48 then, as stated in the instructions you don’t need to set the static address manually.

Instead you should just do:

 

sudo btmgmt --index 0

[hci0]# auto-power

 

Regards,

 

Carles

 

From: Gurpreet Singh <gurpreet@...>
Sent: 29 May 2018 19:51
To: Cufi, Carles <carles.cufi@...>
Cc: users@...
Subject: Re: [Zephyr-users] Unable to set Static Address on nRF52 using Zephyr v1.11.0

 

Hi Carles,

 

I should have mentioned that I did see those instructions at zephyr and have already updated my  /lib/systemd/system/bluetooth.service file. 

Thats the only real change I've noticed between the blog instructions and the zephyr instructions. 

 

Is there something else that I need to do as well? 

 

Gurpreet 

 

On Tue, May 29, 2018 at 1:47 AM, Cufi, Carles <Carles.Cufi@...> wrote:

Hi there,

 

If you are using a recent version of BlueZ then the sequence that you need to do is different from what’s on that blog post.

Here are updated instructions:

 

http://docs.zephyrproject.org/subsystems/bluetooth/devel.html#using-bluez-with-zephyr

http://docs.zephyrproject.org/subsystems/bluetooth/devel.html#testing-zephyr-based-controllers-with-bluez

 

I will update the blog post to reflect this since I see it’s still being used as a reference.

 

Carles

 

From: users@... <users@...> On Behalf Of Gurpreet Singh
Sent: 28 May 2018 18:40
To: users@...
Subject: [Zephyr-users] Unable to set Static Address on nRF52 using Zephyr v1.11.0

 

Hi,

I've been chugging along nicely with Zephyr v1.11.0 and the nRF52DK so far, being able to get it to scan and advertise using the hci_uart sample code and my Linux (ubuntu) computer. 

My linux is on BlueZ 5.48 and kernel ​4.15.0-22. This setup is just to get the ball rolling until we get sample boards from our manufacturer. 


I have run into an issue where setting the address on the chip is being rejected. 

I came across this post in the forum, but have been unable to find any clean resolution for it. 

For advertisements, you can see the all zero source mac address in the attached PCAP. 

Interestingly, the same error persists even when following the blog post on how to use the BLE controller with linux's BlueZ. (Step 5 in particular) ​

--- btmgmt
[hci1]# static-addr FF:02:03:04:05:FF
Set static address failed with status 0x0b (Rejected)
[hci1]#

--- btmon
@ MGMT Command: Set Static Address (0x002b) plen 6 {0x0004} [hci1] 9585.454699
Address: FF:02:03:04:05:FF (Static)
@ MGMT Event: Command Status (0x0002) plen 3 {0x0004} [hci1] 9585.454706
Set Static Address (0x002b)
Status: Rejected (0x0b)

To bring up the chip, I ran:

~ 11:49:30>sudo btattach -B /dev/ttyACM0 -S 1000000 -P h4
Attaching Primary controller to /dev/ttyACM0
Switched line discipline from 0 to 15
Device index 1 attached

The btmon log after this is in the attached txt file. 

Do you have any tips or suggestions on what I could do? 
Essentially, I would like to be able to program the BLE chip with a MAC address that uses the Mist OUI. 

Thanks in advance,

Gurpreet 

 

 

--

 

 

Gurpreet Singh

 

Member of Technical Staff

 

Mist Systems

 

 

e:

gurpreet@...   w:  www.mist.com

 

Sign up for a live demo of the world's first Virtual Network Assistant. Join Demo!

 

 

 



 

Gurpreet Singh <gurpreet@...>
 

Hi Carles

Hmmm. I can try disabling my laptop's Bluetooth and attempt this again. 
But would that mean, when I have my actual boards, this won't be an issue?

Also, based on what you're saying, however, is there no way to specifically assign an address of my choosing? We have our own OUI, and want to use that for the implementation. 

Gurpreet 


On May 30, 2018, at 06:52, Cufi, Carles <Carles.Cufi@...> wrote:

Hi Gurpreet,

 

I do not know why you get that behavior. Typically BlueZ should detect that this is an LE-only controller with no public address and would assign one to it.

Maybe it’s because you seem to have more than one controller? you are using hci1 on your btmgmt log.

 

I just tested this locally by doing:

 

sudo btattach -B /dev/ttyACM0 -S 1000000 -P h4

Attaching Primary controller to /dev/ttyACM0

Switched line discipline from 0 to 15

Device index 0 attached

 

and then:

 

$ sudo btmgmt --index 0

[hci0]# auto-power

Found controller with index 0

[hci0]# advertising on

hci0 Set Advertising complete, settings: powered bondable le advertising secure-conn static-addr

 

And in btmon it clearly set a random static address:

 

@ MGMT Command: Set Advertising (0x0029) plen 1                                           {0x0004} [hci0] 123.901998

        Advertising: Enabled (0x01)

< HCI Command: LE Set Scan Response Data (0x08|0x0009) plen 32                                 #77 [hci0] 123.902018

        Length: 13

        Name (complete): zephyr-nrf

> HCI Event: Command Complete (0x0e) plen 4                                                    #78 [hci0] 123.904563

      LE Set Scan Response Data (0x08|0x0009) ncmd 1

        Status: Success (0x00)

< HCI Command: LE Set Random Address (0x08|0x0005) plen 6                                      #79 [hci0] 123.904604

        Address: 32:82:D4:FE:B2:0F (Non-Resolvable)

> HCI Event: Command Complete (0x0e) plen 4                                                    #80 [hci0] 123.906514

      LE Set Random Address (0x08|0x0005) ncmd 1

        Status: Success (0x00)

< HCI Command: LE Set Advertising Parameters (0x08|0x0006) plen 15                             #81 [hci0] 123.906548

        Min advertising interval: 1280.000 msec (0x0800)

        Max advertising interval: 1280.000 msec (0x0800)

        Type: Non connectable undirected - ADV_NONCONN_IND (0x03)

        Own address type: Random (0x01)

        Direct address type: Public (0x00)

        Direct address: 00:00:00:00:00:00 (OUI 00-00-00)

        Channel map: 37, 38, 39 (0x07)

        Filter policy: Allow Scan Request from Any, Allow Connect Request from Any (0x00)

> HCI Event: Command Complete (0x0e) plen 4                                                    #82 [hci0] 123.907511

      LE Set Advertising Parameters (0x08|0x0006) ncmd 1

        Status: Success (0x00)

< HCI Command: LE Set Advertise Enable (0x08|0x000a) plen 1                                    #83 [hci0] 123.907569

        Advertising: Enabled (0x01)

> HCI Event: Command Complete (0x0e) plen 4                                                    #84 [hci0] 123.909506

      LE Set Advertise Enable (0x08|0x000a) ncmd 1

        Status: Success (0x00)

 

 

From: Gurpreet Singh <gurpreet@...>
Sent: 30 May 2018 14:32
To: Cufi, Carles <carles.cufi@...>
Cc: users@...
Subject: Re: [Zephyr-users] Unable to set Static Address on nRF52 using Zephyr v1.11.0

 

Hi Carles

 

Yes. I've been doing that but the Mac address comes up as all zeroes. Which is my original  problem. 

So how do I set a Mac address? Or why is it all zeroes? 

 

Gurpreet 

 


On May 30, 2018, at 03:43, Cufi, Carles <Carles.Cufi@...> wrote:

Hi Gurpreet,

 

If you are using BlueZ 5.48 then, as stated in the instructions you don’t need to set the static address manually.

Instead you should just do:

 

sudo btmgmt --index 0

[hci0]# auto-power

 

Regards,

 

Carles

 

From: Gurpreet Singh <gurpreet@...>
Sent: 29 May 2018 19:51
To: Cufi, Carles <carles.cufi@...>
Cc: users@...
Subject: Re: [Zephyr-users] Unable to set Static Address on nRF52 using Zephyr v1.11.0

 

Hi Carles,

 

I should have mentioned that I did see those instructions at zephyr and have already updated my  /lib/systemd/system/bluetooth.service file. 

Thats the only real change I've noticed between the blog instructions and the zephyr instructions. 

 

Is there something else that I need to do as well? 

 

Gurpreet 

 

On Tue, May 29, 2018 at 1:47 AM, Cufi, Carles <Carles.Cufi@...> wrote:

Hi there,

 

If you are using a recent version of BlueZ then the sequence that you need to do is different from what’s on that blog post.

Here are updated instructions:

 

http://docs.zephyrproject.org/subsystems/bluetooth/devel.html#using-bluez-with-zephyr

http://docs.zephyrproject.org/subsystems/bluetooth/devel.html#testing-zephyr-based-controllers-with-bluez

 

I will update the blog post to reflect this since I see it’s still being used as a reference.

 

Carles

 

From: users@... <users@...> On Behalf Of Gurpreet Singh
Sent: 28 May 2018 18:40
To: users@...
Subject: [Zephyr-users] Unable to set Static Address on nRF52 using Zephyr v1.11.0

 

Hi,

I've been chugging along nicely with Zephyr v1.11.0 and the nRF52DK so far, being able to get it to scan and advertise using the hci_uart sample code and my Linux (ubuntu) computer. 

My linux is on BlueZ 5.48 and kernel ​4.15.0-22. This setup is just to get the ball rolling until we get sample boards from our manufacturer. 


I have run into an issue where setting the address on the chip is being rejected. 

I came across this post in the forum, but have been unable to find any clean resolution for it. 

For advertisements, you can see the all zero source mac address in the attached PCAP. 

Interestingly, the same error persists even when following the blog post on how to use the BLE controller with linux's BlueZ. (Step 5 in particular) ​

--- btmgmt
[hci1]# static-addr FF:02:03:04:05:FF
Set static address failed with status 0x0b (Rejected)
[hci1]#

--- btmon
@ MGMT Command: Set Static Address (0x002b) plen 6 {0x0004} [hci1] 9585.454699
Address: FF:02:03:04:05:FF (Static)
@ MGMT Event: Command Status (0x0002) plen 3 {0x0004} [hci1] 9585.454706
Set Static Address (0x002b)
Status: Rejected (0x0b)

To bring up the chip, I ran:

~ 11:49:30>sudo btattach -B /dev/ttyACM0 -S 1000000 -P h4
Attaching Primary controller to /dev/ttyACM0
Switched line discipline from 0 to 15
Device index 1 attached

The btmon log after this is in the attached txt file. 

Do you have any tips or suggestions on what I could do? 
Essentially, I would like to be able to program the BLE chip with a MAC address that uses the Mist OUI. 

Thanks in advance,

Gurpreet 

 

 

--

 

 

Gurpreet Singh

 

Member of Technical Staff

 

Mist Systems

 

 

e:

gurpreet@...   w:  www.mist.com

 

Sign up for a live demo of the world's first Virtual Network Assistant. Join Demo!

 

 

 



 

Carles Cufi
 

Well, I am not sure if it will be an issue or not, I was just suggesting changes since  I cannot reproduce the issue myself.

If you have your own OUI then you need to set and use a public address, not a random static one. To set a public address you need to use a Vendor Specific command:

https://github.com/zephyrproject-rtos/zephyr/blob/master/doc/subsystems/bluetooth/hci.txt#L408

 

I believe you can do that with “hcitool cmd”, which allows you to send an arbitrary HCI command to the controller.

 

From: Gurpreet Singh <gurpreet@...>
Sent: 30 May 2018 16:09
To: Cufi, Carles <carles.cufi@...>
Cc: users@...
Subject: Re: [Zephyr-users] Unable to set Static Address on nRF52 using Zephyr v1.11.0

 

Hi Carles

 

Hmmm. I can try disabling my laptop's Bluetooth and attempt this again. 

But would that mean, when I have my actual boards, this won't be an issue?

 

Also, based on what you're saying, however, is there no way to specifically assign an address of my choosing? We have our own OUI, and want to use that for the implementation. 

 

Gurpreet 


On May 30, 2018, at 06:52, Cufi, Carles <Carles.Cufi@...> wrote:

Hi Gurpreet,

 

I do not know why you get that behavior. Typically BlueZ should detect that this is an LE-only controller with no public address and would assign one to it.

Maybe it’s because you seem to have more than one controller? you are using hci1 on your btmgmt log.

 

I just tested this locally by doing:

 

sudo btattach -B /dev/ttyACM0 -S 1000000 -P h4

Attaching Primary controller to /dev/ttyACM0

Switched line discipline from 0 to 15

Device index 0 attached

 

and then:

 

$ sudo btmgmt --index 0

[hci0]# auto-power

Found controller with index 0

[hci0]# advertising on

hci0 Set Advertising complete, settings: powered bondable le advertising secure-conn static-addr

 

And in btmon it clearly set a random static address:

 

@ MGMT Command: Set Advertising (0x0029) plen 1                                           {0x0004} [hci0] 123.901998

        Advertising: Enabled (0x01)

< HCI Command: LE Set Scan Response Data (0x08|0x0009) plen 32                                 #77 [hci0] 123.902018

        Length: 13

        Name (complete): zephyr-nrf

> HCI Event: Command Complete (0x0e) plen 4                                                    #78 [hci0] 123.904563

      LE Set Scan Response Data (0x08|0x0009) ncmd 1

        Status: Success (0x00)

< HCI Command: LE Set Random Address (0x08|0x0005) plen 6                                      #79 [hci0] 123.904604

        Address: 32:82:D4:FE:B2:0F (Non-Resolvable)

> HCI Event: Command Complete (0x0e) plen 4                                                    #80 [hci0] 123.906514

      LE Set Random Address (0x08|0x0005) ncmd 1

        Status: Success (0x00)

< HCI Command: LE Set Advertising Parameters (0x08|0x0006) plen 15                             #81 [hci0] 123.906548

        Min advertising interval: 1280.000 msec (0x0800)

        Max advertising interval: 1280.000 msec (0x0800)

        Type: Non connectable undirected - ADV_NONCONN_IND (0x03)

        Own address type: Random (0x01)

        Direct address type: Public (0x00)

        Direct address: 00:00:00:00:00:00 (OUI 00-00-00)

        Channel map: 37, 38, 39 (0x07)

        Filter policy: Allow Scan Request from Any, Allow Connect Request from Any (0x00)

> HCI Event: Command Complete (0x0e) plen 4                                                    #82 [hci0] 123.907511

      LE Set Advertising Parameters (0x08|0x0006) ncmd 1

        Status: Success (0x00)

< HCI Command: LE Set Advertise Enable (0x08|0x000a) plen 1                                    #83 [hci0] 123.907569

        Advertising: Enabled (0x01)

> HCI Event: Command Complete (0x0e) plen 4                                                    #84 [hci0] 123.909506

      LE Set Advertise Enable (0x08|0x000a) ncmd 1

        Status: Success (0x00)

 

 

From: Gurpreet Singh <gurpreet@...>
Sent: 30 May 2018 14:32
To: Cufi, Carles <carles.cufi@...>
Cc: users@...
Subject: Re: [Zephyr-users] Unable to set Static Address on nRF52 using Zephyr v1.11.0

 

Hi Carles

 

Yes. I've been doing that but the Mac address comes up as all zeroes. Which is my original  problem. 

So how do I set a Mac address? Or why is it all zeroes? 

 

Gurpreet 

 


On May 30, 2018, at 03:43, Cufi, Carles <Carles.Cufi@...> wrote:

Hi Gurpreet,

 

If you are using BlueZ 5.48 then, as stated in the instructions you don’t need to set the static address manually.

Instead you should just do:

 

sudo btmgmt --index 0

[hci0]# auto-power

 

Regards,

 

Carles

 

From: Gurpreet Singh <gurpreet@...>
Sent: 29 May 2018 19:51
To: Cufi, Carles <carles.cufi@...>
Cc: users@...
Subject: Re: [Zephyr-users] Unable to set Static Address on nRF52 using Zephyr v1.11.0

 

Hi Carles,

 

I should have mentioned that I did see those instructions at zephyr and have already updated my  /lib/systemd/system/bluetooth.service file. 

Thats the only real change I've noticed between the blog instructions and the zephyr instructions. 

 

Is there something else that I need to do as well? 

 

Gurpreet 

 

On Tue, May 29, 2018 at 1:47 AM, Cufi, Carles <Carles.Cufi@...> wrote:

Hi there,

 

If you are using a recent version of BlueZ then the sequence that you need to do is different from what’s on that blog post.

Here are updated instructions:

 

http://docs.zephyrproject.org/subsystems/bluetooth/devel.html#using-bluez-with-zephyr

http://docs.zephyrproject.org/subsystems/bluetooth/devel.html#testing-zephyr-based-controllers-with-bluez

 

I will update the blog post to reflect this since I see it’s still being used as a reference.

 

Carles

 

From: users@... <users@...> On Behalf Of Gurpreet Singh
Sent: 28 May 2018 18:40
To: users@...
Subject: [Zephyr-users] Unable to set Static Address on nRF52 using Zephyr v1.11.0

 

Hi,

I've been chugging along nicely with Zephyr v1.11.0 and the nRF52DK so far, being able to get it to scan and advertise using the hci_uart sample code and my Linux (ubuntu) computer. 

My linux is on BlueZ 5.48 and kernel ​4.15.0-22. This setup is just to get the ball rolling until we get sample boards from our manufacturer. 


I have run into an issue where setting the address on the chip is being rejected. 

I came across this post in the forum, but have been unable to find any clean resolution for it. 

For advertisements, you can see the all zero source mac address in the attached PCAP. 

Interestingly, the same error persists even when following the blog post on how to use the BLE controller with linux's BlueZ. (Step 5 in particular) ​

--- btmgmt
[hci1]# static-addr FF:02:03:04:05:FF
Set static address failed with status 0x0b (Rejected)
[hci1]#

--- btmon
@ MGMT Command: Set Static Address (0x002b) plen 6 {0x0004} [hci1] 9585.454699
Address: FF:02:03:04:05:FF (Static)
@ MGMT Event: Command Status (0x0002) plen 3 {0x0004} [hci1] 9585.454706
Set Static Address (0x002b)
Status: Rejected (0x0b)

To bring up the chip, I ran:

~ 11:49:30>sudo btattach -B /dev/ttyACM0 -S 1000000 -P h4
Attaching Primary controller to /dev/ttyACM0
Switched line discipline from 0 to 15
Device index 1 attached

The btmon log after this is in the attached txt file. 

Do you have any tips or suggestions on what I could do? 
Essentially, I would like to be able to program the BLE chip with a MAC address that uses the Mist OUI. 

Thanks in advance,

Gurpreet 

 

 

--

 

 

Gurpreet Singh

 

Member of Technical Staff

 

Mist Systems

 

 

e:

gurpreet@...   w:  www.mist.com

 

Sign up for a live demo of the world's first Virtual Network Assistant. Join Demo!

 

 

 



 

Gurpreet Singh <gurpreet@...>
 

Ah perfect. I must've missed this when perusing the documentation. 
I'll try this out today. Thanks! 

Gurpreet 


On May 30, 2018, at 07:13, Cufi, Carles <Carles.Cufi@...> wrote:

Well, I am not sure if it will be an issue or not, I was just suggesting changes since  I cannot reproduce the issue myself.

If you have your own OUI then you need to set and use a public address, not a random static one. To set a public address you need to use a Vendor Specific command:

https://github.com/zephyrproject-rtos/zephyr/blob/master/doc/subsystems/bluetooth/hci.txt#L408

 

I believe you can do that with “hcitool cmd”, which allows you to send an arbitrary HCI command to the controller.

 

From: Gurpreet Singh <gurpreet@...>
Sent: 30 May 2018 16:09
To: Cufi, Carles <carles.cufi@...>
Cc: users@...
Subject: Re: [Zephyr-users] Unable to set Static Address on nRF52 using Zephyr v1.11.0

 

Hi Carles

 

Hmmm. I can try disabling my laptop's Bluetooth and attempt this again. 

But would that mean, when I have my actual boards, this won't be an issue?

 

Also, based on what you're saying, however, is there no way to specifically assign an address of my choosing? We have our own OUI, and want to use that for the implementation. 

 

Gurpreet 


On May 30, 2018, at 06:52, Cufi, Carles <Carles.Cufi@...> wrote:

Hi Gurpreet,

 

I do not know why you get that behavior. Typically BlueZ should detect that this is an LE-only controller with no public address and would assign one to it.

Maybe it’s because you seem to have more than one controller? you are using hci1 on your btmgmt log.

 

I just tested this locally by doing:

 

sudo btattach -B /dev/ttyACM0 -S 1000000 -P h4

Attaching Primary controller to /dev/ttyACM0

Switched line discipline from 0 to 15

Device index 0 attached

 

and then:

 

$ sudo btmgmt --index 0

[hci0]# auto-power

Found controller with index 0

[hci0]# advertising on

hci0 Set Advertising complete, settings: powered bondable le advertising secure-conn static-addr

 

And in btmon it clearly set a random static address:

 

@ MGMT Command: Set Advertising (0x0029) plen 1                                           {0x0004} [hci0] 123.901998

        Advertising: Enabled (0x01)

< HCI Command: LE Set Scan Response Data (0x08|0x0009) plen 32                                 #77 [hci0] 123.902018

        Length: 13

        Name (complete): zephyr-nrf

> HCI Event: Command Complete (0x0e) plen 4                                                    #78 [hci0] 123.904563

      LE Set Scan Response Data (0x08|0x0009) ncmd 1

        Status: Success (0x00)

< HCI Command: LE Set Random Address (0x08|0x0005) plen 6                                      #79 [hci0] 123.904604

        Address: 32:82:D4:FE:B2:0F (Non-Resolvable)

> HCI Event: Command Complete (0x0e) plen 4                                                    #80 [hci0] 123.906514

      LE Set Random Address (0x08|0x0005) ncmd 1

        Status: Success (0x00)

< HCI Command: LE Set Advertising Parameters (0x08|0x0006) plen 15                             #81 [hci0] 123.906548

        Min advertising interval: 1280.000 msec (0x0800)

        Max advertising interval: 1280.000 msec (0x0800)

        Type: Non connectable undirected - ADV_NONCONN_IND (0x03)

        Own address type: Random (0x01)

        Direct address type: Public (0x00)

        Direct address: 00:00:00:00:00:00 (OUI 00-00-00)

        Channel map: 37, 38, 39 (0x07)

        Filter policy: Allow Scan Request from Any, Allow Connect Request from Any (0x00)

> HCI Event: Command Complete (0x0e) plen 4                                                    #82 [hci0] 123.907511

      LE Set Advertising Parameters (0x08|0x0006) ncmd 1

        Status: Success (0x00)

< HCI Command: LE Set Advertise Enable (0x08|0x000a) plen 1                                    #83 [hci0] 123.907569

        Advertising: Enabled (0x01)

> HCI Event: Command Complete (0x0e) plen 4                                                    #84 [hci0] 123.909506

      LE Set Advertise Enable (0x08|0x000a) ncmd 1

        Status: Success (0x00)

 

 

From: Gurpreet Singh <gurpreet@...>
Sent: 30 May 2018 14:32
To: Cufi, Carles <carles.cufi@...>
Cc: users@...
Subject: Re: [Zephyr-users] Unable to set Static Address on nRF52 using Zephyr v1.11.0

 

Hi Carles

 

Yes. I've been doing that but the Mac address comes up as all zeroes. Which is my original  problem. 

So how do I set a Mac address? Or why is it all zeroes? 

 

Gurpreet 

 


On May 30, 2018, at 03:43, Cufi, Carles <Carles.Cufi@...> wrote:

Hi Gurpreet,

 

If you are using BlueZ 5.48 then, as stated in the instructions you don’t need to set the static address manually.

Instead you should just do:

 

sudo btmgmt --index 0

[hci0]# auto-power

 

Regards,

 

Carles

 

From: Gurpreet Singh <gurpreet@...>
Sent: 29 May 2018 19:51
To: Cufi, Carles <carles.cufi@...>
Cc: users@...
Subject: Re: [Zephyr-users] Unable to set Static Address on nRF52 using Zephyr v1.11.0

 

Hi Carles,

 

I should have mentioned that I did see those instructions at zephyr and have already updated my  /lib/systemd/system/bluetooth.service file. 

Thats the only real change I've noticed between the blog instructions and the zephyr instructions. 

 

Is there something else that I need to do as well? 

 

Gurpreet 

 

On Tue, May 29, 2018 at 1:47 AM, Cufi, Carles <Carles.Cufi@...> wrote:

Hi there,

 

If you are using a recent version of BlueZ then the sequence that you need to do is different from what’s on that blog post.

Here are updated instructions:

 

http://docs.zephyrproject.org/subsystems/bluetooth/devel.html#using-bluez-with-zephyr

http://docs.zephyrproject.org/subsystems/bluetooth/devel.html#testing-zephyr-based-controllers-with-bluez

 

I will update the blog post to reflect this since I see it’s still being used as a reference.

 

Carles

 

From: users@... <users@...> On Behalf Of Gurpreet Singh
Sent: 28 May 2018 18:40
To: users@...
Subject: [Zephyr-users] Unable to set Static Address on nRF52 using Zephyr v1.11.0

 

Hi,

I've been chugging along nicely with Zephyr v1.11.0 and the nRF52DK so far, being able to get it to scan and advertise using the hci_uart sample code and my Linux (ubuntu) computer. 

My linux is on BlueZ 5.48 and kernel ​4.15.0-22. This setup is just to get the ball rolling until we get sample boards from our manufacturer. 


I have run into an issue where setting the address on the chip is being rejected. 

I came across this post in the forum, but have been unable to find any clean resolution for it. 

For advertisements, you can see the all zero source mac address in the attached PCAP. 

Interestingly, the same error persists even when following the blog post on how to use the BLE controller with linux's BlueZ. (Step 5 in particular) ​

--- btmgmt
[hci1]# static-addr FF:02:03:04:05:FF
Set static address failed with status 0x0b (Rejected)
[hci1]#

--- btmon
@ MGMT Command: Set Static Address (0x002b) plen 6 {0x0004} [hci1] 9585.454699
Address: FF:02:03:04:05:FF (Static)
@ MGMT Event: Command Status (0x0002) plen 3 {0x0004} [hci1] 9585.454706
Set Static Address (0x002b)
Status: Rejected (0x0b)

To bring up the chip, I ran:

~ 11:49:30>sudo btattach -B /dev/ttyACM0 -S 1000000 -P h4
Attaching Primary controller to /dev/ttyACM0
Switched line discipline from 0 to 15
Device index 1 attached

The btmon log after this is in the attached txt file. 

Do you have any tips or suggestions on what I could do? 
Essentially, I would like to be able to program the BLE chip with a MAC address that uses the Mist OUI. 

Thanks in advance,

Gurpreet 

 

 

--

 

 

Gurpreet Singh

 

Member of Technical Staff

 

Mist Systems

 

 

e:

gurpreet@...   w:  www.mist.com

 

Sign up for a live demo of the world's first Virtual Network Assistant. Join Demo!

 

 

 



 

Gurpreet Singh <gurpreet@...>
 

That worked. Thanks Carles! 

-Gurpreet 

On Wed, May 30, 2018 at 7:23 AM, Gurpreet Singh <gurpreet@...> wrote:
Ah perfect. I must've missed this when perusing the documentation. 
I'll try this out today. Thanks! 

Gurpreet 



On May 30, 2018, at 07:13, Cufi, Carles <Carles.Cufi@...> wrote:

Well, I am not sure if it will be an issue or not, I was just suggesting changes since  I cannot reproduce the issue myself.

If you have your own OUI then you need to set and use a public address, not a random static one. To set a public address you need to use a Vendor Specific command:

https://github.com/zephyrproject-rtos/zephyr/blob/master/doc/subsystems/bluetooth/hci.txt#L408

 

I believe you can do that with “hcitool cmd”, which allows you to send an arbitrary HCI command to the controller.

 

From: Gurpreet Singh <gurpreet@...>
Sent: 30 May 2018 16:09
To: Cufi, Carles <carles.cufi@...>
Cc: users@...
Subject: Re: [Zephyr-users] Unable to set Static Address on nRF52 using Zephyr v1.11.0

 

Hi Carles

 

Hmmm. I can try disabling my laptop's Bluetooth and attempt this again. 

But would that mean, when I have my actual boards, this won't be an issue?

 

Also, based on what you're saying, however, is there no way to specifically assign an address of my choosing? We have our own OUI, and want to use that for the implementation. 

 

Gurpreet 


On May 30, 2018, at 06:52, Cufi, Carles <Carles.Cufi@...> wrote:

Hi Gurpreet,

 

I do not know why you get that behavior. Typically BlueZ should detect that this is an LE-only controller with no public address and would assign one to it.

Maybe it’s because you seem to have more than one controller? you are using hci1 on your btmgmt log.

 

I just tested this locally by doing:

 

sudo btattach -B /dev/ttyACM0 -S 1000000 -P h4

Attaching Primary controller to /dev/ttyACM0

Switched line discipline from 0 to 15

Device index 0 attached

 

and then:

 

$ sudo btmgmt --index 0

[hci0]# auto-power

Found controller with index 0

[hci0]# advertising on

hci0 Set Advertising complete, settings: powered bondable le advertising secure-conn static-addr

 

And in btmon it clearly set a random static address:

 

@ MGMT Command: Set Advertising (0x0029) plen 1                                           {0x0004} [hci0] 123.901998

        Advertising: Enabled (0x01)

< HCI Command: LE Set Scan Response Data (0x08|0x0009) plen 32                                 #77 [hci0] 123.902018

        Length: 13

        Name (complete): zephyr-nrf

> HCI Event: Command Complete (0x0e) plen 4                                                    #78 [hci0] 123.904563

      LE Set Scan Response Data (0x08|0x0009) ncmd 1

        Status: Success (0x00)

< HCI Command: LE Set Random Address (0x08|0x0005) plen 6                                      #79 [hci0] 123.904604

        Address: 32:82:D4:FE:B2:0F (Non-Resolvable)

> HCI Event: Command Complete (0x0e) plen 4                                                    #80 [hci0] 123.906514

      LE Set Random Address (0x08|0x0005) ncmd 1

        Status: Success (0x00)

< HCI Command: LE Set Advertising Parameters (0x08|0x0006) plen 15                             #81 [hci0] 123.906548

        Min advertising interval: 1280.000 msec (0x0800)

        Max advertising interval: 1280.000 msec (0x0800)

        Type: Non connectable undirected - ADV_NONCONN_IND (0x03)

        Own address type: Random (0x01)

        Direct address type: Public (0x00)

        Direct address: 00:00:00:00:00:00 (OUI 00-00-00)

        Channel map: 37, 38, 39 (0x07)

        Filter policy: Allow Scan Request from Any, Allow Connect Request from Any (0x00)

> HCI Event: Command Complete (0x0e) plen 4                                                    #82 [hci0] 123.907511

      LE Set Advertising Parameters (0x08|0x0006) ncmd 1

        Status: Success (0x00)

< HCI Command: LE Set Advertise Enable (0x08|0x000a) plen 1                                    #83 [hci0] 123.907569

        Advertising: Enabled (0x01)

> HCI Event: Command Complete (0x0e) plen 4                                                    #84 [hci0] 123.909506

      LE Set Advertise Enable (0x08|0x000a) ncmd 1

        Status: Success (0x00)

 

 

From: Gurpreet Singh <gurpreet@...>
Sent: 30 May 2018 14:32
To: Cufi, Carles <carles.cufi@...>
Cc: users@...
Subject: Re: [Zephyr-users] Unable to set Static Address on nRF52 using Zephyr v1.11.0

 

Hi Carles

 

Yes. I've been doing that but the Mac address comes up as all zeroes. Which is my original  problem. 

So how do I set a Mac address? Or why is it all zeroes? 

 

Gurpreet 

 


On May 30, 2018, at 03:43, Cufi, Carles <Carles.Cufi@...> wrote:

Hi Gurpreet,

 

If you are using BlueZ 5.48 then, as stated in the instructions you don’t need to set the static address manually.

Instead you should just do:

 

sudo btmgmt --index 0

[hci0]# auto-power

 

Regards,

 

Carles

 

From: Gurpreet Singh <gurpreet@...>
Sent: 29 May 2018 19:51
To: Cufi, Carles <carles.cufi@...>
Cc: users@...
Subject: Re: [Zephyr-users] Unable to set Static Address on nRF52 using Zephyr v1.11.0

 

Hi Carles,

 

I should have mentioned that I did see those instructions at zephyr and have already updated my  /lib/systemd/system/bluetooth.service file. 

Thats the only real change I've noticed between the blog instructions and the zephyr instructions. 

 

Is there something else that I need to do as well? 

 

Gurpreet 

 

On Tue, May 29, 2018 at 1:47 AM, Cufi, Carles <Carles.Cufi@...> wrote:

Hi there,

 

If you are using a recent version of BlueZ then the sequence that you need to do is different from what’s on that blog post.

Here are updated instructions:

 

http://docs.zephyrproject.org/subsystems/bluetooth/devel.html#using-bluez-with-zephyr

http://docs.zephyrproject.org/subsystems/bluetooth/devel.html#testing-zephyr-based-controllers-with-bluez

 

I will update the blog post to reflect this since I see it’s still being used as a reference.

 

Carles

 

From: users@... <users@...> On Behalf Of Gurpreet Singh
Sent: 28 May 2018 18:40
To: users@...
Subject: [Zephyr-users] Unable to set Static Address on nRF52 using Zephyr v1.11.0

 

Hi,

I've been chugging along nicely with Zephyr v1.11.0 and the nRF52DK so far, being able to get it to scan and advertise using the hci_uart sample code and my Linux (ubuntu) computer. 

My linux is on BlueZ 5.48 and kernel ​4.15.0-22. This setup is just to get the ball rolling until we get sample boards from our manufacturer. 


I have run into an issue where setting the address on the chip is being rejected. 

I came across this post in the forum, but have been unable to find any clean resolution for it. 

For advertisements, you can see the all zero source mac address in the attached PCAP. 

Interestingly, the same error persists even when following the blog post on how to use the BLE controller with linux's BlueZ. (Step 5 in particular) ​

--- btmgmt
[hci1]# static-addr FF:02:03:04:05:FF
Set static address failed with status 0x0b (Rejected)
[hci1]#

--- btmon
@ MGMT Command: Set Static Address (0x002b) plen 6 {0x0004} [hci1] 9585.454699
Address: FF:02:03:04:05:FF (Static)
@ MGMT Event: Command Status (0x0002) plen 3 {0x0004} [hci1] 9585.454706
Set Static Address (0x002b)
Status: Rejected (0x0b)

To bring up the chip, I ran:

~ 11:49:30>sudo btattach -B /dev/ttyACM0 -S 1000000 -P h4
Attaching Primary controller to /dev/ttyACM0
Switched line discipline from 0 to 15
Device index 1 attached

The btmon log after this is in the attached txt file. 

Do you have any tips or suggestions on what I could do? 
Essentially, I would like to be able to program the BLE chip with a MAC address that uses the Mist OUI. 

Thanks in advance,

Gurpreet 

 

 

--

 

 

Gurpreet Singh

 

Member of Technical Staff

 

Mist Systems

 

 

e:

gurpreet@...   w:  www.mist.com

 

Sign up for a live demo of the world's first Virtual Network Assistant. Join Demo!

 

 

 



 




--
Gurpreet Singh
Member of Technical Staff
Mist Systems

e:gurpreet@...   w:  www.mist.com
Sign up for a live demo of the world's first Virtual Network Assistant. Join Demo!