Community
cancel
Showing results for 
Search instead for 
Did you mean: 
rhela1
Novice
1,337 Views

Multiple Android to Edison connections using SPP-loopback.py

I am trying to connect several android phones to one Edison board. The steps I do so far are:

1- run SPP-loopback.py on the Edison board

2- run Bluetooth application on Android phone

This works well and data is loop back if one phone is connected. However, when multiple phones connect, data can be sent from the phone to the Edison, however it is not loopback and does not appear on the Edison side until the first connection is closed. An example output is shown below:

root@oldedison:~# python SPP-loopback.py

NewConnection(/org/bluez/hci0/dev_60_AF_6D_50_3D_A8, 10)

received: hi1

all done

NewConnection(/org/bluez/hci0/dev_74_45_8A_30_5B_43, 11)

received: hi there

received: hi2

all done

My question is can I display both connections output at the same time without closing the first one? Does this happen due to the fact that both connections have the same UUID?

Thank you;

Rana Helal

3 Replies
Pedro_M_Intel
Employee
47 Views

Hello rana.helal,

I just ran a test just like yours. And in fact I was not able to see both outputs at the same time. I don't think it has anything to do with the UUID, but with SPP-loopback.py itself. I think it is the example itself that only receives the first connection available. So my suggestion is that if you want to achieve that behavior, you will have to study the example's source. Then you will have to modify it and get it to catch a second connection in another port. This may prove challenging but it sounds like a cool project to work on.

Peter.

rhela1
Novice
47 Views

Dear Intel_Peter;

I actually tried running the SPP-loopback twice in the background but varying the UUID in each time and it worked. I was actually able to communicate with two smartphones to one edison at the same time. This can be done as follows:

root@oldedison:~# python SPP-loopback.py "1101" &

root@oldedison:~# python SPP-loopback.py "1105" &

 

Do not forget to change the UUID in the mobile phones as well.

 

Best Regards;

Rana Helal

AMont11
New Contributor I
47 Views

Hi,

I am trying to connect the edison with python bluetooth to collect acell data and symaltenous connect to an android app and send updates ? Is this possible with python? if not, how can i achieve this ?

thanks !

Reply