e-paper display with PaperTTY
See original GitHub issueI would like to eventually manifest this as a pull request. However, it is still a hodgepodge of trial and error right now, so starting it off as an issue. Nevertheless, I managed to get a 2.7inch waveshare e-paper hat working on my pi4. All in all, it turned out to be relatively straight forward.
When logged into my Raspiblitz as user admin, I cloned https://github.com/joukos/PaperTTY and followed the install instructions (way down towards the bottom of the readme).
After install, I have been able to do things like (as admin user):
echo "Hello World" | sudo papertty.py --driver epd2in7 stdin --nofold --size 14
or, to get a full blown terminal, I can:
- start a
screensession and runsudo ~/.virtualenvs/papertty/bin/python3 ./papertty.py --driver epd2in7 terminal --vcsa /dev/vcsa2 - in another screen session run
sudo openvt -fc 2 -- sudo -u admin screenfollowed byscreen -x <name>to attach to the screen.
At that point, both the e-paper display and my ssh console are shown the raspiblitz menu. Just a plain terminal itself would probably be preferred, but I’m not sure how to proceed from where I am. This level of shell scripting and “ttys” is quite new to me.
If, for example, I wanted the e-paper display to simply show the bestblock hash and it’s height, I probably do not need a full terminal and something similar to the first command above would do. However, it seems that updating the display needs to be done by the admin user since sudo is required.
If there is a particular thing I need help with next, it is this:
What is the easiest/recommended/idiomatic way in the context of a Raspiblitz for me to have a little script run by the admin user every time, for example, a new block arrives?
My original thought was to utilize the blocknotify=<your shell command> bitcoin.conf feature. However, since the Raspiblitz runs bitcoind as user bitcoin and that user does not have sudo privileges, then if the shell command passed in required sudo, it would fail. Additionally, it seems that ZMQ is probably the preferred method in bitcoin core these days.
So, this then leads me to think that a better method might be to:
- create a small service (probably written in python or something) which subscribes to any of
bitcoind’s ZMQ messages it might need to update the display. - then, since the service would be run by the
adminuser, it could execute thesudo papertty.py ...command(s) necessary to update the display.
Is this the general method that you would recommend? Thanks in advance for any pointers.
Misc Details: The particular model I tried is https://www.amazon.com/gp/product/B07PKSZ3XK, but the foregoing seems applicable to most any other model. A model that supports partial-refresh is probably preferred for most use-cases that require a more snappy response time.
Issue Analytics
- State:
- Created 3 years ago
- Comments:10 (5 by maintainers)
Top Related StackOverflow Question
Started work here based off v1.6 branch: https://github.com/philbertw4/raspiblitz/tree/feature-blitzpaperui/home.admin/BlitzPaperUI Will open a pull request once I’m further along.
Take a look here and let me know if there is anything missing: https://github.com/rootzoll/raspiblitz/blob/master/FAQ.md#how-can-i-sync-a-branch-of-my-forked-github-with-my-local-raspiblitz