Community
cancel
Showing results for 
Search instead for 
Did you mean: 
idata
Community Manager
1,776 Views

Bluetooth Support

How do you setup Bluetooth support in the Joule, classic and BLE. Is the classic support the same as I had done it on the Edison? Since I've never gotten BLE to work on Edison how is it possible to do that with the Joule?

10 Replies
idata
Community Manager
137 Views

Hello jblackston,

 

 

I will try to help you with this. Yes, classic Bluetooth can be accessed just like in Edison, for example, these are the steps I took to pair Joule to my Windows 7 PC:

 

 

rfkill unblock bluetooth

 

bluetoothctl

 

agent DisplayYesNo

 

default-agent

 

scan on

 

# find device MAC address

 

scan off

 

pair XX:XX:XX:XX:XX:XX

 

 

If you would like to use BLE on Joule, you will have to install a bluez version that includes it. These are the steps I took:

 

 

Download bluez 5.24 from https://www.kernel.org/pub/linux/bluetooth/bluez-5.24.tar.xz and copy it to a flash drive then mount your flash drive with the commands:

 

cd /media

 

mkdir flash_drive_name

 

mount /dev/sda1 /media/flash_drive_name

 

cd flash_drive_name

 

cp bluez-5.24.tar.xz /home/root/Desktop

 

tar -xvf bluez-5.24.tar.xz

 

cd bluez-5.24

 

./configure --disable-systemd --disable-udev

 

make

 

make install

 

 

Now go to attrib with cd ./attrib and you will find gatttool, execute the command and you should be able to interact with BLE devices.

 

Let me know.

 

-Peter.
idata
Community Manager
137 Views

Ok, so I was able to connect classically to Bluetooth, but the one issue I'm having from my previous implementation on the Edison is that in reality I do not have command line access in the project. So everything has to be done as though there is no key board or ssh ability into the system. I tried to copy the scripts over that ran on the Edison, but they didn't seem to work even though what you gave me seemed similar to what I had on the Edison. I'm thinking maybe the file structure is different. I've posted the files for you to take a look, maybe I missed something, or something did indeed change. http://www.autoenginuity.com/dloads/bluetooth_pairing.tar.gz http://www.autoenginuity.com/dloads/bluetooth_pairing.tar.gz

The other thing is I was able to figure out on a different Linux version, not the one Edison runs, to control SPP communication and registration via the SDP functions apart of the BlueZ library. However, for it to work when you run the bluetoothd app in the beginning you need to add the "compat" option... I do not see anything like this on the Joule... Any Ideas?

I played with the BLE stuff and it seemed to work... However, like I said above how do I connect to a BLE system for my own applications? Is this something that I just have to grab the attrib src code and just code that into my project?

idata
Community Manager
137 Views

What exactly happened when you ran your scripts? Did you test them directly or did you test them from the service? Is there any difference between doing both methods? Did you check that all of the code's dependencies are installed on Joule? If so, are the package versions the same?

 

 

If you would like to use BLE on your code you will have to use either BlueZ's API or a library such as pygatt ( https://github.com/peplin/pygatt).

 

 

I will be waiting for your response.

 

-Peter.
idata
Community Manager
137 Views

Sorry for the delay, I will rerun the script and get back to you with what I get. Also where do I go to change the name of the module so it's different when I pair the device, instead of the current intel-corei7-64.

idata
Community Manager
137 Views

Hi jblackston,

 

 

Thank you for letting us know, we will be waiting for your update. If you would like to change your Joule's hostname you can do it using the command hostnamectl. Specifically with hostnamectl set-hostname NAME. If you would like to learn more about this command, I suggest you to check its man page in http://www.dsm.fordham.edu/cgi-bin/man-cgi.pl?topic=hostnamectl&ampsect=1.

 

 

Let me know if you are able to change your board's name.

 

-Peter.
idata
Community Manager
137 Views

When I run the hostnamectl to set a different name it changes the on screen name for when I've logged into the device, but when I see it on bluetooth to try and pair to it, however the name is still the original name. Where do I go now to set the broadcast name for the bluetooth of this module?

idata
Community Manager
137 Views

When I run the service command I used in the past with the Edison this is the error I get (this works without any changes in an Edison model):

[[0;1;32mâ—&# 143;[[0m bluetooth-pair.service - Bluetooth pair

Loaded: loaded (/lib/systemd/system/bluetooth-pair.service; enabled; vendor p

reset: enabled)

Active: [[0;1;32mactive (exited)[[0m since Fri 2016-08-12 11:43:47 UTC; 27min

ago

Process: 586 ExecStart=/home/root/bluetooth_pair/bluetooth-pair.sh (code=exite

d, status=0/SUCCESS)

Main PID: 586 (code=exited, status=0/SUCCESS)

CGroup: /system.slice/bluetooth-pair.service

Aug 12 11:43:47 intel-corei7-64 systemd[1]: Started Bluetooth pair.

Aug 12 11:43:58 intel-corei7-64 bluetooth-pair.sh[586]: Traceback (most recent c

all last):

Aug 12 11:43:58 intel-corei7-64 bluetooth-pair.sh[586]: File "/home/root/bluet

ooth_pair/./simple-agent1", line 7, in

Aug 12 11:43:58 intel-corei7-64 bluetooth-pair.sh[586]: import dbus

Aug 12 11:43:58 intel-corei7-64 bluetooth-pair.sh[586]: ImportError: No module n

amed dbus

idata
Community Manager
137 Views

I find that very strange. It did change on my Joule as you can see on the screenshots below:

Do you see a different output? If so, you could also try the following guide: http://linuxcommando.blogspot.com/2013/11/how-to-modify-user-friendly-bluetooth.html http://linuxcommando.blogspot.com/2013/11/how-to-modify-user-friendly-bluetooth.html

Let me know how it goes.

 

-Peter.
idata
Community Manager
137 Views

Hello jblackston,

Do you have any updates about this?

-Peter.

idata
Community Manager
137 Views

I'll get back to you on this in the next couple of days. I'm trying to wrap up a product release.

Reply