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

Add support for Waveshare 2.13inch V3 Rev2.1 #1069

Merged
merged 2 commits into from
Jul 18, 2022

Conversation

ikornaselur
Copy link
Contributor

@ikornaselur ikornaselur commented Jan 11, 2022

Adds support for the V3 Rev2.1 of the Waveshare 2.13inch PHAT.

Description

Waveshare seems to be phasing out V2 and replacing it with V3, according to their docs:

Due to the chip upgrade, the 2.13inch e-Paper V2 will be upgraded to the 2.13inch e-Paper V3 version. The new and old demos are not compatible. Comparing the V3 version with the V2 version, in addition to the chip and driver demo, other appearances and functions are compatible. If you are an old customer and need to purchase a new screen again, please pay attention to the update program. If you are purchasing for the first time, and there is a V3 label on the back of the screen, just use the V3 demo directly. (December 2021)

This PR introduces support for the V3 screen

The library code is provided from https://github.com/waveshare/e-Paper

Photo references

The V3 Rev2.1 board

20220111_004021

pwnagotchi running with the screen

20220111_000255

Motivation and Context

As V2 is being phased out and V3 is becoming more common, support for it makes sense.

  • I have raised an issue to propose this change (required)

Given the simplicity of the change and existance of #1039 I did not raise another issue. Happy to do so for further discussion if requested.

Fixes #1039

How Has This Been Tested?

Test steps involved:

  1. Flash a fresh 1.5.5 on a new SD card with minial config (from the Configuration section on the website)
  2. Boot up on Raspberry Pi Zero W with the Waveshare 2.13inch V3 screen connected
  3. Set everything up to SSH into the PiZero
  4. Shut down the pwnagotchi service
  5. Replace the source located in /usr/local/lib/python3.7/site-packages/pwnagotchi with the changes from this PR
  6. Restart the pwnagotchi service and verify screen is correctly initialised and pwnagotchi displayed on it

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I've read the CONTRIBUTION guide
  • I have signed-off my commits with git commit -s

I feel like this support should be documented, but I'm unsure where the documentation change lives. Happy to add info about V3 in the docs if requested!

Signed-off-by: Axel Örn Sigurðsson <dev@absalon.is>
@Langoor2
Copy link

Fixed my issue with the display! Was very confused at first why 213d didn't work and thought the display was dead for a good moment, then I found this issue.

@viniciuspereiras
Copy link

viniciuspereiras commented Jan 22, 2022

THANKS, worked for me! xD but in place of site-packages I used dist-packages

@cryptoads
Copy link

cryptoads commented Feb 6, 2022

Thank you for this. Still having some issues getting my v3 to work.
Seems that when I add the following to the config, pwnagotchi hangs:

ui.display.type = "waveshare_3"
ui.display.color = "black"

Any thoughts?

EDIT

I decided to download the source and just upload the whole pwnagotchi folder to dist-packages and everything is working now. I must have goofed something up by uploading the individual files.

Looks good!! thank you.

@ChutMei
Copy link

ChutMei commented Feb 15, 2022

I am very new to this and Have a V3 screen but have no clue how to set this up idk what im doing wrong

Friend me on discord AnimeThighs#0069 if you could help me

@SeriousM
Copy link

Even I'm sure I ordered the V2, I got the V3 instead after a good week of shipping.
Could we please get this merged so we can use this display officially?

@viniciuspereiras
Copy link

viniciuspereiras commented Feb 17, 2022

@ChutMei and @SeriousM, I posted on comments of this thread on reddit a steb by step about how to configure a pwnagotchi using waveshare v3 and this pull request :D

@SeriousM
Copy link

Very nice, thank you @viniciuspereiras. I first tried to build a new image but it seems that the #1074 would be required as the build didn't succeed. Replacing the python script files is a much easier approach until the new version is (hopefully soon) released.

@chiotas
Copy link

chiotas commented Feb 18, 2022

Thanks, after downloading the whole pwnagotchi folder finally I got an almost working V3 display..However it looks like there is "no ink": the text is extremely dull/washed out..anybody else experienced the same? (Tried with different power sources)

@SeriousM
Copy link

I followed the reddit method by replacing the python files which worked very well. One thing though was that the manual mode didn't refreshed the screen after boot, the auto mode worked flawlessly!

@chiotas
Copy link

chiotas commented Feb 21, 2022

I followed the guide and finally I made the V3 screen work.
Unfortunately it seems hat I get a sort of washed out / faded ink
Any idea on how to fix?

