Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Guide]Use a Wavehare 3.5In SPI TFT Screen #124

Closed
JRWR opened this issue Oct 3, 2019 · 20 comments
Closed

[Guide]Use a Wavehare 3.5In SPI TFT Screen #124

JRWR opened this issue Oct 3, 2019 · 20 comments
Assignees
Milestone

Comments

@JRWR
Copy link
Contributor

@JRWR JRWR commented Oct 3, 2019

  • First, SSH into your pwnagotchi, and give it some internet! Don't forget to check your default gateway and apt-get update
  • Follow Guide here: https://www.waveshare.com/wiki/3.5inch_RPi_LCD_(A)#Method_1._Driver_installation
  • At the step with ./LCD35-show add lite to the command prompt (./LCD35-show lite)
  • Reboot
  • as root, make three symlinks, cd ~; ln -s pwnagotchi.png pwnagotchi_1.png; ln -s pwnagotchi.png pwnagotchi_2.png; ln -s pwnagotchi.png pwnagotchi_3.png;
  • apt install fbi
  • change display type to "inky" in config.yml
  • add "modules-load=dwc2,g_ether" to your kernel command line ( /boot/cmdline.txt ) or it will break!
  • Also must add "dtoverlay=dwc2" to the bottom of ( /boot/config.txt )
  • edit /etc/rc.local and add
    fbi -T 1 -a -noverbose -t 15 -cachemem 0 /root/pwnagotchi_1.png /root/pwnagotchi_2.png /root/pwnagotchi_3.png &

reboot and you should be good, some of this guide will work with other framebuffer based displays!

@evilsocket
Copy link
Owner

@evilsocket evilsocket commented Oct 5, 2019

@hexwaxwing mind adding this to the docs?

@evilsocket evilsocket added this to the 1.0.0 milestone Oct 5, 2019
@hexwaxwing
Copy link
Contributor

@hexwaxwing hexwaxwing commented Oct 5, 2019

Derek assign: hexwaxwing

hexwaxwing added a commit to hexwaxwing/pwnagotchi that referenced this issue Oct 5, 2019
evilsocket added a commit that referenced this issue Oct 5, 2019
added Hacks.md; fixed typo; put official links into a table #124
@evilsocket
Copy link
Owner

@evilsocket evilsocket commented Oct 5, 2019

closed by @hexwaxwing

@evilsocket evilsocket closed this Oct 5, 2019
@michelep
Copy link
Contributor

@michelep michelep commented Oct 18, 2019

Following this guide LCD displays phwagotchi just for few seconds before login prompt: i've solved using the autologin features (use raspi-config) and changing the line to add to /etc/rc.local as follow:

ln -s /root/pwnagotchi.png /tmp/pwnagotchi_1.png; ln -s /root/pwnagotchi.png /tmp/pwnagotchi_2.png; ln -s /root/pwnagotchi.png /tmp/pwnagotchi_3.png;

on /etc/profile i've added, at the end:

. /home/pi/pwnagotchi.sh

and /home/pi/pwnagotchi.sh contains:

#!/bin/bash
sudo fbi -T 1 -a -noverbose -t 15 -cachemem 0 /tmp/pwnagotchi_1.png /tmp/pwnagotchi_2.png /tmp/pwnagotchi_3.png &

Just remember to chmod +x pwnagotchi.sh !

dadav pushed a commit to dadav/pwnagotchi that referenced this issue Oct 20, 2019
dadav pushed a commit to dadav/pwnagotchi that referenced this issue Oct 20, 2019
added Hacks.md; fixed typo; put official links into a table evilsocket#124
@moty66
Copy link

@moty66 moty66 commented Oct 28, 2019

This hack is really working bad and not clear at all

I suggest to execute this code from in rc.local or from /etc/profile or where ever you want:

PID=0
while true; do
        PID=$(pidof fbi)
        fbi -d /dev/fb1 -T 1 -noverbose -a /root/pwnagotchi.png  > /dev/null
        sleep 1
        if ps -p $PID > /dev/null
        then 
                kill $PID
        fi
done

I didn't load any kernel modules, I didn't edit the /boot/config.txt file, I only installed the driver as described in https://www.waveshare.com/wiki/3.5inch_RPi_LCD_(A)#Method_1._Driver_installation!

@michelep
Copy link
Contributor

@michelep michelep commented Oct 31, 2019

I've worked to a more stable solution, adding support for Waveshare 2,4" LCD display (could be adapted to 3,5") directly in pwnagotchi code. Take a look here: https://www.zerozone.it/tecnologia-e-sicurezza/fatgotchi-pwnagotchi-on-a-24inch-spotpear-display/16589

@evilsocket
Copy link
Owner

@evilsocket evilsocket commented Oct 31, 2019

