Skip to content
A very simple, silly utility which monitors the Bluetooth interface of a Pwnagotchi and cleanly shuts it down on receiving a command.
Python Shell
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
LICENSE
README.md Initial commits of my "shut down a Pwnagotchi over Bluetooth" hack. Nov 21, 2019
bluetooth-power.sh Initial commits of my "shut down a Pwnagotchi over Bluetooth" hack. Nov 21, 2019
pwnagotchi_bluetooth.py Initial commits of my "shut down a Pwnagotchi over Bluetooth" hack. Nov 21, 2019
requirements.txt

README.md

pwnagotchi-bt-power

A very simple, silly utility which monitors the Bluetooth interface of a Pwnagotchi and cleanly shuts it down on receiving a command from a mobile phone.

Relies upon the Bluedot Python module and Android app to function.

What I was trying to do is shut my Pwnagotchi off without just yanking the power and gambling with corrupting the microSD card every time. Rather than shoehorn in a button to connect to the GPIO pins and figure out which ones weren't being used by the display I have I decided to make use of the Bluetooth interface on my mobile.

The instructions are simple:

  • Install the Python 3 virtualenv utility.
    • sudo apt-get update
    • sudo apt-get install python-virtualenv
  • Install the utility.
    • Clone this repo onto your Pwnagotchi.
    • cd pwnagotchi-bt-power'
    • python3 -mvenv env
    • . env/bin/activate
    • pip install bluedot
  • Set the utility to start up on boot.
    • I use GNU Screen for this. I've included the bluetooth-power.sh script to make life easier for you.
    • Be sure that the startup script runs as the root user!
  • Pair your phone with your Pwnagotchi.
    • RasPi
      • sudo bluetoothctl
      • Type the following commands one at a time:
        • discoverable on
        • pairable on
        • agent on
        • default-agent
    • Phone
      • Settings -> Connections
      • Make sure Bluetooth is turned on.
      • Bluetooth (tap on the word not the switch)
      • Tap on your RasPi in the list.
    • RasPi:
      • 'yes'
      • quit
  • Reboot your Pwnagotchi.

To shut down your Pwnagotchi:

  • Open the Bluedot app on your phone.
  • Tap on your Pwnagotchi in the list.
  • Tap the big blue button.
You can’t perform that action at this time.