IMG

@SeriousM
Copy link

Yep, mine looks the same in MANU mode. Start in AUTO mode and the screen update will work.

@chiotas
Copy link

chiotas commented Feb 22, 2022

EPIC, now V3 it's working fine, thanks!

@HoursAndDreams
Copy link

I followed the guid and uploaded the new files to the pi, but my display is still not working.
Do I have to do something else after replacing the new files?
Do I have to make a new config.yml file with ui.display.type = "waveshare_3" ?

@chiotas
Copy link

chiotas commented Feb 23, 2022

Didi you replace only 6 files or the whole pwnagotchi folder? Replace the whole folder in case, with just the 6 files listed here under "file changes" is not enough, but with the whole pwnagotchi folder works fine.
Yes you have to set ui.display.type = "waveshare_3", but you can do it also from the web UI

@timmosaurusrex
Copy link

timmosaurusrex commented Feb 25, 2022

Can someone help me? I think i did everything correct and when I look into de log file it stops at this.
[2022-02-25 12:34:53,816] [INFO] initializing waveshare v3 display

btw I am using a test image from #1046 on my raspberry pi zero 2 w and my display is a Rev2.1 V3 3-color display

edit: when i am running the official waveshare V3 demo, this happens
INFO:root:epd2in13_V3 Demo
INFO:root:init and Clear
DEBUG:waveshare_epd.epd2in13_V3:e-Paper busy
it doesn't return a error or something it just stops. I can wait forever and it does absolutely nothing. Does anyone know what this means?

edit 2: I found the problem, the problem is that I am using a colored display.

@freesofia
Copy link

pi@pwnagotchi:~ $ sudo /usr/bin/pwnagotchi-launcher
Traceback (most recent call last):
File "/usr/local/bin/pwnagotchi", line 136, in
from pwnagotchi.ui.display import Display
File "/usr/local/lib/python3.7/dist-packages/pwnagotchi/ui/display.py", line 6, in
import pwnagotchi.ui.hw as hw
File "/usr/local/lib/python3.7/dist-packages/pwnagotchi/ui/hw/init.py", line 9, in
from pwnagotchi.ui.hw.waveshare3 import WaveshareV3
ModuleNotFoundError: No module named 'pwnagotchi.ui.hw.waveshare3'
pi@pwnagotchi:~ $

@timmosaurusrex
Copy link

Can you please make support for the 2in13b_V3? The b is the colored version.

@XZCendence
Copy link

It seems like this driver makes the pwnagotchi's face a bit smaller, the v2 displays seem to show it being bigger, is that some sort of bug or did you intentionally make the text size smaller for the ASCII face

@TQMatvey
Copy link

the only real solution for my issu with v3 display, MERGEE

@TzZek
Copy link

TzZek commented Mar 29, 2022

I ordered v2's specifically for my shop, we all received v3's hoping this get's merged so I can simply go over with them how to get this working, from the official repo w/o any extra tinkering from PR's.

@robot556787
Copy link

hello, I'm very new to this, I'm having a hard time understanding which files to download and where to put them. I know there are steps that will tell you, but I don't understand them at all. Can anyone help me?

@TzZek
Copy link

TzZek commented Mar 29, 2022

hello, I'm very new to this, I'm having a hard time understanding which files to download and where to put them. I know there are steps that will tell you, but I don't understand them at all. Can anyone help me?

You can find the required files here to change:
/usr/local/lib/python3.7/site-packages/pwnagotchi
NOTE - when i did this myself it was located under dist-packages and not site-packages.

If you check the commit located here
You'll see that 6 files were changed.

