Due to high demand expect some shipping delays at this time, orders may not ship for 1-2 business days.
0

Pushing telemetry from Circuit Playground Bluefruit to PC
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

Pushing telemetry from Circuit Playground Bluefruit to PC

by burpees_NH on Sun Apr 04, 2021 9:46 am

Hi. I have multiple Circuit Playground Bluefruit, and I want to "push" data from the BF device to a PC it's been previously paired to.

Here is the outline I am hoping is possible.
[list=]Pair Circuit Playground Bluefruit(s) to Raspberry Pi
Then at regular intervals, the Bluefruit device(s) push telemetry (light and temp values) to the Pi
Lastly, the Bluefruit pulls info from the Pi (values for the NeoPixels[/list]

I know I "could" approach this by triggerering the exchange from the Pi (and indeed, I found some examples like pushing a raster image to a BF display).
This is not as ideal (I am imagining I have a million BF devices -- someday!).
It feels more practical for the Pi to not poll devices, and instead have the devices phone home.

The information I am having trouble locating is: how to initiate a data exchange from the BF device.

I'm still searching but if you know of an example (of at least: pushing from BF to a PC) that would be awesome. Thanks.

burpees_NH
 
Posts: 73
Joined: Wed Dec 15, 2010 5:31 pm

Re: Pushing telemetry from Circuit Playground Bluefruit to P

by jevada on Sun Apr 04, 2021 12:15 pm

A couple of solutions: (a) put the Pi in peripheral mode and use the adafruit in central mode or (b) use beacons instead of a connection model. Both are doable, though I think from these two only option (a) is supported in the adafruit framework,

Note: I don't use circuit playground, so YMMV.

jevada
 
Posts: 163
Joined: Fri Dec 15, 2017 5:29 am

Re: Pushing telemetry from Circuit Playground Bluefruit to P

by burpees_NH on Sun Apr 04, 2021 10:53 pm

Thanks. I've barely scratches the surface of available documentation, so I'm not yet certain what "peripheral mode" or "central mode" means, but this led me to other documentation (and even reading between the lines, still does clarify things).

If you say "b" is not possible, so the narrow BLE examples I have found so far must be using "a". But all of those examples I see (so far) only exchange data if the host PC (Pi) polls the devices, or otherwise somehow initiates the connection which in turn means the PC has to keep track of which device IDs it wants to query.

I was hoping for something that would put the connection burden on the BF device, but it doesn't sound like we're there yet, so I'll have to compromise and just poll the devices for now. Thanks

burpees_NH
 
Posts: 73
Joined: Wed Dec 15, 2010 5:31 pm

Re: Pushing telemetry from Circuit Playground Bluefruit to P

by burpees_NH on Sun Apr 04, 2021 10:57 pm

It sounds like my Pi will need to poll the Circuit Express BF device(s). I've found code that lets you read sensors (from the Pi), and I've found examples that let you push config or data to the Express BF board. I have not (yet) found an example that combines these two flows (if anyone's seen this, a link is much appreciated!)

burpees_NH
 
Posts: 73
Joined: Wed Dec 15, 2010 5:31 pm

Re: Pushing telemetry from Circuit Playground Bluefruit to P

by burpees_NH on Tue Apr 06, 2021 7:57 am

Just inviting additional responses in case there are some good resources I have missed. :-)

(@jevada's answer was helpful, I'm just trying to work out "option a" in terms of specifics.)

burpees_NH
 
Posts: 73
Joined: Wed Dec 15, 2010 5:31 pm

Re: Pushing telemetry from Circuit Playground Bluefruit to P

by adafruit_support_mike on Wed Apr 07, 2021 11:16 pm

Bluetooth separates devices into 'central' and 'peripheral' categories. Central devices set up and control all data connections, while peripherals just wait for a central to tell them what to do.

That means there's no way for a peripheral device to 'push' data to anything. It can't create a connection to any other device, and there's no concept of peer-to-peer communication.

You can define BLE characteristics with a 'notify' property though. If the characteristic's value changes while the peripheral is paired with a central, the peripheral can emit a short message saying there's a new value. The central device still has to read the notification and then request the new value though.

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

Please be positive and constructive with your questions and comments.