Voting resources, early voting, and poll worker information - VOTE. ... Adafruit is open and shipping.
0

setting bluetooth channel for CE testing
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

setting bluetooth channel for CE testing

by moritz on Fri Jul 24, 2020 5:20 am

We are using your featherboard 3406 n a product that goes through CE testing. The testing lab is asking to set the bluetooth radio to the first and last channel for their radio emission tests. How can we fix the BT module to these channels?
Many thanks for your help!

moritz
 
Posts: 7
Joined: Tue Dec 02, 2014 10:39 am

Re: setting bluetooth channel for CE testing

by moritz on Wed Jul 29, 2020 4:14 am

Any suggestions @adafruit? Thanks for your help in advance!

moritz
 
Posts: 7
Joined: Tue Dec 02, 2014 10:39 am

Re: setting bluetooth channel for CE testing

by hathach on Wed Jul 29, 2020 1:06 pm

hi there, currently there is no public API in the library but you could simply modify the code for the CE testing

https://github.com/adafruit/Adafruit_nR ... g.cpp#L349
as common it is 40 channels bit mapping, bit 1 is disabled, please try to set all to 1s except bit0 and bit39 to see if it works out.

hathach
 
Posts: 1108
Joined: Tue Apr 23, 2013 1:02 am

Re: setting bluetooth channel for CE testing

by kevinjwalters on Mon Aug 03, 2020 8:00 pm

Do they mean channels 0 and 39 in Bluetooth Low Energy or do they mean the lowest frequency channel and the highest? They aren't quite the same thing. See diagram on https://microchipdeveloper.com/wireless ... r-channels

kevinjwalters
 
Posts: 730
Joined: Sun Oct 01, 2017 3:15 pm

Re: setting bluetooth channel for CE testing

by hathach on Tue Aug 04, 2020 2:31 am

I am pretty sure it is channel number of bluetooth, though I am not 100% sure. If you want to be sure, maybe ask this question on Nordic devzone, they should be able to provide the exact answer.

hathach
 
Posts: 1108
Joined: Tue Apr 23, 2013 1:02 am

Re: setting bluetooth channel for CE testing

by chetled on Thu Aug 06, 2020 7:45 am

I'm trying to complete the same for CE testing with an NRF52, the test house has asked for channels to be locked to low, medium and high frequencies - I've confirmed this with them as channels 37, 17 and 39.

I've edited BLEAdvertising.cpp as advised, so for channel 37 it is now:
Code: Select all | TOGGLE FULL SIZE
.channel_mask  = { 0xff, 0xff, 0xff, 0xff, 0xdf } 


but I've come up against a problem - how do I test this is working? With this code change the device does not show up in Bluefruit Connect (or other BLE scanners). The NRF52 is still running but I have no way to confirm if its working as expected.

When restricted to 1 channel is there a reason why Bluefruit Connect can't see it?

chetled
 
Posts: 8
Joined: Tue Jul 03, 2018 3:02 pm

Re: setting bluetooth channel for CE testing

by hathach on Thu Aug 06, 2020 9:24 am

Hmm, are you entirely sure the

Code: Select all | TOGGLE FULL SIZE
.channel_mask  = { 0xff, 0xff, 0xff, 0xff, 0xdf }


has channel 37 enabled, if it goes from bit 0 to bit 39, the last byte should be 0xf7. I haven't tried testing this, therefore I am not sure about the bit order, but 0xdf doesn't make sense either way. If possible you should try to flash one of the board with ble analysis firmware from Nordic for low-level radio scanning. It should be able to see which freq is advertising.

UPDATE: @kevinjwalters, according to Nordic doc, bit 0 is channel 0, bit39 is channel 39.

Code: Select all | TOGGLE FULL SIZE
/**@brief Channel mask (40 bits).
 * Every channel is represented with a bit positioned as per channel index defined in Bluetooth Core Specification v5.0,
 * Vol 6, Part B, Section 1.4.1. The LSB contained in array element 0 represents channel index 0, and bit 39 represents
 * channel index 39. If a bit is set to 1, the channel is not used.
 */