Files paths (once you'ved changed directory to /usr/local/lib/site-packages/pwnagotchi)

pwnagotchi/utils.py

pwnagotchi/ui/hw/waveshare3.py

pwnagotchi/ui/hw/libs/waveshare/v3/epdconfig.py

pwnagotchi/ui/hw/libs/waveshare/v3/epd2in13_V3.py

pwnagotchi/ui/hw/__init__.py

pwnagotchi/ui/display.py

Go into each file and either make the changes manually, copy the new files in place of the old files, or view the code in raw and copy the entirity as a replacement for that code. You can use nano or vim once you're ssh'd into your pi.

@retzy1989
Copy link

how do you replace the whole pwnagotchi folder? Sorry still new to the Pwnagotchi and would love to see my boy's face!!!

@TzZek
Copy link

TzZek commented Mar 31, 2022

how do you replace the whole pwnagotchi folder? Sorry still new to the Pwnagotchi and would love to see my boy's face!!!

I mean you could just clone the pwnagotchi folder in the users forked repo but it would be simpler to just follow the above and replace the necessary files. As the project spans many directories in different locations.

@pcfreaxx
Copy link

pcfreaxx commented Sep 16, 2022

@invictusani i usually work with Linux and Windows. But after some Research i 've found Paragon ExtFS. It should let you enter your rootfs. Normally i mount the Partition on Linux, but Paragon offers the same Software for Windows too. Dont touch config.txt, if not need. Your solution is for sure to edit config.toml.
Edit: under MacOS you can Setup a Linux VM too. But i have no clue about networking or Routing in this combination

@ikornaselur ikornaselur deleted the waveshare-v3-support branch September 17, 2022 00:27
@invictusani
Copy link

@pcfreaxx I got it to work! Thank you so much for your time and help, it's really appreciated!

@pcfreaxx
Copy link

@invictusani glad to help, Hack the Planet.

@Spessmen14
Copy link

Spessmen14 commented Sep 20, 2022

pcfreaxx

I've tried flashing that image with two separate utilities but my Pi 0 always gets stuck on "Update UMTP about System Runlevel Changes".

How can this problem be alleviated with the patched image?

@pcfreaxx
Copy link

pcfreaxx commented Sep 20, 2022

@Spessmen14 sry you are the first with that Problem, i have no clue whats going wrong.
Can you explain your steps?

@Spessmen14
Copy link

@Spessmen14 sry you are the first with that Problem, i have no clue whats going wrong. Can you explain your steps?

  1. Flash the image from archive.org to a microSD card, that previously worked with a vanilla Pwn image.
  2. Try to boot
  3. Get stuck at boot with this message.

@Spessmen14
Copy link

@Spessmen14 sry you are the first with that Problem, i have no clue whats going wrong. Can you explain your steps?

I left it alone by itself and EVENTUALLY, like after an hour, it seems to be working properly. In german. But now when connecting a microUSB to the data port it won't let me log in, it doesn't accept any keyboard input. I should perhaps mention this is connected to a HAT.

@XZCendence
Copy link

XZCendence commented Oct 11, 2022 via email

@HowToInternet
Copy link

Nope. But i have a ready-to-use Image with waveshare v3 support dumped and uploaded to archive.org https://archive.org/details/pwnagotchi_1.5.5_WSV3Patched

This file isn't able to be opened by winrar on multiple machines through either the direct .rar download or the torrent version. Winrar advises the following: "The archive is either in unknown format or damaged"

@pcfreaxx
Copy link

pcfreaxx commented Oct 18, 2022

Sorry but much, much people load it and it didnt changed since first upload. I tried it a few minutes ago and there we're no Problems.

@HowToInternet
Copy link

HowToInternet commented Oct 18, 2022

Sorry but much, much people load it and it didnt changed since first upload. I tried it a few minutes ago and there we're no Problems.

No worries at all. I was able to just download the .img instead of the entire .rar library and that seemed to get things up and running. I was able to SSH in and then change the language and my home network settings. Its name hasn't update for some reason but I'll figure that out later. I think the last thing I just need to figure out is how to fix the issue with the screen looking like its faded or dim while it's in manual mode. Auto mode seems to look just fine which is reassuring.

@Crash891
Copy link

Crash891 commented Nov 19, 2022

Sorry but much, much people load it and it didnt changed since first upload. I tried it a few minutes ago and there we're no Problems.

hello, i tried with your image, to use 'raspberry' as password in SSH connection, but it don't let me enter. i can't enter browsing 10.0.0.2 too, cause it want username and password. any hints?
ps: i managed to do with the normal image of pwnagotchi, but obv the screen didn't worked. now i can see the PING, but it refuse to let me in

@timmosaurusrex
Copy link

Sorry but much, much people load it and it didnt changed since first upload. I tried it a few minutes ago and there we're no Problems.

hello, i tried with your image, to use 'raspberry' as password in SSH connection, but it don't let me enter. i can't enter browsing 10.0.0.2 too, cause it want username and password. any hints?

ps: i managed to do with the normal image of pwnagotchi, but obv the screen didn't worked. now i can see the PING, but it refuse to let me in

Do you use pi as username? I use pi@10.0.0.2 with password "raspberry"

@Crash891
Copy link

Sorry but much, much people load it and it didnt changed since first upload. I tried it a few minutes ago and there we're no Problems.

hello, i tried with your image, to use 'raspberry' as password in SSH connection, but it don't let me enter. i can't enter browsing 10.0.0.2 too, cause it want username and password. any hints?
ps: i managed to do with the normal image of pwnagotchi, but obv the screen didn't worked. now i can see the PING, but it refuse to let me in

Do you use pi as username? I use pi@10.0.0.2 with password "raspberry"

oh yes, i solved it using pi@10.0.0.2, psw raspberry. now there are other problems... for example i can't do "sudo pip3 install --upgrade pwnagotchi". I'm in V1.5.3, cause in 1.5.5 vanilla the pwnagotchi have some issue with AI, so (like some suggestion in other GitHub issue) i want to upgrade it from the V1.5.3, but it give me "Requirement already satisfied" or other connection problems like "Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at 0xb5566650>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution')': /simple/pwnagotchi/" (it is connected via USB, and it can ping 1.1.1.1, so it should be connected to internet)

@Crash891
Copy link

Sorry but much, much people load it and it didnt changed since first upload. I tried it a few minutes ago and there we're no Problems.

hello, i tried with your image, to use 'raspberry' as password in SSH connection, but it don't let me enter. i can't enter browsing 10.0.0.2 too, cause it want username and password. any hints?
ps: i managed to do with the normal image of pwnagotchi, but obv the screen didn't worked. now i can see the PING, but it refuse to let me in

Do you use pi as username? I use pi@10.0.0.2 with password "raspberry"

another problem is that it reboot random, giving in logtails:
"Task exception was never retrieved
future: <Task finished coro=<Client.start_websocket() done, defined at /usr/local/lib/python3.7/dist-packages/pwnagotchi/bettercap.py:38> exception=OSError("Multiple exceptions: [Errno 111] Connect call failed ('::1', 8081...
Traceback (most recent call last):
File "/usr/local/lib/python3.7/dist-packages/pwnagotchi/bettercap.py", line 42, in start_websocket
async with websockets.connect(s, ping_interval=60, ping_timeout=90) as ws:
File "/usr/local/lib/python3.7/dist-packages/websockets/client.py", line 517, in aenter
return await self
File "/usr/local/lib/python3.7/dist-packages/websockets/client.py", line 535, in await_impl
transport, protocol = await self._create_connection()
File "/usr/lib/python3.7/asyncio/base_events.py", line 968, in create_connection
', '.join(str(exc) for exc in exceptions)))
OSError: Multiple exceptions: [Errno 111] Connect call failed ('::1', 8081, 0, 0), [Errno 111] Connect call failed ('127.0.0.1', 8081)"

