added bluetooth face hack by Systemic (in Slack)

This commit is contained in:
waxwing 2019-10-06 09:28:19 -04:00 committed by GitHub
parent 7bde5a0210
commit 76f75c0751
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -36,3 +36,67 @@ Some of this guide will work with other framebuffer-based displays.
- Reboot.
And you should be good!
---
### Pwnagotchi face via Bluetooth
Last tested on | Pwnagotchi version | Working? | Reference
---------------|--------------------|----------|-----------|
2019 October 6 | Unknown | :white_check_mark: | on Android
2019 October 6 | Unknown | :white_check_mark: | on iPad iOS 9.3.5
A way to view your Pwnagotchi's ~~face~~ UI wirelessly via Bluetooth on a separate device. Refresh rate is the same as the e-ink display (every few seconds). This is NOT Bluetooth tethering; this is only Bluetooth as a server on pi side; you connect the Bluetooth and get a DHCP IP address and that's it. This hack cannot leverage the data connection.
Contributed by Systemic in the Slack.
##### 1. First Step
- Comment out the Bluetooth disable line from `/boot/config.txt` : `#dtoverlay=pi3-disable-bt`
- Change `/root/pwnagotchi/config.yml` to have `0.0.0.0` instead of `10.0.0.2` to listen as well on Bluetooth.
- Then launch the following commands:
##### 2. Install required packages.
```sudo apt-get install bluez bluez-tools bridge-utils dnsmasq```
##### 3. Configure Bluetooth and start it.
```sudo modprobe bnep
sudo brctl addbr pan0
sudo brctl setfd pan0 0
sudo brctl stp pan0 off
sudo ifconfig pan0 172.26.0.1 netmask 255.255.255.0
sudo ip link set pan0 up
```
```cat <<- EOF > /tmp/dnsmasq_bt.conf```
```bind-interfaces
port=0
interface=pan0
listen-address=172.26.0.1
dhcp-range=172.26.0.2,172.26.0.100,255.255.255.0,5m
dhcp-leasefile=/tmp/dnsmasq_bt.leases
dhcp-authoritative
log-dhcp
```
```EOF```
```sudo dnsmasq -C /tmp/dnsmasq_bt.conf
sudo bt-agent -c NoInputNoOutput&
sudo bt-adapter -a hci0 --set Discoverable 1
sudo bt-adapter -a hci0 --set DiscoverableTimeout 0
sudo bt-adapter -a hci0 --set Pairable 1
sudo bt-adapter -a hci0 --set PairableTimeout 0
sudo bt-network -a hci0 -s nap pan0 &
```
##### 4. Finally: on your phone, you have to disable all existing interfaces:
- Shutdown WiFi.
- Shutdown mobile data.
- Connect to the newly available Bluetooth device (which has the name of your Pwnagotchi).
- Once connected, you can test: `http://172.26.0.1:8080`
- You can also install bettercap's UI (`sudo buttercap` then `ui.update`)
- You'll need to change the http caplets to change `127.0.0.1` to `0.0.0.0`.
- You can connect to the shell with a terminal emulator ...
Happy tweaking.