the "more stable solution" does exactly what the on_frame configuration already does @michelep ... you literally call the fbi binary exactly as the on_frame does

@b0n3zx
Copy link

@b0n3zx b0n3zx commented Nov 4, 2019

have any of you got a better refresh rate working on the TFT 3.5 screens yet?

@MoJo2600
Copy link

@MoJo2600 MoJo2600 commented Nov 4, 2019

@b0n3zx you can change the -t 15 parameter. Currently it is refreshing every 15 seconds. Mine is set to -t 1 an thus refreshing every second.

@michelep
Copy link
Contributor

@michelep michelep commented Nov 12, 2019

I have definitively solved any refresh issue with a pure python framebuffer memory mapping implementation, that draw directly to fb device without needs of fbi: i got a fps up to 15 without any problem! (it's currently on a pull request)

@agent932
Copy link

@agent932 agent932 commented Nov 22, 2019

@michelep can you write up a guide to get this setup (I have a generic 3.5 & and a Pi 3) have it working with the above guide but the screen refresh crashes after a while.

@michelep
Copy link
Contributor

@michelep michelep commented Nov 25, 2019

@michelep can you write up a guide to get this setup (I have a generic 3.5 & and a Pi 3) have it working with the above guide but the screen refresh crashes after a while.

the patch was included in 1.3.0 release and you didn't need fbi anymore.

@michelep
Copy link
Contributor

@michelep michelep commented Nov 25, 2019

My Raspberry pi 3 cannot access the internet. Can someone help me?

check iptables/masq rules (http://www.tldp.org/HOWTO/IP-Masquerade-HOWTO/)

@ghost
Copy link

@ghost ghost commented Nov 27, 2019

First: SSH into your Pwnagotchi, and give it some internet
apt-get update

sudo raspi-config

Desktop (text console, automatically logged in as "root" user
git clone https://github.com/waveshare/LCD-show.git

cd LCD-show/

chmod +x LCD35-show

./LCD35-show lite

Reboot

cd

ln -s pwnagotchi.png pwnagotchi_1.png

ln -s pwnagotchi.png pwnagotchi_2.png

ln -s pwnagotchi.png pwnagotchi_3.png

apt install fbi

nano /etc/pwnagotchi/config.yml Change display type to inky then save.

Add modules-load=dwc2,g_ether to your kernel command line nano /boot/cmdline.txt then save.

Add dtoverlay=dwc2 to the bottom of nano /boot/config.txt then save.

nano /etc/rc.local

Add ln -s /root/pwnagotchi.png /tmp/pwnagotchi_1.png; ln -s /root/pwnagotchi.png /tmp/pwnagotchi_2.png; ln -s /root/pwnagotchi.png /tmp/pwnagotchi_3.png;
then save.

nano /etc/profile

Add . /home/pi/pwnagotchi.sh at the end, then save.

nano /home/pi/pwnagotchi.sh

Add #!/bin/bash sudo fbi -T 1 -a -noverbose -t 15 -cachemem 0 /tmp/pwnagotchi_1.png /tmp/pwnagotchi_2.png /tmp/pwnagotchi_3.png & then save.

chmod +x pwnagotchi.sh

@elhenro
Copy link

@elhenro elhenro commented Dec 10, 2019

@michelep thank you! i can confirm that only using your more stable (and cleaner imo) solution, I got it running without issues with the waveshare 3.5 display, with pi zero w and also with pi 3b+.

But somehow the step with sudo raspi-config -> autologin broke my usb connection mode, the network interface does not come up anymore. Any ideas why this happened?

@agent932
Copy link

@agent932 agent932 commented Apr 15, 2020

@michelep can you write up a guide to get this setup (I have a generic 3.5 & and a Pi 3) have it working with the above guide but the screen refresh crashes after a while.

the patch was included in 1.3.0 release and you didn't need fbi anymore.

Is there a way to add the waveshare 3.5 config as a display option in the config without going through all of this, i am not understanding "the patch was included in 1.3.0 release and you didn't need fbi anymore."

@thefunkygibbon
Copy link

@thefunkygibbon thefunkygibbon commented Aug 14, 2020

does this still need to be done given that i already seem to have FBI installed and also the config.txt/cmdline.txt changes already exist?

@agent932
Copy link

@agent932 agent932 commented Dec 2, 2020

I spent the day going through all the 3.5 LCD info I could find and none of these are currently working. Is there an updated method?

@maeky1986
Copy link

@maeky1986 maeky1986 commented Jun 21, 2021

i added support for this display, see pull request #1014

@waldeckerthefirst
Copy link

@waldeckerthefirst waldeckerthefirst commented Sep 24, 2021

hello when i try the guide i get now that the file or directory does not exist for pwnagotchi.png and i could not find it on the FS

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet