Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions pwnagotchi/defaults.toml
Original file line number Diff line number Diff line change
Expand Up @@ -146,17 +146,18 @@ enabled = false
[main.plugins.wigle]
enabled = false
api_key = "" # mandatory
cvs_dir = "/tmp" # optionnal, is set, the CVS is written to this directory
cvs_dir = "/tmp" # optional, is set, the CVS is written to this directory
donate = false # default: off
timeout = 30 # default: 30
position = [7, 85] # optionnal
position = [7, 85] # optional

[main.plugins.wpa-sec]
enabled = false
api_key = ""
api_url = "https://wpa-sec.stanev.org"
download_results = false
show_pwd = false
position = "0,95" # if show_pwd is true

iface = "wlan0mon"
mon_start_cmd = "/usr/bin/monstart"
Expand Down Expand Up @@ -200,7 +201,7 @@ cursor = true
fps = 0.0

[ui.font]
name = "DejaVuSansMono" # for japanese: fonts-japanese-gothic
name = "DejaVuSansMono" # for Japanese: fonts-japanese-gothic
size_offset = 0 # will be added to the font size

[ui.faces]
Expand Down
2 changes: 1 addition & 1 deletion pwnagotchi/plugins/default/gdrivesync.py
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ def on_handshake(self, agent, filename, access_point, client_station):
shutil.rmtree("/home/pi/backup")
self.status.update()
display = agent.view()
display.update(force=True, new_data={'Backing up to gdrive ...'})
display.update(force=True, new_data={"status": 'Backing up to gdrive ...'})

def backup_files(self, paths, dest_path):
for src_path in paths:
Expand Down
40 changes: 37 additions & 3 deletions pwnagotchi/plugins/default/gpio_buttons.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,43 @@
import subprocess
import pwnagotchi.plugins as plugins

"""
This plugin uses the BCM GPIO Number - not the physicaly pin number!

Depending on hardware attached to the Pwnagotchi - these GPIO pins may / or may not be in-use.
You will need to do your research for your specific hardware to find what GPIO pins it uses - if any at all.
If the pins are in use by the hardware, they can not be used with buttons.

IF hardware uses a GPIO Pin, the line in config.toml should be commented out or deleted entirely.
Failure to do so may make the 'gotchi unbootable. If that happens you'll need to pull your SD card
and edit the [rootfs]/etc/pwnagotchi/config.toml file on your computer - you've been warned!

The examples below only enter "GPIO Pin X Triggered" into the log.
You will want to set them to your custom commands you would enter into your SSH Shell
eg: "sudo systemctl stop pwnagotchi && sudo pwnagotchi --clear && sudo shutdown -h now"

config.toml

[main.plugins.gpio_buttons]
enabled = false
#gpios.5 = "GPIO Pin 5 Triggered" #physical pin 29 - unused but constant false triggers.
gpios.6 = "GPIO Pin 6 Triggered" #physical pin 31
gpios.16 = "GPIO Pin 16 Triggered" #physical pin 36
#gpios.17 = "GPIO Pin 17 Triggered" #physical pin 11 - used by Waveshare eInk hat
gpios.22 = "GPIO Pin 22 Triggered" #physical pin 15
gpios.23 = "GPIO Pin 23 Triggered" #physical pin 16
#gpios.24 = "GPIO Pin 24 Triggered" #physical pin 18 - used by Waveshare eInk hat
#gpios.25 = "GPIO Pin 25 Triggered" #physical pin 22 - used by Waveshare eInk hat
gpios.26 = "GPIO Pin 26 Triggered" #physical pin 37
#gpios.27 = "GPIO Pin 27 Triggered" #physical pin 13 - used by Waveshare GPS LC29
"""

class GPIOButtons(plugins.Plugin):
__author__ = 'ratmandu@gmail.com'
__version__ = '1.0.0'
__license__ = 'GPL3'
__description__ = 'GPIO Button support plugin'
__help__ = 'https://tieske.github.io/rpi-gpio/modules/GPIO.html'

def __init__(self):
self.running = False
Expand All @@ -26,6 +57,9 @@ def runcommand(self, channel):
def on_loaded(self):
logging.info("GPIO Button plugin loaded.")

# Reset GPIO state to avoid conflicts
GPIO.cleanup()

# get list of GPIOs
gpios = self.options['gpios']

Expand All @@ -38,7 +72,7 @@ def on_loaded(self):
GPIO.setup(gpio, GPIO.IN, GPIO.PUD_UP)
GPIO.add_event_detect(gpio, GPIO.FALLING, callback=self.runcommand, bouncetime=600)
# set pimoroni display hat mini LED off/dim
GPIO.setup(17, GPIO.IN, pull_up_down=GPIO.PUD_DOWN)
GPIO.setup(22, GPIO.IN, pull_up_down=GPIO.PUD_DOWN)
GPIO.setup(27, GPIO.IN, pull_up_down=GPIO.PUD_DOWN)
#GPIO.setup(17, GPIO.IN, pull_up_down=GPIO.PUD_DOWN)
#GPIO.setup(22, GPIO.IN, pull_up_down=GPIO.PUD_DOWN)
#GPIO.setup(27, GPIO.IN, pull_up_down=GPIO.PUD_DOWN)
logging.info("Added command: %s to GPIO #%d", command, gpio)
17 changes: 10 additions & 7 deletions pwnagotchi/plugins/default/wpa-sec.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@

class WpaSec(plugins.Plugin):
__author__ = '33197631+dadav@users.noreply.github.com'
__editor__ = 'jayofelony'
__version__ = '2.1.1'
__editor__ = 'jayofelony, Boris Badenov'
__version__ = '2.1.2'
__license__ = 'GPL3'
__description__ = 'This plugin automatically uploads handshakes to https://wpa-sec.stanev.org'

Expand Down Expand Up @@ -152,10 +152,13 @@ def on_internet_available(self, agent):
def on_ui_setup(self, ui):
if 'show_pwd' in self.options and self.options['show_pwd'] and 'download_results' in self.options and self.options['download_results']:
# Setup for horizontal orientation with adjustable positions
x_position = 0 # X position for both SSID and password
ssid_y_position = 95 # Y position for SSID
ssid_position = (x_position, ssid_y_position)
ui.add_element('pass', LabeledValue(color=BLACK, label='', value='', position=ssid_position,
try:
pos = self.options['position'].split(',')
pos = [int(x.strip()) for x in pos]
except Exception:
pos = (0, 95)

ui.add_element('pass', LabeledValue(color=BLACK, label='', value='', position=(pos[0], pos[1]),
label_font=fonts.Bold, text_font=fonts.Small))

def on_unload(self, ui):
Expand All @@ -182,4 +185,4 @@ def on_ui_update(self, ui):
result = "File not found"
except OSError as e:
result = f"Error reading file: {e}"
ui.set('pass', result)
ui.set('pass', result)