Page 1 of 1

control a GPIO from bluetooth

Posted: Thu Aug 22, 2019 3:25 pm
by drifterf
hi everyone, i have seen you can download a app on android to control the GPIO of the pi via bluetooth. i am after doing this but simply want the following.

when the phone is on with the app and it comes into range and connects to the pi it triggers a gpio automatically, then when out of range and loses the connection is turns the gpio off..

could someone help with the best way of doing this please ?

thanks

Re: control a GPIO from bluetooth

Posted: Thu Aug 22, 2019 5:22 pm
by MrYsLab
Your question is very broad. It is not clear if you are asking how an Android app automatically connects to a Bluetooth device in range, how do you use Bluetooth to control a GPIO pin or both.

For the GPIO and Bluetooth question, you can check out my blog https://mryslab.github.io/bots-in-pieces/index.html, where I developed an Android App to control a robot over Bluetooth. For the auto-connect question, you might want to look at https://stackoverflow.com/questions/265 ... n-in-range

Re: control a GPIO from bluetooth

Posted: Sat Aug 24, 2019 4:08 pm
by drifterf
thank you, to put it simple when the device is in range and connects to bluetooth i want it to trigger a gpio pin and do this everytime it connects
MrYsLab wrote:
Thu Aug 22, 2019 5:22 pm
Your question is very broad. It is not clear if you are asking how an Android app automatically connects to a Bluetooth device in range, how do you use Bluetooth to control a GPIO pin or both.

For the GPIO and Bluetooth question, you can check out my blog https://mryslab.github.io/bots-in-pieces/index.html, where I developed an Android App to control a robot over Bluetooth. For the auto-connect question, you might want to look at https://stackoverflow.com/questions/265 ... n-in-range