jayofelony / pwnagotchi

(⌐■_■) - Deep Reinforcement Learning instrumenting bettercap for WiFi pwning.
Other
1.02k stars 116 forks source link

error setting up waveshare1in54 e-paper display #72

Closed bryzz42o closed 8 months ago

bryzz42o commented 8 months ago

no display after installing screen and changing config, --debug returns

Traceback (most recent call last): File "/usr/local/bin/pwnagotchi", line 235, in pwnagotchi_cli() File "/usr/local/bin/pwnagotchi", line 214, in pwnagotchi_cli display = Display(config=config, state={'name': '%s>' % pwnagotchi.name()}) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/dist-packages/pwnagotchi/ui/display.py", line 18, in init self.init_display() File "/usr/local/lib/python3.11/dist-packages/pwnagotchi/ui/display.py", line 219, in init_display self._implementation.initialize() File "/usr/local/lib/python3.11/dist-packages/pwnagotchi/ui/hw/waveshare1in54.py", line 37, in initialize self._display.init(0x00) File "/usr/local/lib/python3.11/dist-packages/pwnagotchi/ui/hw/libs/waveshare/v1in54/epd1in54.py", line 201, in init for i in range(0, len(lut)): ^^^^^^^^ TypeError: object of type 'int' has no len() ?????

jayofelony commented 8 months ago

ok let me dive into that

bryzz42o commented 8 months ago

appreciate you to the moon J! thought it may not be detecting the screen but "ls /dev/spi*" showed the screen occupying spi so might be in the code aka out of my league

jayofelony commented 8 months ago

sudo nano /usr/local/lib/python3.11/dist-packages/pwnagotchi/ui/hw/waveshare1in54.py

Can you edit this file on line 37, where it says: self._display.init(0x00) into self._display.init(0)

Can you do that real quick for me? Than I can start a new image build with this fix.

bryzz42o commented 8 months ago

yep will have it done in 10 mins legend

bryzz42o commented 8 months ago

sorted, did you want me to submit a pull for it or just run a debug & post output?

bryzz42o commented 8 months ago

ui.display.type is waveshare1in54 pwnagotchi --debug output: Traceback (most recent call last): File "/usr/local/bin/pwnagotchi", line 235, in pwnagotchi_cli() File "/usr/local/bin/pwnagotchi", line 214, in pwnagotchi_cli display = Display(config=config, state={'name': '%s>' % pwnagotchi.name()}) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/dist-packages/pwnagotchi/ui/display.py", line 18, in init self.init_display() File "/usr/local/lib/python3.11/dist-packages/pwnagotchi/ui/display.py", line 219, in init_display self._implementation.initialize() File "/usr/local/lib/python3.11/dist-packages/pwnagotchi/ui/hw/waveshare1in54.py", line 37, in initialize self._display.init(0) File "/usr/local/lib/python3.11/dist-packages/pwnagotchi/ui/hw/libs/waveshare/v1in54/epd1in54.py", line 201, in init for i in range(0, len(lut)): ^^^^^^^^ TypeError: object of type 'int' has no len()

jayofelony commented 8 months ago

hmm change it to a 1 and debug again :smile:

jayofelony commented 8 months ago

Can you set it as this? self._display.init(self._display.lut_full_update) or self._display.init(self._display.lut_partial_update)

try whichever works best

bryzz42o commented 8 months ago

That fixed the len error, unfortunately screen still not displaying so I'll recheck all the pin connections today. Could possibly be the tweak_view changing the disp settings or something so will turn off all the plugins later and see if running bare bones helps it display the screen

bryzz42o commented 8 months ago

No luck running bare bones and reseating the pins, If the repo supports piTfT screens I'll try one I have later to confirm this e-paper (1.54inch V2 aka B) isn't faulty but is only a couple days old so unlikely. Appreciate all the help

jayofelony commented 8 months ago

If you have a v2 b version you need to use different display type

https://github.com/jayofelony/pwnagotchi/blob/master/pwnagotchi%2Futils.py#L297-L298

bryzz42o commented 8 months ago

changed & --debug: unsupported display type waveshare1in54b_v2

bryzz42o commented 8 months ago

changed & success with waveshare1in54b <3 incase anyone else ends up here its the 1.54inch e-paper waveshare screen with a GREEN sticker on the front protector film