You are not logged in.
Pages: 1
Hi all, I'm trying to connect to a Bluetooth device from within a script similar to this: https://bbs.archlinux.org/viewtopic.php?id=215194
I want to be able to run the pairing process from the script as well though. Ideally what I want to do is pair the device then interact with it in python. I want to make this as smooth as possible for the user, I don't want them to have to manually run bluetoothctl or hcitool, there should be an option in the CLI of the python script to pair new devices.
I've tried running bluetoothctl as a subprocess and interacting with it but that doesn't pair and it (seemingly inconsistently) steals stdin and stdout from my script.
Offline
PyBluez won't do pairing though, at least as far as I can tell from the terrible documentation.
(Edited) I've been using PyBluez to talk to the device and it works fine but I can't communicate with the device without first pairing. Using bluetoothctl works but I can't do it non-interactively.
Last edited by DevilToad (2018-07-09 12:45:02)
Offline
Just in case someone else needs this, the solution looks to be using rfcomm as per this article: https://www.pcsuggest.com/linux-bluetoo … ool-bluez/
Offline
Pages: 1