typedef uint8_t ble_gap_ch_mask_t[5];

hathach
 
Posts: 1108
Joined: Tue Apr 23, 2013 1:02 am

Re: setting bluetooth channel for CE testing

by chetled on Thu Aug 06, 2020 10:26 am

My understanding is that to use only channel 37 all bits must be 1 expect the bit corresponding to that channel

For 37 this is the last element of the array, if the LSB of the first element corresponds to channel 0, then the LSB of the last element corresponds to channel 32 and the MSB to 39:

Code: Select all | TOGGLE FULL SIZE
39 38 37 36 35 34 33 32
 1  1  0  1  1  1  1  1


0b11011111 = 0xdf

chetled
 
Posts: 8
Joined: Tue Jul 03, 2018 3:02 pm

Re: setting bluetooth channel for CE testing

by hathach on Thu Aug 06, 2020 10:35 am

you should order all 40 bit in the whole array, I don't think it is ordered in group of 8, the last byte would have the reversed order of yours. Please try to find an extra board to use as analyzer, that way could make sure which channel is active. Or maybe using some analyze software on PC, I am not familiar with either of two.

hathach
 
Posts: 1108
Joined: Tue Apr 23, 2013 1:02 am

Re: setting bluetooth channel for CE testing

by chetled on Fri Aug 07, 2020 6:48 am

Ok so I found my nrf52 dev kit and loaded up the sniffer/wireshark

Firstly, the bit mapping seems to be as I suspected

With a bit set on an advertising channel. advertising only happens once, its like once it gets to the channel that is disabled it doesn't go any further. I'll just get max 2 packets captured.

If a bit is set randomly (e.g. bit 19) then no advertising takes place

chetled
 
Posts: 8
Joined: Tue Jul 03, 2018 3:02 pm

Re: setting bluetooth channel for CE testing

by hathach on Fri Aug 07, 2020 7:18 am

Advertising cannot be randomly on any channels, check out nordic and/or ble spec for details

hathach
 
Posts: 1108
Joined: Tue Apr 23, 2013 1:02 am

Re: setting bluetooth channel for CE testing

by chetled on Fri Aug 07, 2020 7:25 am

I mean if i set bit 19, to disable channel 19, then no advertising packets are captured

chetled
 
Posts: 8
Joined: Tue Jul 03, 2018 3:02 pm

Re: setting bluetooth channel for CE testing

by hathach on Fri Aug 07, 2020 8:10 am

Ahhhh, to be honest, you have more experience than me on this. Since I haven't tried to do any of these. Please try to do more hand-on with the API and sniffer. If it doesn't make sense anymore, you should post an question on Nordic devzone. They should understand their API better than us.

hathach
 
Posts: 1108
Joined: Tue Apr 23, 2013 1:02 am

Re: setting bluetooth channel for CE testing

by chetled on Fri Aug 07, 2020 8:15 am

I will keep trying it, i've installed the sdk and am about the try the channel mask there.

The reason I use arduino is to avoid this sort of thing!

chetled
 
Posts: 8
Joined: Tue Jul 03, 2018 3:02 pm

Re: setting bluetooth channel for CE testing

by chetled on Thu Aug 13, 2020 3:32 pm

Ok just to update, using the Nordic SDK things mostly worked as expected although it does not allow you to turn off all advertising channels.

What I have since discovered is that for CE testing they do not want the channels locked as I and the OP had thought.

What you need to do is set the a constant modulated signal on the frequencies defined, you can do this using the DTM code provided with the SDK which is then commanded over serial. OP if you need some help with this just ask

chetled
 
Posts: 8
Joined: Tue Jul 03, 2018 3:02 pm

Please be positive and constructive with your questions and comments.