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

Distinguishing Bluefruits w/50 in a room?
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

Distinguishing Bluefruits w/50 in a room?

by gallaugher on Thu Sep 05, 2019 9:03 pm

Hi!
Last year I had my classes (50 students in each section) buy CPXs. I'm hopeful they'll be able to get their hands on CPX Bluefruits by the end of the semester (I'm actually going to buy them direct this year). I'm wondering if folks have advice on the following:

- I notice when I'm in a room with lots of other folks that likely have smartphones and/or laptops with Bluetooth, it takes quite a while to connect to an Adafruit Bluefruit device (I'm using a Bluefruit LE connected to a Flora in this example, but have also tried when using a Feather M0 Bluefruit). When I have 50 students simultaneously working on projects with CPX Blue, will there be similar delays?
- Is there a way to "name" your CPX or otherwise help students distinguish their device from the 49 others in class? Just realizing that having 50 CPXx scroll through the Bluefruit app will make it difficult to tell which device belongs to whom.

Appreciate any suggestions you may have. Thanks!
John
PS - I posted a version of this to the main forums, but haven't gotten a reply, and assume educators may have more experience w/these sorts of classroom setting issues. Hope that's OK & not spammy.

gallaugher
 
Posts: 166
Joined: Tue Aug 14, 2018 12:42 pm

Re: Distinguishing Bluefruits w/50 in a room?

by adafruit_support_mike on Fri Sep 06, 2019 10:33 pm

You can use the AT+GAPDEVNAME to give each device a unique name:

https://learn.adafruit.com/introducing- ... vname-15-8

Slow connections will probably be inevitable when you have that many devices in a small space. As a low-energy protocol, BLE is susceptible to local interference. With 50 devices, 98% of the signals will be ones you don't want for a specific connection.

The pairing process improves things. Like other software-defined radio protocols, BLE uses channel hopping to avoid interference, and devices negotiate a hop sequence as they pair.

adafruit_support_mike
 
Posts: 61407
Joined: Thu Feb 11, 2010 2:51 pm

Re: Distinguishing Bluefruits w/50 in a room?

by gallaugher on Sat Sep 21, 2019 10:32 pm

Thanks, Mike,
I have a CPX Bluefruit Alpha - it's configured & seems to be working properly with the Bluefruit iOS app. I'm not sure that I have the next steps correct, though.
I've connected to the device, select UART from within the app, then I tried the commands listed under "AT+GAPDEVNAME" at:
https://learn.adafruit.com/introducing- ... vname-15-8

When I enter the very first command in the list and press the "Send" button:
AT+GAPDEVNAME

It shows up in red in the text box above it & I see no response from the CPX.
I've tried going down the list (without the OKs) but all the text above shows in red, and I never get anything other than Received: 0 bytes after the send.

If I can solve this - is this the kind of thing where I'll be able to have students name their device in a less noisy space, like their dorm rooms, then come to class & expect to recognize their name in a list of potential devices to connect to?

Thanks!
John

gallaugher
 
Posts: 166
Joined: Tue Aug 14, 2018 12:42 pm

Re: Distinguishing Bluefruits w/50 in a room?

by adafruit_support_mike on Sun Sep 22, 2019 1:24 am

Tell the BLE module to stop advertising before you change the name, then tell it to start again after changing the name. IIRC, the modules can't change names while transmitting.

adafruit_support_mike
 
Posts: 61407
Joined: Thu Feb 11, 2010 2:51 pm

Re: Distinguishing Bluefruits w/50 in a room?

by gallaugher on Tue Dec 03, 2019 10:45 am

Hi Folks,
I seem to have figured a way to solve this. While it doesn't change the name listed in the Bluefruit app, and this name seems to change, so remembering it isn't useful, it does seem that you can tap any name in the app to reveal additional info, which can include an assigned name. While clicking 50 devices might be tedious, it's at least a mechanism to help people identify their own. Any additional advice is welcome, but here's how I accomplished what I'm describing (using CPB and CircuitPython 5 Beta 0)

Code: Select all | TOGGLE FULL SIZE
# setup bluetooth
ble = BLERadio()
uart_server = UARTService()
advertisement = ProvideServicesAdvertisement(uart_server)
print(advertisement.complete_name)
advertisement.complete_name = "ProfGsCPB"


No additional change needed in standard bluetooth code, you should see this, when expanding a CPB's listing in the Bluefruit app (iOS shown):
IMG_CB071FEE7E58-1.jpeg
IMG_CB071FEE7E58-1.jpeg (233.5 KiB) Viewed 1072 times
Attachments
IMG_CB071FEE7E58-1.jpeg
IMG_CB071FEE7E58-1.jpeg (171.89 KiB) Viewed 1072 times

gallaugher
 
Posts: 166
Joined: Tue Aug 14, 2018 12:42 pm

Re: Distinguishing Bluefruits w/50 in a room?

by adafruit_support_mike on Wed Dec 04, 2019 1:28 am

Adding info to the advertising packet is a good first step. Having each student give their device a unique name after that would probably also help.

adafruit_support_mike
 
Posts: 61407
Joined: Thu Feb 11, 2010 2:51 pm

Re: Distinguishing Bluefruits w/50 in a room?

by kevinjwalters on Mon Jan 20, 2020 7:31 am

Is there a way to set the device name from CircuitPython? Or to run those AT commands from CircuitPython?

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

Re: Distinguishing Bluefruits w/50 in a room?

by V2man on Mon Jan 20, 2020 1:57 pm

ble = BLERadio()
ble.name = "ColorPicker"
uart_server = UARTService()
advertisement = ProvideServicesAdvertisement(uart_server)

V2man
 
Posts: 704
Joined: Mon Dec 03, 2018 12:38 am

Re: Distinguishing Bluefruits w/50 in a room?

by kevinjwalters on Sun May 24, 2020 8:04 pm

@V2man, thanks.

@gallaugher Did you ever try 50 CPBs talking to each other in a room and if so was it all connection based or did you try any broadcasting? I'm just having a play with the latter but I've only got 4 BLE capable devices so can't replicate a cornucopia of CPBs.

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

Re: Distinguishing Bluefruits w/50 in a room?

by kevinjwalters on Mon Jun 15, 2020 4:08 pm

FYI, I've been throwing around a lot of BLE Advertising traffic between nRF52840-based boards (CPB+CLUE) using CircuitPython and I've put the results up on BLE Advertisement strange, acute packet loss.

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

Please be positive and constructive with your questions and comments.


cron