Hardware - V0r-T3x/pwnagotchi-fancygotchi GitHub Wiki
Display
Add support for Waveshare 2.13" V3 Rev 2.1 e-Ink-display
It is necessary to replace the 6 files updated/added in this pull-request to add support for the V3. Apparently the V2 is no longer produced. In case your display doesn`t work out-of-the-box, it is worth it to try this solution first.
hint: see if there is a "V3"-sticker on the back of the display.
update: you can use this bash script to automate the process.
Waveshare 2.13" V4
As of April 2024, apparently there also exists a V4 of the display. See this pull-request for further details.
Installation of a waveshare 3.5 LCD clone
Install requirements:
sudo apt-get install libraspberrypi-dev raspberrypi-kernel-headers
Just if there is already a folder:
sudo rm -rf LCD-show
Clone the good-tft github repo and install it:
git clone https://github.com/goodtft/LCD-show.git
chmod -R 755 LCD-show
cd LCD-show/
sudo ./LCD35-show
On rpi0 or rpi02 this will broke the usb eth.
Open the sd card on a pc.
**Add back this to the /boot/config.txt
**
Put the sd card inside the rpi and boot the pwnagotchi
dtoverlay=dwc2
Put the sd card inside the rpi and boot the pwnagotchi
Configure the /etc/pwnagotchi/config.toml
with the display type waveshare35lcd
if the display only shows the terminal:
nano /usr/local/lib/python3.9/dist-packages/pwnagotchi/ui/hw/waveshare35lcd.py
Change the i=1
to i=0
(or vice versa at need):
self._display.ready_fb(i=0)
In order to hide all the boot messages (including the terminal) and the blinking cursor on the Raspberry Pi, edit /boot/cmdline.txt
and first change:
console=tty1
to
console=tty3
After that, add the following to the end of the line:
loglevel=3 quiet logo.nologo vt.global_cursor_default=0
Now you can reboot.
Install waveshare 3.7 e-ink display
cd ~
sudo mkdir /usr/local/share/pwnagotchi/custom-plugins/
#make custom-plugins directory defined in config.toml, if not done so already.
sudo mkdir /usr/local/lib/python3.7/dist-packages/pwnagotchi/ui/hw/libs/waveshare/v37inch
sudo git clone https://github.com/hannadiamond/pwnagotchi-plugins.git
cd ./pwnagotchi-plugins/waveshare_37inch/
sudo cp -r /home/pi/pwnagotchi-plugins/waveshare_37inch/v37inch/. /usr/local/lib/python3.7/dist-packages/pwnagotchi/ui/hw/libs/waveshare/v37inch
sudo cp waveshare37inch.py /usr/local/lib/python3.7/dist-packages/pwnagotchi/ui/hw
sudo nano /etc/pwnagotchi/config.toml
#set: ui.display.enabled = true
#set: ui.display.type = "waveshare37inch"
sudo nano /usr/local/lib/python3.7/dist-packages/pwnagotchi/utils.py
#Locate "def load_config" and add the following:
elif config['ui']['display']['type'] in ('ws_37inch', 'ws37inch', 'waveshare_37inch', 'waveshare37inch'):
config['ui']['display']['type'] = 'waveshare37inch'
sudo nano /usr/local/lib/python3.7/dist-packages/pwnagotchi/ui/display.py
#Add the following:
def is_waveshare37inch(self):
return self.implementation.name == 'waveshare37inch'
sudo nano /usr/local/lib/python3.7/dist-packages/pwnagotchi/ui/components.py
#Locate "class LabeledValue" and REPLACE "def draw" with:
def draw(self, canvas, drawer):
if self.label is None:
drawer.text(self.xy, self.value, font=self.label_font, fill=self.color)
else:
pos = self.xy
drawer.text(pos, self.label, font=self.label_font, fill=self.color)
drawer.text((pos[0] + self.label_spacing + self.label_font.getsize(self.label)[0], pos[1]), self.value, font=self.text_font, fill=self.color)
sudo nano /usr/local/lib/python3.7/dist-packages/pwnagotchi/ui/hw/__init__.py
#Add the following:
from pwnagotchi.ui.hw.waveshare37inch import Waveshare37inch
#Also, add the following into the elif block of the code:
elif config['ui']['display']['type'] == 'waveshare37inch':
return Waveshare37inch(config)
sudo systemctl restart pwnagotchi.service #to initialize new waveshare 3.7 display.
# Troubleshooting: If the screen does not come on:
# Just SSH into your pwnagotchi via USB and check your work from the beginning of step 7.
# I typically add the waveshare37 code snippets right between the sections for "waveshare27" and
# "waveshare29" in their respective sections within each script being modified.
UPS
Pisugar 2 Setup
Install Pisugar Power Manager and Pisugar2 plugin. The Power Manager will set up its own neat web service which allows to configure the function of the button and see some stats about your battery.
# Go to the home directory
cd ~
# Install PiSugar Power Manager
curl http://cdn.pisugar.com/release/Pisugar-power-manager.sh | sudo bash
# Download the plugin and support library
git clone https://github.com/PiSugar/pisugar2py.git
git clone https://github.com/PiSugar/pwnagotchi-pisugar2-plugin.git
# This installs the pisugar2 package into your python library
sudo ln -s ~/pisugar2py/ /usr/local/lib/python3.7/dist-packages/pisugar2
# Installs the user-plugin
sudo ln -s ~/pwnagotchi-pisugar2-plugin/pisugar2.py /etc/pwnagotchi/custom-plugins/pisugar2.py
GPS
ATGM336H GPS Module on a Raspberry Pi zero 2
Connections:
GPS ----> RPI02w
VCC ----> 5V
GND ----> GND
TX ----> RX GPIO 15
RX ----> TX GPIO 14
PPS ----> PWM GPIO 18
Configure the serial connection:
sudo raspi-config
Disable serial terminal.
Enabled hardware serial.
Install dependencies:
sudo apt-get install gpsd gpsd-clients
Set the baud rate to 9600:
sudo stty -F /dev/serial0 raw 9600 cs8 clocal -cstopb
Config gpsd to uses the correct serial device:
sudo nano /etc/default/gpsd
Look for:
DEVICES=""
and change it to:
DEVICES="/dev/serial0"
Reboot
Verify with:
gpsmon 127.0.0.1:2947
gpsmon /dev/serial0
cgps 127.0.0.1:2947
cgps /dev/serial0
Configure it inside /etc/pwnagotchi/config.toml
:
main.plugins.gps.enabled = true
main.plugins.gps.speed = 9600
main.plugins.gps.device = "/dev/serial0"