Are your devices paired? (Use Bluetoothctl for that)
I am using rfcomm client and server , the server is listening on port 1 and i provide the client with the exact port and the address of the edison board so i guess no pairing is needed right ?
I guess it would not hurt to try. Try to pair it, and make your Edison "trust" the other device. (all in bluetoothctl, just type help)
You used the code there right? Communicating with RFCOMM
That is the reason I stopped using Classic Bluetooth for communication. When it does not work, you don't know why. When it works you don't know why either. There just no clear step and making it work. Bluetooth low energy is much more sane in my opinion.
Yes I see ur point but can i make a client/server model using BLE ? Because what i am more concerned of is doing the connection between the 2 devices using BLE .
what is the other device? To make it work with LE it would need to have a GATT server like the Arduino 101 or Adafruit bluefriend
I want to make the edison as the server and an android app the client, what i am testing now is Edison to Edison communication with the rfcomm server and client python codes
1 of 1 people found this helpful
Just tried this morning rfcomm bewteen my Edison and a Udoo Neo (similar to raspberry Pi) device and it worked.
I used the code there : pybluez/examples/simple at master · karulis/pybluez · GitHub
To make it work on the Edison side as a server, I had to modify the bluetooth startup script a little bit :
in this file : /lib/systemd/system/bluetooth.service
add the -C flag to this command
PS (It worked without having to do any pairing)
Thank you for your reply, But i am a little bit confused ,Where would the GATT server be allocated as the client and the server are rfcomm ?
Sorry, my post was confusing!
what I meant is that bluez is shipped with a working gatt server.
you would need to add custom characteristics to that GATT server to make a communication between your Android phone working as a BLE Central.
If you want to test the current Gatt server, just get on your android device a bluetooth low energy browser.
On your Edison run this command:
hciconfig hci0 leadv 0 (this will start advertising and will let other central connect to the Edison)
there is a couple services already defined like the current time service
Thank you for ur reply once again , So i guess there is no relation between the rfcomm communication and the GATT server and client right ??
Also to create a gatt server on the edison do i write a code or is only a matter of commands ? Sorry for my many questions and thank you for always replying
Nope, there is no relation with RFCOMM and GATT.
If you take a look there, you can see commands for setting advertising data :
But I think that adding characteristics is more a matter of writing code/plugin. Take a look at this tutorial :
I investigated yesterday how to add custom characteristics to the GATT server in Bluez. I tried several Bluez Versions.
The current Edison firmware is using Bluez 5.24
In the latest version (5.37) there is some interesting binary included in the test directory
from there, I'm a bit lost, I cant find and dont understand the doc and the example code.
If you would like to experiment with different Bluez Version, it is really easy to compile.
Just get the version you want there : https://www.kernel.org/pub/linux/bluetooth/
wget --no-check-certificate https://www.kernel.org/pub/linux/bluetooth/bluez-5.37.tar.gz
tar -xvf bluez-5.37.tar.gz
./configure --enable-maintainer-mode --enable-experimental --disable-systemd --disable-udev --disable-cups --disable-obex --enable-library
cp src/bluetoothd /usr/lib/bluez5/bluetooth/bluetoothd
systemctl restart bluetooth
You can also run
to make sure you have the version of Bluez you want to try
I'm sorry that I cant help you more than that.
Thank you so much for your time,Appreciate it.