Template: 2.13inch e-Paper HAT+ Pwn

From Waveshare Wiki
Jump to: navigation, search

pwnagotchi

Hardware Connection

Simply plug the board into the 40-pin header on the Raspberry Pi, making sure to align the pins correctly.
If using 8/9PIN cable to connect, you can refer to the following table:

Raspberry Pi Pin Connection
e-Paper Raspberry Pi
BCM2835 Board
VCC 3.3V 3.3V
GND GND GND
DIN MOSI 19
CLK SCLK 23
CS CE0 24
DC 25 22
RST 17 11
BUSY 24 18
PWR 18 12

Image Preparation

The official image stopped being updated in 2021, but there are third parties that continue to update based on the official image.
Comparison between the two:

  • The official image is smaller in size, has fewer features, and runs more smoothly than the third party, but you need to import demos and plug-ins by yourself, and it doesn't support Pi5.
  • Third-party image is relatively larger in sizes, have more features, and are maintained by someone, and the latest systems support Pi5.

Image Download: Github: Official pwnagotchi image Third party pwnagotchi Image.
Unzip the downloaded image and then program the "img" file to TF card.

PC Preparation

1. Connect the PC and the power interface of the Raspberry Pi, and connect the zero to the USB interface (USB3.0 interface is recommended for PC connection).
2.13inch e-Paper HAT+ 6.jpg
2. Install the RNDIS driver.
3. Go to Control Panel\Network and Internet\Network Connections to check. Normally, a new RNDIS network should appear, as shown in the image below.
2.13inch e-Paper HAT+ 1.png
4. Right-click and enter menu, click on Properties >Internet Protocol Version 4 (TCP/IPv4), configure it as the following static IP address:

IP: 10.0.0.1
Subnet mask: 255.255.255.0
Gateway: 10.0.0.1
DNS (if required): 8.8.8.8 (or others)

2.13inch e-Paper HAT+ 2.png2.13inch e-Paper HAT+ 3.png
5. Try to ping 10.0.0.2, if it works, then you can visit the Web interface or connect it via SSH.

win + R key, and then input cmd
Type ping 10.0.0.2 in the terminal

2.13inch e-Paper HAT+ 4.png2.13inch e-Paper HAT+ 5.png

Official Image Process

Demo Preparation

The official image only supports some outdated screens, for new screens, you need to update the built-in demo. (PC: the third-party demo package does not support the official systems, so you need to download and add it manually.)

  • Download and unzip the pwnagotchi demo.
  • Modify the unzipped file folder name, for example: modify "pwnagotchi" to "pwnagotchi_ss".
  • Input the modified file folder to the boot directory of the TF card.

Booting

1. Connect the PC and zero via the USB interface (USB3.0 interface on the PC is recommended).
2.13inch e-Paper HAT+ 6.jpg
2. Open the terminal and input "ssh pi@10.0.0.2", and the password is "raspberry".
3. Connect the zero via SSH, input the following commands to replace the original demo.

sudo rm -rf /usr/local/lib/python3.7/dist-packages/pwnagotchi
cd /boot
sudo mv pwnagotchi_ss /usr/local/lib/python3.7/dist-packages
cd /usr/local/lib/python3.7/dist-packages
sudo mv pwnagotchi_ss pwnagotchi

4. Create config.toml file and set the screen auto-on.

cd /boot
sudo nano config.toml
Input the following content:
main.name = "pwnagotchi"
main.lang = "en"
main.whitelist = [
   "waveshare_wifi",
   "waveshare_wifi_5G"
]
main.plugins.grid.enabled = true
main.plugins.grid.report = true
main.plugins.grid.exclude = [
  "YourHomeNetworkHere"
]
ui.display.enabled = true
ui.display.type = "waveshare_4"
ui.display.color = "black"

# The main.whitelist is used to store the Wi-Fi whitelist, preventing attacks on your network
# Press Ctrl + O to save, and press Ctrl + X to exit

5. Input sudo poweroff to shut down, and disconnect the zero and the PC. Connect the 2.13-inch e-Paper HAT+ and zero, and then connect the power supply.

Third Party Image Process

Demo Preparation

  • The download address for the third party demo package: demo package
  • Please manually download and modify it by yourself.

Botting

1. Connect the PC and the power interface of the Raspberry Pi, and connect the zero to the USB interface (USB3.0 interface is recommended for PC connection).
2.13inch e-Paper HAT+ 6.jpg
2. Open the terminal, input ssh pi@10.0.0.2, and the password is raspberry. 3. Create "config.toml" file, set auto-booting the screen (here we set the black and white screen of 2.13_V4):

cd /boot
sudo nano config.toml
Input the following content:
main.name = "pwnagotchi"
main.lang = "en"
main.whitelist = [
   "waveshare_wifi",
   "waveshare_wifi_5G"
]
main.plugins.grid.enabled = true
main.plugins.grid.report = true
main.plugins.grid.exclude = [
  "YourHomeNetworkHere"
]
ui.display.enabled = true
ui.display.type = "waveshare_4"
ui.display.color = "black"

# main.whitelist is to put a Wi-Fi whitelist to prevent itself from being attacked
# Press Ctrl + O to save, and press Ctrl + X to exit

5. Input "sudo poweroff" to shutdown, disconnect the Raspberry Pi and the PC, and then connect to power supply.

FAQ

 Answer:
  • Although python name may varied in different systems, the demo location is the same.
  • /usr/local/lib/python*.**/dist-packages/pwnagotchi/
  • "python*.**" is your actual python directlory name, for example, python3.11 or python3.7...
{{{3}}}
{{{4}}}

{{{5}}}


 Answer:
  • Modify the BLACK value as WHITE value in "pwnagotchi\ui\view.py" file.
{{{3}}}
{{{4}}}

{{{5}}}


 Answer:

Open the file pwnagotchi/ui/hw/libs/waveshare/epaper/v2in13_V4/epd2in13_V4.py and add the corresponding code to the Clear function; the screen of 2.13V3 is also the same operation:
Pwnagotchi-FAQ-1.jpg

{{{3}}}
{{{4}}}

{{{5}}}