Page 1 of 1

turn on bluetooth rp3b+

Posted: Thu Apr 18, 2019 11:39 pm
by Student_AJ
good morning,

my name is AJ, i'm a high school student new to rpi. I was looking into how to turn on and off the bluetooth on rpi using python, but I was not able to find anything that is applicable to what I am attempting to do.

please help, all help is kindly appreciated!

Re: turn on bluetooth rp3b+

Posted: Fri Apr 19, 2019 1:52 am
by Andyroo
You could have a look at https://github.com/pybluez/pybluez BUT its not being updated at this time.

Adafruit have released https://github.com/adafruit/Adafruit_Python_BluefruitLE - it’s experimental/ new and may need their module if it does not work fully on the Pi :o

You may be able to mod https://github.com/abstrakraft/cwiid to communicate with something other than a Wii remote!

There is over 150 projects for Python under Linux https://pypi.org/search/?q=Bluetooth - they may not be available on the Pi without a build though.

Re: turn on bluetooth rp3b+

Posted: Fri Apr 19, 2019 1:19 pm
by Douglas6
What exactly do you mean by "turn on and off the bluetooth"? You could run a shell command from Python to bring the adapter up or down:

Code: Select all

sudo hciconfig hci0 up 
or

Code: Select all

sudo hciconfig hci0 down