Skip to content

Instantly share code, notes, and snippets.

@fishd72
Created April 7, 2023 17:14
Show Gist options
  • Save fishd72/d3518ef40479a9272f2bd6c425b7af07 to your computer and use it in GitHub Desktop.
Save fishd72/d3518ef40479a9272f2bd6c425b7af07 to your computer and use it in GitHub Desktop.
#!/bin/bash
cd /usr/local/src/pwnagotchi
sudo git pull
sudo mkdir /usr/local/lib/python3.7/dist-packages/pwnagotchi/ui/hw/libs/waveshare/v3/
sudo cp /usr/local/src/pwnagotchi/pwnagotchi/ui/display.py /usr/local/lib/python3.7/dist-packages/pwnagotchi/ui/
sudo cp /usr/local/src/pwnagotchi/pwnagotchi/ui/hw/__init__.py /usr/local/lib/python3.7/dist-packages/pwnagotchi/ui/hw/
sudo cp /usr/local/src/pwnagotchi/pwnagotchi/ui/hw/libs/waveshare/v3/epd2in13_V3.py /usr/local/lib/python3.7/dist-packages/pwnagotchi/ui/hw/libs/waveshare/v3/
sudo cp /usr/local/src/pwnagotchi/pwnagotchi/ui/hw/libs/waveshare/v3/epdconfig.py /usr/local/lib/python3.7/dist-packages/pwnagotchi/ui/hw/libs/waveshare/v3/
sudo cp /usr/local/src/pwnagotchi/pwnagotchi/ui/hw/waveshare3.py /usr/local/lib/python3.7/dist-packages/pwnagotchi/ui/hw/
sudo cp /usr/local/src/pwnagotchi/pwnagotchi/utils.py /usr/local/lib/python3.7/dist-packages/pwnagotchi/
sudo cp /usr/local/src/pwnagotchi/pwnagotchi/ui/hw/waveshare35lcd.py /usr/local/lib/python3.7/dist-packages/pwnagotchi/ui/hw/
@Evanito
Copy link

Evanito commented Aug 2, 2023

used just now, works fine

@Gh0sT1992
Copy link

fatal: unable to access 'https://github.com/DrSchottky/pwnagotchi.git/': Could not resolve host: github.com
root@pwn:/usr/local/src/pwnagotchi#
root@pwn:/usr/local/src/pwnagotchi# sudo mkdir /usr/local/lib/python3.7/dist-packages/pwnagotchi/ui/hw/libs/waveshare/v3/
mkdir: cannot create directory ‘/usr/local/lib/python3.7/dist-packages/pwnagotchi/ui/hw/libs/waveshare/v3/’: File exists
root@pwn:/usr/local/src/pwnagotchi# sudo cp /usr/local/src/pwnagotchi/pwnagotchi/ui/display.py /usr/local/lib/python3.7/dist-packages/pwnagotchi/ui/
root@pwn:/usr/local/src/pwnagotchi# sudo cp /usr/local/src/pwnagotchi/pwnagotchi/ui/hw/init.py /usr/local/lib/python3.7/dist-packages/pwnagotchi/ui/hw/
root@pwn:/usr/local/src/pwnagotchi# sudo cp /usr/local/src/pwnagotchi/pwnagotchi/ui/hw/libs/waveshare/v3/epd2in13_V3.py /usr/local/lib/python3.7/dist-packages/pwnagotchi/ui/hw/libs/waveshare/v3/
root@pwn:/usr/local/src/pwnagotchi# sudo cp /usr/local/src/pwnagotchi/pwnagotchi/ui/hw/libs/waveshare/v3/epdconfig.py /usr/local/lib/python3.7/dist-packages/pwnagotchi/ui/hw/libs/waveshare/v3/
root@pwn:/usr/local/src/pwnagotchi# sudo cp /usr/local/src/pwnagotchi/pwnagotchi/ui/hw/waveshare3.py /usr/local/lib/python3.7/dist-packages/pwnagotchi/ui/hw/
root@pwn:/usr/local/src/pwnagotchi# sudo cp /usr/local/src/pwnagotchi/pwnagotchi/utils.py /usr/local/lib/python3.7/dist-packages/pwnagotchi/
root@pwn:/usr/local/src/pwnagotchi# sudo cp /usr/local/src/pwnagotchi/pwnagotchi/ui/hw/waveshare35lcd.py /usr/local/lib/python3.7/dist-packages/pwnagotchi/ui/hw/
cp: cannot stat '/usr/local/src/pwnagotchi/pwnagotchi/ui/hw/waveshare35lcd.py': No such file or directory
root@pwn:/usr/local/src/pwnagotchi# <script src="https://gist.github.com/fishd72/d3518ef40479a9272f2bd6c425b7af07.js"></script>
bash: syntax error near unexpected token <' root@pwn:/usr/local/src/pwnagotchi# <script src="https://gist.github.com/fishd72/d3518ef40479a9272f2bd6c425b7af07.js"></script><script src="https://gist.github.com/fishd72/d3518ef40479a9272f2bd6c425b7af07.js"></script bash: syntax error near unexpected token <'
root@pwn:/usr/local/src/pwnagotchi#
root@pwn:/usr/local/src/pwnagotchi# <script src="https://gist.github.com/fishd72/d3518ef40479a9272f2bd6c425b7af07.js"></script

