Closed toncho11 closed 2 years ago
I think I found it:
http://ianharvey.github.io/bluepy-doc/peripheral.html?highlight=peripheral
In the class Peripheral we can select which device we would like to use: On Linux, 0 means /dev/hci0, 1 means /dev/hci1 and so on.
Did this work for you? I am running bluepy on Raspbian and there is no /dev/hciX so setting the iface value does not affect which bluetooth device initiates the connection. See my issue #501. If you got it to work, do you mind sharing what OS you are using?
I got it running on Linux x86-64, actually on WSL2 (which requires a lot of extra effort).
I modified https://github.com/toncho11/pyparrot to use more than 1 Bluetooth device.
You need to search for hci devices with dmesg
command. Kernel messages about hci devices should appear when you plug them in.
Interesting, I am able to see both of these devices as hci devices with specific hciX id's. Perhaps this codebase does not work well with Raspbian? If you call the command 'ls /dev/hci*' do you actually see hciX id's?
Sorry I do not have access right now.
No problem, can you recall what distro you were using? I was thinking of trying this code on Ubuntu.
I use WSL2 (Windows Subsystem for Linux), but you need many things to get Bluetooth working on it. Ubuntu should be OK.
Hi,
Is it possible to select between multiple USB plugged host Bluetooth devices? On my computer I have several Bluetooth devices and I want to initiate a connection from a specific one towards another Bluetooth device. How can I do that?
I think devices are enumerated:
hci0
,hci1
... I do not want to shutdown the not used device, just select another one.