Skip to content

a plugin for pwnagotchi that shows your GPS location from GPSD

License

Notifications You must be signed in to change notification settings

kellertk/pwnagotchi-plugin-gpsd

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

pwnagotchi-plugin-gpsd

a plugin for pwnagotchi that shows your GPS location from GPSD

Why?

Bettercap has built in support for GPS devices, and this is how the pwnagotchi gps module gets location information. But Bettercap's GPS support is very bare-bones. By using GPSD we get all of the nice features that GSPD adds:

  • GPS setup and polling earlier in the boot process.
  • More knobs and switches for configuring your GPS.
  • Odd device support.
  • Multiple application support. Your GPS can supply data to pwnagotchi, chrony, gpsmon, and any other app you want at the same time
  • GPS hotplugging.

Requirements

On top of pwnagotchi, you'll need a configured (and tested working!) gpsd, and also gpsd-py3.

As an example:

pi@pwnagotchi:~ $ sudo apt install gpsd gpsd-clients
pi@pwnagotchi:~ $ sudo pip3 install gpsd-py3
pi@pwnagotchi:~ $ sudo bash -c 'cat > /etc/default/gpsd' << EOF
# Default settings for the gpsd init script and the hotplug wrapper.

# Start the gpsd daemon automatically at boot time
START_DAEMON="true"

# Use USB hotplugging to add new USB devices automatically to the daemon
USBAUTO="false"

# Devices gpsd should collect to at boot time.
# They need to be read/writeable, either by user gpsd or the group dialout.
DEVICES="/dev/ttyS0"
# or, if you want to setup with BlueNMEA on your android phone, with bt-tethering :
# DEVICES="tcp://192.168.44.1:4352"

# Other options you want to pass to gpsd
GPSD_OPTIONS="-n"
EOF
pi@pwnagotchi:~ $ sudo systemctl enable gpsd.service
pi@pwnagotchi:~ $ sudo systemctl start gpsd.service
pi@pwnagotchi:~ $ sudo mkdir -p /usr/local/share/pwnagotchi/installed-plugins/

Test out your GPS with gpsmon. These are generic instructions for setting up and testing GPSD, you may need to do something differently.

Setup

In config.toml, set

main.custom_plugins = "/usr/local/share/pwnagotchi/installed-plugins/"
main.plugins.gpsd.enabled = true
main.plugins.gpsd.gpsdhost = "127.0.0.1"
main.plugins.gpsd.gpsdport = 2947

Place gpsd.py in /usr/local/share/pwnagotchi/installed-plugins

Finished!

Here's what it looks like. Sort of. Front image of pwnagotchi

Here's the GPS on the back. Back image of pwnagotchi