how ccan i fix it? i try use the bash

@Peybro
Copy link

Peybro commented Aug 21, 2023

fatal: unable to access 'https://github.com/DrSchottky/pwnagotchi.git/': Could not resolve host: github.com
how ccan i fix it? i try use the bash

Trying too right now and get the same error. It's because your Pwngotchi cannot connect to the Internet yet. Updating you when I found out how to fix this!

@Meguumin
Copy link

Anyone have a fix yet?

@Evanito
Copy link

Evanito commented Aug 28, 2023

The fix is to connect your pwnagotchi to the internet, follow the pwnagotchi tutorial for this

@fishd72
Copy link
Author

fishd72 commented Aug 28, 2023

Yup, if you're seeing the below text as part of your error, then your pwnagotchi either does not have an internet connection or DNS is not working properly.

fatal: unable to access 'https://github.com/DrSchottky/pwnagotchi.git/': Could not resolve host: github.com

@Peybro
Copy link

Peybro commented Aug 28, 2023

Anyone have a fix yet?

Try this guide:

  1. run sudo nano /etc/resolv.conf
  2. change the entry behind "nameserver" from "127.0.0.1" to 8.8.8.8 (or 1.1.1.1 (as already in 1.5.5FIX))
  3. run sudo nano /etc/network/interfaces.d/usb0-cfg
  4. add dns-nameservers 8.8.8.8 under the gateway line
  5. run sudo nano /etc/dnsmasq.conf
  6. add server=8.8.8.8@usb0
  7. run systemctl disable dnsmasq
  8. run sudo nano /etc/resolv.conf
  9. make sure there is 8.8.8.8 or 1.1.1.1 instead of "127.0.0.0"
  10. run sudo chattr +i /etc/resolv.conf to make the file immutable

... or directly try 1.5.5FIX mentioned in step 2

@Send-Peet-Fics
Copy link

with 1.5.5FIX i cannot change the nameserver values for DNS. so i cannot access the internet to make it run the bash code

@wpa-2
Copy link

wpa-2 commented Sep 19, 2023

with 1.5.5FIX i cannot change the nameserver values for DNS. so i cannot access the internet to make it run the bash code

v3 is supported out the box, and if internet sharing is setup correctly you shouldnt need to mess with that file.

@johhncastro
Copy link

does anyone have a waveshare v4 script?

@Delearner
Copy link

how can i setup a waveshare v4 Because it dont work

@johhncastro
Copy link

how can i setup a waveshare v4 Because it dont work

i figured this out. use pwnagotchi torch by jay https://github.com/jayofelony/pwnagotchi-torch/releases/tag/v2.5.4 in the config use waveshare_3 and it will work

@jokersmoker6
Copy link

jokersmoker6 commented Dec 28, 2023

@johhncastro It worked for you with ui.display.type = "waveshare_3" in the config file with a v4 display ? help me pls

