What is Bluedot?
BlueDot is a simple android application that has a Python API you can use to create custom actions to be executed on your Raspberry Pi without requiring a Wi-Fi connection. With the simple to use Python API you can make it execute any action you can think of, from updating your system, restarting, or launching Wi-Fi attacks.
It can do a little more then you would assume by seeing it. How much could one button do? Well it has the capability to detect rotation, swipes, press, release, and double press’s. So we can assign multiple actions to our button and have it do different things. If your reading this I assume you know at least basic python, and have a Raspberry Pi setup with Raspbian (I use the light version).
Install BlueDot
sudo pip3 install bluedot -y
Installing BlueDot is as simple as that on Raspbian. I will state here I am not a professional when it comes to python, I use it quite a bit for my Raspberry Pi projects.
Pairing Android and Raspberry Pi
sudo bluetoothctl
agent on
default-agent
scan on
pair XX:XX:XX:XX:XX:XX
connect XX:XX:XX:XX:XX:XX
exit
Replace XX:XX:XX:XX:XX:XX with the mac address of your phone. Your now connected via bluetooth so we are ready to write some code to make the application talk to our Raspberry Pi.
Basic Bluedot Python3 Example
#BluedotExample1.py
from bluedot import BlueDot
bd = BlueDot()
bd.wait_for_press()
print("Ayyyy you can push a button.")
First we import from the Bluedot library so we can have access to their methods. Then we create a variable bd with a new instance of our BlueDot class. We will then call wait_for_press() this will simply wait for the button to be pressed. Then execute any code below that line, in our case its our print statement.
You can now run the simple script and then connect to it using the android application, push the button and test it out.Make sure to run the script before trying to connect.
sudo python3 BluedotExample1.py
The script will wait for the application to connect and the button to pushed and result in the following output on the Pi:
Ayyyy you can push a button.
Well you did it, your Android is now talking with your Pi over Bluetooth,and that wasn’t that complicated but it also doesn’t do much.
Just a few things you can do:
- Restart the Pi
- Trigger a WiFi jamming attack
- Update the Pi
- Change your music
- Change volume levels
- Anything you can code in Python
Check out part 2, where we will make something more useful then a simple print command. Were going to set up a simple structure with multiple menus and options.