Has anyone succeeded in making an rfcomm communication between the edison board as the rfcomm server and another device being the client and exchange messages between them.
As i am having a problem in the client to connect to the server on the board.
Thanks in advance.
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? http://people.csail.mit.edu/albert/bluez-intro/x232.html 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.
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
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 : https://github.com/karulis/pybluez/tree/master/examples/simple 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)
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 :
http://gaiger-programming.blogspot.ca/2015/01/bluetooth-low-energy-customizing-gatt.html programming, mostly : BLE in Linux One : Bluez GATT Server Concept
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.
http://git.kernel.org/cgit/bluetooth/bluez.git/tree/doc/gatt-api.txt bluez.git - Bluetooth protocol stack for Linux
http://git.kernel.org/cgit/bluetooth/bluez.git/tree/plugins/gatt-example.c bluez.git - Bluetooth protocol stack for Linux
http://git.kernel.org/cgit/bluetooth/bluez.git/tree/tools/btgatt-server.c bluez.git - Bluetooth protocol stack for Linux
If you would like to experiment with different Bluez Version, it is really easy to compile.
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.
Anyway, did you try
https://github.com/karulis/pybluez/tree/master/examples/simple pybluez/examples/simple at master · karulis/pybluez · GitHub
They all worked for me on two different Linux board.