@Sirius-RJ
Copy link

With some people on the unofficial discord, we decided to start a new fork with all new fixes in. Do you want to join us ? https://github.com/pwnagotchi2/pwnagotchi

page not found !

@Paranoia8972
Copy link

I'm really happy it worked. But is there a way to add costume plugins? I know, I can edit the standard plugins in the webconfig "http://10.0.0.2:8080/plugins/webcfg. If I do it in the config.toml the screen stops working but this is, so far I know, required to add the path for the plugins.
Thanks!

@azdralovic
Copy link

You should do it in config.toml, but not sure why your screen stops working... works fine for me

@Paranoia8972
Copy link

Nah, this was me too frustrating. It all just won’t work for me. I just bought a v2. So I’m good with everything. Everything works. I’m happy.
Thanks

@DooMFeaR
Copy link

DooMFeaR commented Mar 28, 2023

Following this guide
"Replace the source located in /usr/local/lib/python3.7/site-packages/pwnagotchi with the changes from this PR"
The folder site-packages or dist-packages DOESN'T EXIST on that path. And what files should be replaced? I don't get it!!!

EDIT: I used this and it's working great: Nope. But i have a ready-to-use Image with waveshare v3 support dumped and uploaded to archive.org https://archive.org/details/pwnagotchi_1.5.5_WSV3Patched
Downloaded the torrent file, unpacked, wrote the SD card and boom, works without any issues!

@Miente1
Copy link

Miente1 commented Apr 27, 2023

I changed the files to support my V3 display. But when i reboot the pwnagotchi it does not work.
Also web ui an BT-tethering stops working.

Only way to get it back to work is put the display enable back to false.

Any work around on this?