@johhncastro
Copy link

@jokersmoker6 flash your pwnagotchi with pwnagotchi-torch the download for that is in the link i commented earlier in the thread. in the config v3 will work with the v4 display.

@jokersmoker6
Copy link

So will I have to burn this .zip back to my memory with balena? After this, the config.toml file would be ready without the need to edit it?

@johhncastro
Copy link

@jokersmoker6 also dont forget the underscore in your comment you have "waveshare 3" it has to be "waveshare_3"

@johhncastro
Copy link

So will I have to burn this .zip back to my memory with balena? After this, the config.toml file would be ready without the need to edit it?

yes you should be good to go if you use torch

@jokersmoker6
Copy link

The .zip from https://github.com/jayofelony/pwnagotchi-torch/releases/tag/v2.5.4 does not allow you to attach it to the balena to burn it to the SD memory (it is already formatted) this new .zip weighs nothing in comparison with others

@johhncastro
Copy link

@jokersmoker6 it should okay first off what pi are you using? pi zero 2 w? or pi zero w

@jokersmoker6
Copy link

Imagen de WhatsApp 2023-12-28 a las 17 59 23_e6bf2a93

@johhncastro
Copy link

johhncastro commented Dec 28, 2023

@jokersmoker6 okay so here is what you are gonna need to do... go to the pwnagotchi torch download page that i linked earlier. for your pi you need to download this one " pwnagotchi-rpi-bullseye-2.5.4-armhf.img.xz" you will have to then write this image to the micro sd probably just use the raspberry pi imager. (here is the link for that https://www.raspberrypi.com/software/ ) make sure when you put the image on the sd you select the device on the raspberry pi imager scroll down and select "Raspbery Pi Zero" not "Raspbery Pi Zero 2 W" then for the os select pwnagotchi-rpi-bullseye-2.5.4-armhf.img.xz then you should be good

@dajtp
Copy link

dajtp commented Jan 20, 2024

This script has always worked for me in the past, but on this occasion I'm having no luck with it. I'm running the script as I usually do after setting up and checking I've got internet connectivity (ping google.com), and when running the script it goes through without any errors. But for some reason, I'm getting no life from my V3 Waveshare screen.

Any ideas anyone?

@wpa-2
Copy link

wpa-2 commented Jan 26, 2024

This script has always worked for me in the past, but on this occasion I'm having no luck with it. I'm running the script as I usually do after setting up and checking I've got internet connectivity (ping google.com), and when running the script it goes through without any errors. But for some reason, I'm getting no life from my V3 Waveshare screen.

Any ideas anyone?

most of the recent images will be working out the box and this script will not be needed.

@k7n8ie
Copy link

k7n8ie commented Nov 11, 2024

i'm gettin this error:

root@pwnagotchi:/usr/local/src/pwnagotchi# cd /usr/local/src/pwnagotchi

sudo git pull

sudo mkdir /usr/local/lib/python3.7/dist-packages/pwnagotchi/ui/hw/libs/waveshare/v3/
sudo cp /usr/local/src/pwnagotchi/pwnagotchi/ui/display.py /usr/local/lib/python3.7/dist-packages/pwnagotchi/ui/
sudo cp /usr/local/src/pwnagotchi/pwnagotchi/ui/hw/init.py /usr/local/lib/python3.7/dist-packages/pwnagotchi/ui/hw/
sudo cp /usr/local/src/pwnagotchi/pwnagotchi/ui/hw/libs/waveshare/v3/epd2in13_V3.py /usr/local/lib/python3.7/dist-packages/pwnagotchi/ui/hw/libs/waveshare/v3/
sudo cp /usr/local/src/pwnagotchi/pwnagotchi/ui/hw/libs/waveshare/v3/epdconfig.py /usr/local/lib/python3.7/dist-packages/pwnagotchi/ui/hw/libs/waveshare/v3/
sudo cp /usr/local/src/pwnagotchi/pwnagotchi/ui/hw/waveshare3.py /usr/local/lib/python3.7/dist-packages/pwnagotchi/ui/hw/
sudo cp /usr/local/src/pwnagotchi/pwnagotchi/utils.py /usr/local/lib/python3.7/dist-packages/pwnagotchi/
sudo cp /usr/local/src/pwnagotchi/pwnagotchi/ui/hw/waveshare35lcd.py /usr/local/lib/python3.7/dist-packages/pwnagotchi/ui/hw/
fatal: not a git repository (or any of the parent directories): .git
mkdir: cannot create directory ‘/usr/local/lib/python3.7/dist-packages/pwnagotchi/ui/hw/libs/waveshare/v3/’: No such file or directory
cp: cannot stat '/usr/local/src/pwnagotchi/pwnagotchi/ui/display.py': No such file or directory
cp: cannot stat '/usr/local/src/pwnagotchi/pwnagotchi/ui/hw/init.py': No such file or directory
cp: cannot stat '/usr/local/src/pwnagotchi/pwnagotchi/ui/hw/libs/waveshare/v3/epd2in13_V3.py': No such file or directory
cp: cannot stat '/usr/local/src/pwnagotchi/pwnagotchi/ui/hw/libs/waveshare/v3/epdconfig.py': No such file or directory
cp: cannot stat '/usr/local/src/pwnagotchi/pwnagotchi/ui/hw/waveshare3.py': No such file or directory
cp: cannot stat '/usr/local/src/pwnagotchi/pwnagotchi/utils.py': No such file or directory
cp: cannot stat '/usr/local/src/pwnagotchi/pwnagotchi/ui/hw/waveshare35lcd.py': No such file or directory
fatal: not a git repository (or any of the parent directories): .git
mkdir: cannot create directory ‘/usr/local/lib/python3.7/dist-packages/pwnagotchi/ui/hw/libs/waveshare/v3/’: No such file or directory
cp: cannot stat '/usr/local/src/pwnagotchi/pwnagotchi/ui/display.py': No such file or directory
cp: cannot stat '/usr/local/src/pwnagotchi/pwnagotchi/ui/hw/init.py': No such file or directory
cp: cannot stat '/usr/local/src/pwnagotchi/pwnagotchi/ui/hw/libs/waveshare/v3/epd2in13_V3.py': No such file or directory
cp: cannot stat '/usr/local/src/pwnagotchi/pwnagotchi/ui/hw/libs/waveshare/v3/epdconfig.py': No such file or directory
cp: cannot stat '/usr/local/src/pwnagotchi/pwnagotchi/ui/hw/waveshare3.py': No such file or directory
cp: cannot stat '/usr/local/src/pwnagotchi/pwnagotchi/utils.py': No such file or directory
cp: cannot stat '/usr/local/src/pwnagotchi/pwnagotchi/ui/hw/waveshare35lcd.py': No such file or directory
-bash: syntax error near unexpected token `('
-bash: mkdir:: command not found
-bash: cp:: command not found
-bash: cp:: command not found
-bash: cp:: command not found
-bash: cp:: command not found
-bash: cp:: command not found
-bash: cp:: command not found
-bash: cp:: command not found

please Help ...

@wpa-2
Copy link

wpa-2 commented Nov 11, 2024

i'm gettin this error:

root@pwnagotchi:/usr/local/src/pwnagotchi# cd /usr/local/src/pwnagotchi

sudo git pull

sudo mkdir /usr/local/lib/python3.7/dist-packages/pwnagotchi/ui/hw/libs/waveshare/v3/ sudo cp /usr/local/src/pwnagotchi/pwnagotchi/ui/display.py /usr/local/lib/python3.7/dist-packages/pwnagotchi/ui/ sudo cp /usr/local/src/pwnagotchi/pwnagotchi/ui/hw/init.py /usr/local/lib/python3.7/dist-packages/pwnagotchi/ui/hw/ sudo cp /usr/local/src/pwnagotchi/pwnagotchi/ui/hw/libs/waveshare/v3/epd2in13_V3.py /usr/local/lib/python3.7/dist-packages/pwnagotchi/ui/hw/libs/waveshare/v3/ sudo cp /usr/local/src/pwnagotchi/pwnagotchi/ui/hw/libs/waveshare/v3/epdconfig.py /usr/local/lib/python3.7/dist-packages/pwnagotchi/ui/hw/libs/waveshare/v3/ sudo cp /usr/local/src/pwnagotchi/pwnagotchi/ui/hw/waveshare3.py /usr/local/lib/python3.7/dist-packages/pwnagotchi/ui/hw/ sudo cp /usr/local/src/pwnagotchi/pwnagotchi/utils.py /usr/local/lib/python3.7/dist-packages/pwnagotchi/ sudo cp /usr/local/src/pwnagotchi/pwnagotchi/ui/hw/waveshare35lcd.py /usr/local/lib/python3.7/dist-packages/pwnagotchi/ui/hw/ fatal: not a git repository (or any of the parent directories): .git mkdir: cannot create directory ‘/usr/local/lib/python3.7/dist-packages/pwnagotchi/ui/hw/libs/waveshare/v3/’: No such file or directory cp: cannot stat '/usr/local/src/pwnagotchi/pwnagotchi/ui/display.py': No such file or directory cp: cannot stat '/usr/local/src/pwnagotchi/pwnagotchi/ui/hw/init.py': No such file or directory cp: cannot stat '/usr/local/src/pwnagotchi/pwnagotchi/ui/hw/libs/waveshare/v3/epd2in13_V3.py': No such file or directory cp: cannot stat '/usr/local/src/pwnagotchi/pwnagotchi/ui/hw/libs/waveshare/v3/epdconfig.py': No such file or directory cp: cannot stat '/usr/local/src/pwnagotchi/pwnagotchi/ui/hw/waveshare3.py': No such file or directory cp: cannot stat '/usr/local/src/pwnagotchi/pwnagotchi/utils.py': No such file or directory cp: cannot stat '/usr/local/src/pwnagotchi/pwnagotchi/ui/hw/waveshare35lcd.py': No such file or directory fatal: not a git repository (or any of the parent directories): .git mkdir: cannot create directory ‘/usr/local/lib/python3.7/dist-packages/pwnagotchi/ui/hw/libs/waveshare/v3/’: No such file or directory cp: cannot stat '/usr/local/src/pwnagotchi/pwnagotchi/ui/display.py': No such file or directory cp: cannot stat '/usr/local/src/pwnagotchi/pwnagotchi/ui/hw/init.py': No such file or directory cp: cannot stat '/usr/local/src/pwnagotchi/pwnagotchi/ui/hw/libs/waveshare/v3/epd2in13_V3.py': No such file or directory cp: cannot stat '/usr/local/src/pwnagotchi/pwnagotchi/ui/hw/libs/waveshare/v3/epdconfig.py': No such file or directory cp: cannot stat '/usr/local/src/pwnagotchi/pwnagotchi/ui/hw/waveshare3.py': No such file or directory cp: cannot stat '/usr/local/src/pwnagotchi/pwnagotchi/utils.py': No such file or directory cp: cannot stat '/usr/local/src/pwnagotchi/pwnagotchi/ui/hw/waveshare35lcd.py': No such file or directory -bash: syntax error near unexpected token `(' -bash: mkdir:: command not found -bash: cp:: command not found -bash: cp:: command not found -bash: cp:: command not found -bash: cp:: command not found -bash: cp:: command not found -bash: cp:: command not found -bash: cp:: command not found

please Help ...

Not sure what your trying to do here but the newer upto date pwnagotchi works fine with the waveshare screens.

@k7n8ie
Copy link

k7n8ie commented Nov 11, 2024

Trying to follw Xyl0se's guide to auto update the drivers. i have a wavshare 2.13inch Rev.2.1 V4 and its not working...

@wpa-2
Copy link

wpa-2 commented Nov 11, 2024

What image are you flashing

@k7n8ie
Copy link

k7n8ie commented Nov 11, 2024

The wrong one 🙈 V3.
How do I get the V4 running? Until know it's not working.

Thank you

@wpa-2
Copy link

wpa-2 commented Nov 11, 2024

Pwnagotchi.org

@k7n8ie
Copy link

k7n8ie commented Nov 11, 2024

I know that guide. Followed already. Display setting enabled = true

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment