NI Linux Real-Time Discussions

cancel
Showing results for 
Search instead for 
Did you mean: 

Enabling bluetooth on myRIO with ble dongle

Hello all,

I am trying to communicate between  a App that i created in andriod studio and the myRIO using bluetooth low energy.

I am able to enable bluetooth on the myRIO using the bluez stack software.

I am using a bluetooth dongle that i was able to bring up and enable.

The problem i am having is that i cant communicate with the app to test if the app is sending data over bluetooth.

The app can see the bluetooth dongle and i am using the "hcidump -R"  to see if data is being sent but unsure if this is the right command. Once i can see data i would like to send to labview for parsing. Also not sure on this cause i planned to send this data to file and then labview open it and parse the data. The problem is that i cant even create the file or find it.

0 Kudos
Message 1 of 8
(4,870 Views)

One of the difficulties in working with Bluetooth prior to 2016 was that the Bluetooth stack was not enabled in the kernel, meaning that you'd need to manage and work with the raw Bluetooth data.

I've not done this myself, but from reading the manpage for hcidump, it seems like the right tool for the job.

So, let's start with some basic questions: what version of the OS (as reported by MAX or uname -r) are you using? What Bluetooth module are you using?

0 Kudos
Message 2 of 8
(4,385 Views)

i am using NI Linux Real-Time ARMv7-A 4.1.15-rt17-ni-4.0.0f1" and am using the csr8510 ble dongle that i was successly able to dectect and use. I can scan for devices and so forth but like i said i need to verify that my app is sending ble data? as i said the hcidump seems to be the solution but i cant pick up anything.

Also do you know what command can give me the uuid of the device?

0 Kudos
Message 3 of 8
(4,385 Views)

It seems like there's been some troubles getting this particular device working if it doesn't come up in HCI mode (some implementations don't, done do). Look in the kernel messages after plugging in the device for details about an HCI device (especially since you're using a 2016 OS image)

I generally use hciconfig and hcitool to interact with bt devices, e.g. "hcitool dev" to list local (to the system) devices (with uuid or the Bluetooth address). If you don't see any local devices available for taking with other devices, you may need to use hciconfig to configure the controller. There are many great lower-level guides to working with Bluetooth on Linux systems to get you started

0 Kudos
Message 4 of 8
(4,385 Views)

I think you are misunderstanding what im saying i am able to detect the ble dongle on the myrio. Please see image below. the problem is pairing the device with a custom built app i created that just  reads the states of virtual push buttons i created in the app. So when i press a push button in the app  i want to read and view that data in the command line then save it to a file which i assumed using the hcidump command i could do this. If there another way would be happy to hear it. I hope this clears up what im trying to do.

ble_detect.PNG

0 Kudos
Message 5 of 8
(4,385 Views)

Help me understand your application better. The application you've written that provides the push buttons, what Bluetooth profile are you using on the application? Is the application attempting to connect to a listener (server) or providing a listener (server)? What do you mean, precisely, when you say "pairing the devices", what are you trying and what are the results?

Most often, your Linux machine will either need to advertise the services/profiles that you want to provide or to scan and connect to services offered by other Bluetooth devices.

0 Kudos
Message 6 of 8
(4,385 Views)

okay so the app has four virtual pushbuttons when i press either one of the four pushbuttons  it will send a 4bit binary number( etc. 0000,0001,........1111)  over ble to the myrio to view in linux and then will send to file to be later accessed by labview to parse and interact with the leds on the myrio.

1. I dont know which bluetooth profile to use in the app.

2. I will connect to myrio from the app so the app is the central.

3. unsure which services to advertise to get the data from the app from  my linux machine.

4. as in bluetooth profile you mean like (pxp,htp,hog.tip,cscp, and so forth) correct.

0 Kudos
Message 7 of 8
(4,385 Views)

> 4. as in bluetooth profile you mean like (pxp,htp,hog.tip,cscp, and so forth) correct.

That's correct, basically asking how you were intending to expose the information to the myrio. I am unsure (as Android development is not something I have experience with) that you can simply treat the connection between two Bluetooth devices as just a dumb data pipe.

0 Kudos
Message 8 of 8
(4,385 Views)