@niyazaki
Copy link

niyazaki commented May 3, 2023

As this is Merged, setting the screen to "waveshare_3" should do the trick right ?
It doesn't, at least for me. Anyone having the same issue ?

I tried waveshare213d as I saw on Reddit, but not working either :(.

Can someone help ? Thank you !

@lorenzoPrimi
Copy link

lorenzoPrimi commented May 6, 2023

Same problem here, I tried to install the 1.55 and clone the current master and also tried the pwnagotchi_1.5.5_WSV3Patched
Nothing is showing up, this is the log :

[2019-07-10 01:21:43,630] [INFO] [led] plugin loaded for /sys/class/leds/led0/brightness
[2019-07-10 01:21:43,635] [INFO] grid plugin loaded.
[2019-07-10 01:21:43,633] [INFO] Session-stats plugin loaded.
[2019-07-10 01:21:43,773] [WARNING] ui.fps is 0, the display will only update for major changes
[2019-07-10 01:21:43,778] [INFO] initializing waveshare v3 display
[2019-07-10 01:21:47,335] [INFO] generating /etc/pwnagotchi/id_rsa ...
[2019-07-10 01:25:48,594] [INFO] pwnagotchi@f364862801dae404747ec8c495db360362869e0fb9df23bb6cd92ca3bb7ae384 (v1.5.5)
[2019-07-10 01:25:48,625] [INFO] entering manual mode ...
[2019-07-10 01:25:49,293] [INFO] web ui available at http://0.0.0.0:8080/
[2019-07-10 01:25:49,385] [INFO] the last session lasted 49 minutes, 29 seconds (0 completed epochs, trained for 0), average reward:0.0 (min:1000 max:-1000)

Nothing is displayed.
Could my display be broken?

@uzonder
Copy link

uzonder commented May 13, 2023

I decided to download the source and just upload the whole pwnagotchi folder to dist-packages and everything is working now. I must have goofed something up by uploading the individual files.

Replacing the whole pwnagotchi folder from the source resolved the issue for me. Individual files did not work.

@yb278
Copy link

yb278 commented Jun 8, 2023

Hello, I have never used ssh before and dont get how to actually replace the whole folder in terms of what commands to use. I can ssh into it and browse directories but could someone tell me what to actually do to change the whole folder

@timmosaurusrex
Copy link

Hello, I have never used ssh before and dont get how to actually replace the whole folder in terms of what commands to use. I can ssh into it and browse directories but could someone tell me what to actually do to change the whole folder

I use WinSCP to copy files to my raspberry. First i remove the directory with "sudo rm -rf" (this will permanently remove the directory and everything inside). Then I drag and drop the files i want to copy in WinSCP.

@Tr33x0rs
Copy link

I recently learned about this project and decided to build one of my own. I initially ordered a waveshare 2.13 e ink display and had issues getting it to work but finally got it to work with the evil socket branch. Unfortunately I damaged the displays ribbon cable when trying to insert it into a case and it no longer works.

I purchased another display but mistakenly it is the Touch version but is also a V3. My config file is still the same config file that I was using before which is showing waveshare 3 as shown on the evil socket GitHub.

Pwnagotchi version 1.55 by evilsocket- https://github.com/evilsocket/pwnagotchi/releases

my config.toml -

main.name = "pwnagotchi" main.lang = "en" main.whitelist = [ "EXAMPLE_NETWORK", "ANOTHER_EXAMPLE_NETWORK", "fo:od:ba:be:fo:od", "fo:od:ba" ]

main.plugins.grid.enabled = true main.plugins.grid.report = true main.plugins.grid.exclude = [ "YourHomeNetworkHere" ]

ui.display.enabled = true ui.display.type = "waveshare_3" ui.display.color = "black"

I followed the instructions of downloading the pwnagotchi-master files and replacing the 6 files in their appropriate directories (utils.py to /pwnagotchi/, waveshare3.py to /pwnagotchi/ui/hw/ etc..). I waited about 20 mins and restarted my pi. I'm still getting nothing on the display.

I am able to ssh into the pi no problem. Please help. I've been tinkering with this for days and it has been driving me mad! Thank you in advance.

@costyn
Copy link

costyn commented Jan 31, 2024

For anyone still struggling, check out the aluminum-ice fork of this project. There you can set the config to waveshare_v3 and it should work... give it a few minutes after boot before the screen turns on.

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

Successfully merging this pull request may close these issues.

waveshare_3 support?