Community
cancel
Showing results for 
Search instead for 
Did you mean: 
PIcar
Novice
1,829 Views

Using the Intel Edison as a low energy bluetooth scanner on eclipse or Arduino IDE?

Hello I recently purchased an Intel Edison, and i was wondering how I would go about using this device to scan for BLE signals. I would like to see identifiers such as UUID, MAC address, and RSSI if possible. I understand how to perform a low energy scan through linux commands but I would like to do that through a C program using the Edison. Any help would be much appreciated, thank you.

6 Replies
Pedro_M_Intel
Employee
50 Views

Hello projectIcarus2015,

As you may know, you can only retrieve a BLE device's UUID if you have already connected to it, so if what you need is general information from all devices, this will probably be hard to get. Nevertheless, the MAC address and RSSI information can be retrieved without connecting to the devices.

To get the MAC address it is as easy as to use "hcitool lescan". But in order to find the RSSI of the BLE devices you will have to use the command "btmon". Enter the commands in this order:

btmon &

hcitool lescan

Now, when the Edison detects a BLE device you should be able to see both the MAC address and the RSSI strength.

In order to retrieve all this information from a script you will have to make http://www.tutorialspoint.com/c_standard_library/c_function_system.htm system calls. So my suggestion would be for you to make a system call that stores all the information you need in a file and then open that file and retrieve the information you need.

By the way if you want to retrieve the UUID from a device, you will have to install GATTTool. You can follow these steps to do so:

wget https://www.kernel.org/pub/linux/bluetooth/bluez-5.24.tar.xz https://www.kernel.org/pub/linux/bluetooth/bluez-5.24.tar.xz --no-check-certificate

tar -xvf bluez-5.24.tar.xz

cd bluez-5.24

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

make

make install

export PATH=$PATH:~/bluez-5.24/attrib/

Peter.

PIcar
Novice
50 Views

Hey peter I'm in the process of installing the GATTTool but right after I enter command line 2 tar -xvf bluez-5.24.tar.xz

I get an error saying invalid tar magic.

Pedro_M_Intel
Employee
50 Views

That is very strange; I just tried it on a recently flashed Edison. I followed the steps above and I had no issues. Was the BlueZ package downloaded correctly?

Can you send me a screenshot of the error message?

Peter.

PIcar
Novice
50 Views

Pedro_M_Intel
Employee
50 Views

That is very weird, I have not issues when running tar. Maybe something's wrong with your Edison's image, why don't you try to reflashing it?

Peter.

Carlos_M_Intel
Employee
50 Views

Hi projectIcarus2015 ,

Did you try by re-flashing the board?

Regards,

Charlie