I am trying to set up a raspberry pi bluetooth speaker and I was wondering if there was a way to set up the pi so it is always discoverable.

Meaning, I turn the pi on, it automatically starts bluetooth and puts itself in discovery mode, on my phone / device I connect to the pi which automatically pairs without a PIN, and connects.

If I disconnect my phone I would like the raspberry pi to automatically go back into discovery mode to be able to be paired with another device (Without using PIN)

Would anyone know how to set this up?

Thanks, Chay Brandon


You can write a bash init.d script consisting of commands that turns on discovery mode and all other functions that you require.

something like sudo nano /etc/init.d/bluetooth

which consists of command: hciconfig hci0 piscan

you can also put the above command in the file /etc/rc.local. that will put the raspberry pi on discoverable each time it boots.

Following links provides a good explanation and tutorial on how to create a init.d script: http://www.tldp.org/HOWTO/HighQuality-Apps-HOWTO/boot.html http://raspberrywebserver.com/serveradmin/run-a-script-on-start-up.html

Good Luck. Asif Nadeem.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.