{"id":16935455,"url":"https://github.com/virtadpt/pwnagotchi-bt-power","last_synced_at":"2025-04-11T18:53:59.228Z","repository":{"id":144979877,"uuid":"223057886","full_name":"virtadpt/pwnagotchi-bt-power","owner":"virtadpt","description":"A very simple, silly utility which monitors the Bluetooth interface of a Pwnagotchi and cleanly shuts it down on receiving a command.","archived":false,"fork":false,"pushed_at":"2022-03-28T02:18:41.000Z","size":17,"stargazers_count":7,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-25T14:51:15.743Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/virtadpt.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-11-21T01:01:31.000Z","updated_at":"2024-12-29T14:11:41.000Z","dependencies_parsed_at":"2023-04-11T01:31:36.853Z","dependency_job_id":null,"html_url":"https://github.com/virtadpt/pwnagotchi-bt-power","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/virtadpt%2Fpwnagotchi-bt-power","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/virtadpt%2Fpwnagotchi-bt-power/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/virtadpt%2Fpwnagotchi-bt-power/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/virtadpt%2Fpwnagotchi-bt-power/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/virtadpt","download_url":"https://codeload.github.com/virtadpt/pwnagotchi-bt-power/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248464650,"owners_count":21108238,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-13T20:54:35.267Z","updated_at":"2025-04-11T18:53:59.220Z","avatar_url":"https://github.com/virtadpt.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# pwnagotchi-bt-power\nA 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.\n\nRelies upon the [Bluedot Python module](https://bluedot.readthedocs.io/en/latest/) and [Android app](https://play.google.com/store/apps/details?id=com.stuffaboutcode.bluedot\u0026hl=en_US) to function.\n\nWhat I was trying to do is shut my [Pwnagotchi](https://pwnagotchi.ai/) 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](https://www.waveshare.com/wiki/2.13inch_e-Paper_HAT) I decided to make use of the Bluetooth interface on my mobile.\n\nThe instructions are simple:\n\n* Install the Python 3 virtualenv utility.\n  * `sudo apt-get update`\n  * `sudo apt-get install python-virtualenv`\n* Install the utility.\n  * Clone this repo onto your Pwnagotchi.\n  * `cd pwnagotchi-bt-power'`\n  * `python3 -mvenv env`\n  * `. env/bin/activate`\n  * `pip install bluedot`\n* Set the utility to start up on boot.\n  * [I use GNU Screen for this.](https://drwho.virtadpt.net/archive/2017-06-11/restarting-a-screen-session-without-manual-intervention)  I've included the `bluetooth-power.sh` script to make life easier for you.\n  * Be sure that the startup script runs as the root user!\n* [Pair your phone with your Pwnagotchi.](https://bluedot.readthedocs.io/en/latest/pairpiandroid.html)\n  * RasPi\n    * `sudo bluetoothctl`\n    * Type the following commands one at a time:\n      * `discoverable on`\n      * `pairable on`\n      * `agent on`\n      * `default-agent`\n  * Phone\n    * Settings -\u003e Connections\n    * Make sure Bluetooth is turned on.\n    * Bluetooth (tap on the word not the switch)\n    * Tap on your RasPi in the list.\n  * RasPi:\n    * 'yes'\n    * `quit`\n* Reboot your Pwnagotchi.\n\nTo shut down your Pwnagotchi:\n\n* Open the Bluedot app on your phone.\n* Tap on your Pwnagotchi in the list.\n* Tap the big blue button.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvirtadpt%2Fpwnagotchi-bt-power","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvirtadpt%2Fpwnagotchi-bt-power","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvirtadpt%2Fpwnagotchi-bt-power/lists"}