drifterf
Posts: 136
Joined: Sat Dec 08, 2018 9:09 am
Location: Northants, England

control a GPIO from bluetooth

Thu Aug 22, 2019 3:25 pm

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

User avatar
MrYsLab
Posts: 376
Joined: Mon Dec 15, 2014 7:14 pm
Location: Noo Joysey, USA

Re: control a GPIO from bluetooth

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

drifterf
Posts: 136
Joined: Sat Dec 08, 2018 9:09 am
Location: Northants, England

Re: control a GPIO from bluetooth

Sat Aug 24, 2019 4:08 pm

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

Return to “Python”