From d9924bec7d534bdc1a3a385a7de6446d3b8f8cb2 Mon Sep 17 00:00:00 2001 From: Cassiano Aquino Date: Wed, 25 Sep 2019 15:46:19 +0100 Subject: [PATCH 1/8] move png image to shm to avoid SD card writes --- sdcard/rootfs/root/pwnagotchi/scripts/main.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sdcard/rootfs/root/pwnagotchi/scripts/main.py b/sdcard/rootfs/root/pwnagotchi/scripts/main.py index 4aeb7817..6f446226 100755 --- a/sdcard/rootfs/root/pwnagotchi/scripts/main.py +++ b/sdcard/rootfs/root/pwnagotchi/scripts/main.py @@ -62,7 +62,7 @@ if args.do_manual: core.log("detected a new session and internet connectivity!") - picture = '/tmp/pwnagotchi.png' + picture = '/dev/shm/pwnagotchi.png' display.update() display.image().save(picture, 'png') @@ -121,9 +121,9 @@ while True: # An interesting effect of this: # # From Pwnagotchi's perspective, the more new access points - # and / or client stations nearby, the longer one epoch of + # and / or client stations nearby, the longer one epoch of # its relative time will take ... basically, in Pwnagotchi's universe, - # WiFi electromagnetic fields affect time like gravitational fields + # WiFi electromagnetic fields affect time like gravitational fields # affect ours ... neat ^_^ agent.next_epoch() except Exception as e: From f2991a187ea7253a58a5db1ca0618c15511d80a3 Mon Sep 17 00:00:00 2001 From: Cassiano Aquino Date: Wed, 25 Sep 2019 17:44:26 +0100 Subject: [PATCH 2/8] add support for InkyPHAT from Pimoroni and dynamic element positioning --- sdcard/rootfs/root/pwnagotchi/config.yml | 12 ++-- .../scripts/pwnagotchi/ui/display.py | 55 ++++++++++++++++--- .../pwnagotchi/scripts/pwnagotchi/ui/fonts.py | 2 +- .../pwnagotchi/scripts/pwnagotchi/ui/view.py | 33 ++++++----- .../root/pwnagotchi/scripts/requirements.txt | 1 + 5 files changed, 75 insertions(+), 28 deletions(-) diff --git a/sdcard/rootfs/root/pwnagotchi/config.yml b/sdcard/rootfs/root/pwnagotchi/config.yml index 540b8724..f470b9ca 100644 --- a/sdcard/rootfs/root/pwnagotchi/config.yml +++ b/sdcard/rootfs/root/pwnagotchi/config.yml @@ -17,7 +17,7 @@ main: # if not null, filter access points by this regular expression filter: null # cryptographic key for identity - pubkey: /etc/ssh/ssh_host_rsa_key.pub + pubkey: /etc/ssh/ssh_host_rsa_key.pub ai: # if false, only the default 'personality' will be used @@ -36,7 +36,7 @@ ai: vf_coef: 0.25 # entropy coefficient for the loss calculation ent_coef: 0.01 - # maximum value for the gradient clipping + # maximum value for the gradient clipping max_grad_norm: 0.5 # the learning rate learning_rate: 0.0010 @@ -83,7 +83,7 @@ personality: # number of active epochs that triggers the excited state excited_num_epochs: 10 # number of inactive epochs that triggers the bored state - bored_num_epochs: 15 + bored_num_epochs: 15 # number of inactive epochs that triggers the sad state sad_num_epochs: 25 @@ -92,6 +92,10 @@ ui: # ePaper display can update every 3 secs anyway fps: 0.3 display: + # Possible options inkyphat/waveshare + type: 'inkyphat' + # Possible options red/yellow/black (black used for monocromatic displays) + display_color: 'red' enabled: true rotation: 180 video: @@ -115,7 +119,7 @@ bettercap: port: 8081 username: user password: pass - # folder where bettercap stores the WPA handshakes, given that + # folder where bettercap stores the WPA handshakes, given that # wifi.handshakes.aggregate will be set to false and individual # pcap files will be created in order to minimize the chances # of a single pcap file to get corrupted diff --git a/sdcard/rootfs/root/pwnagotchi/scripts/pwnagotchi/ui/display.py b/sdcard/rootfs/root/pwnagotchi/scripts/pwnagotchi/ui/display.py index 5a1d03dd..73413ced 100644 --- a/sdcard/rootfs/root/pwnagotchi/scripts/pwnagotchi/ui/display.py +++ b/sdcard/rootfs/root/pwnagotchi/scripts/pwnagotchi/ui/display.py @@ -19,7 +19,7 @@ class VideoHandler(BaseHTTPRequestHandler): - +