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
received: hi there
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?
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.
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.
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 ?