From 44c26c8943d409a0f9566c4cc48a886e3f062c73 Mon Sep 17 00:00:00 2001 From: llamasoft Date: Sat, 8 Oct 2022 17:48:34 +0000 Subject: [PATCH] Update GPS plugin to allow connecting to GPSD Bettercap supports connecting to a GPSD server with hostname:port since v2.29. This allows users to use GPSD/chrony to set the system clock while still being able to use the GPS plugin. Signed-off-by: llamasoft --- pwnagotchi/defaults.toml | 2 +- pwnagotchi/plugins/default/gps.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pwnagotchi/defaults.toml b/pwnagotchi/defaults.toml index c554968d7..c757a85a6 100644 --- a/pwnagotchi/defaults.toml +++ b/pwnagotchi/defaults.toml @@ -33,7 +33,7 @@ main.plugins.net-pos.api_key = "test" main.plugins.gps.enabled = false main.plugins.gps.speed = 19200 -main.plugins.gps.device = "/dev/ttyUSB0" +main.plugins.gps.device = "/dev/ttyUSB0" # for GPSD: "localhost:2947" main.plugins.webgpsmap.enabled = false diff --git a/pwnagotchi/plugins/default/gps.py b/pwnagotchi/plugins/default/gps.py index 888282d4b..6167177cd 100644 --- a/pwnagotchi/plugins/default/gps.py +++ b/pwnagotchi/plugins/default/gps.py @@ -25,7 +25,7 @@ def on_loaded(self): logging.info(f"gps plugin loaded for {self.options['device']}") def on_ready(self, agent): - if os.path.exists(self.options["device"]): + if os.path.exists(self.options["device"]) or ":" in self.options["device"]: logging.info( f"enabling bettercap's gps module for {self.options['device']}" )