Wolfspyre Labs 🐺🔥🔬/ Our Guides/ CoreDNS @ Wolfspyre Labs/ 🏗️ Setting Up CoreDNS/ Pi4 Soup to nuts/ ⑧ eInk Wierdness/ ⑧ eInk Wierdness ⇦ ⇦ ⇦ But wait!! There’s more! ⑦ … Is it supposed to smell like that?! # ⑨ PaperTTY Params ⇨ ⇨ ⇨ Papertty Pre-reqs Install Packages Install Poetry Clone the repo 🐾 What the hell is going on here?! #If you’re here, it means that something LIKELY didn’t quite go right when kicking off PaperTTY. Lets see if we can help sort that out. not even talking to the display “Whomp Whomp ☹️” #poetry run papertty --driver EPD2in13b scrub gpiozero not found - defaulting to RPi.GPIO Loading PIL font /usr/src/PaperTTY/papertty/resources/tom-thumb.pil. Font size is ignored. Failed to init gpiozero spi device is SPI enabled? root@pi # ls /dev/*spi* /dev/spidev0.0 /dev/spidev0.1 is i2c enabled? root@gitlab-arm60-runner:/usr/src/PaperTTY# ls /dev/*i2c* /dev/i2c-1 are the pins connected in the right places? gpiozero found - using that instead of RPi.GPIO Loading PIL font /usr/src/PaperTTY/papertty/resources/tom-thumb.pil. Font size is ignored. /root/.cache/pypoetry/virtualenvs/papertty-LoWC4mRA-py3.12/lib/python3.12/site-packages/gpiozero/devices.py:300: PinFactoryFallback: Falling back from lgpio: No module named 'lgpio' warnings.warn( cat pyproject.toml [tool.poetry] name = “papertty” version = “0.1.8” description = “Python module to render a TTY or VNC on e-ink” authors = [“Jouko Strömmer jouko.strommer@iki.fi”] readme = “README.md” repository = “https://github.com/joukos/PaperTTY" homepage = “https://github.com/joukos/PaperTTY" [tool.poetry.dependencies] click = “^8.1.7” Pillow = “10.4.0” python = “^3.10” gpiozero = “^2.0.1” lgpio = “^0.2.2.0” “RPi.GPIO” = “^0.7.1” spidev = “^3.6” vncdotool = “^1.2.0” [tool.poetry.scripts] papertty = “papertty.papertty:cli” [build-system] requires = [“poetry>=0.12”] build-backend = “poetry.masonry.api” - noise #### "W...T...F?" If you're... Unlucky.. [![eink-woes](../eink-garbage.jpg)](../eink-woes) Head over to the [eInk Woes](../eink-woes) page to try and figure out what's up. Then come back here once papertty is working as expected. [PaperTTY][][^PaperTTY^] is a nifty python tool to display a console TTY on an eInk display. Here we'll walk through setting it up to give us an easily viewable status indicator I wanted some mechanism of easily assessing the health of the DNS hosts… I didn’t want to spend too much time on it, but I wanted it to be robust enough that it would ‘just work’ consistently. I ended up trying a few different tools, but ended up landing on a combination of PaperTTY and DNSTop. There are definitely other ways to achieve this goal, and I will likely play with others later.. …This works well for the moment. So the general process here is: # PaperTTY Get the necessary dependencies for PaperTTY set up Apt Packages Poetry Clone the repo setup papertty test that it actually works with THIS eink display. install some fonts and make it start at boot on a specified vty. DNSTOP Install it get it running properly automagically ### PaperTTY {#papertty} #### Install Pre-Reqs{#deps} ##### Apt Packages{#packages} ```shell {linenos=false} apt-get install libjpeg-dev libjpeg-turbo8-dev libjpeg8-dev \ libopenjp2-7 libtiff5 python3-pip python3-pip-whl \ python3-setuptools-whl python3-venv python3.10-venv \ python3-rgpio python3-rpi.gpio rpi.gpio-common \ rgpio-tools librgpio1 Poetry #Poetry is a packaging and dependency management toolchain for Python. Warning I do not advocate running random shit on the internet piped into an interpreter sight unseen. I STRONGLY encourage you to look at the script (found here) before running the install one-liner below: Install Poetry #curl -sSL https://install.python-poetry.org | python3 - Quickly test/validate Poetry’s functionality #root@coredns-03:~# poetry --version Poetry (version 1.2.1) Clone the Repo #root@coredns-03:~# git clone https://github.com/joukos/PaperTTY.git Cloning into 'PaperTTY'... remote: Enumerating objects: 801, done. remote: Counting objects: 100% (29/29), done. remote: Compressing objects: 100% (21/21), done. remote: Total 801 (delta 13), reused 20 (delta 8), pack-reused 772 Receiving objects: 100% (801/801), 7.00 MiB | 13.36 MiB/s, done. Resolving deltas: 100% (497/497), done. root@coredns-03:~# Build PaperTTY # root@coredns-03:~# cd ~/PaperTTY && poetry install root@coredns-03:~# cd ~/PaperTTY && poetry install Creating virtualenv papertty-uSU0pReX-py3.10 in /root/.cache/pypoetry/virtualenvs Updating dependencies Resolving dependencies... (163.6s) Writing lock file Package operations: 1 install, 9 updates, 0 removals • Updating attrs (19.3.0 -> 22.1.0) • Updating idna (2.9 -> 3.4) • Updating setuptools (65.3.0 -> 50.3.2) • Updating six (1.15.0 -> 1.16.0) • Updating hyperlink (19.0.0 -> 21.0.0) • Updating incremental (17.5.0 -> 21.3.0) • Updating pyhamcrest (2.0.2 -> 2.0.3) • Updating zope-interface (5.1.0 -> 5.4.0) • Installing rpi-gpio (0.7.1) • Updating spidev (3.4 -> 3.5) Installing the current project: papertty (0.1.8b) Waveshare recommendations #According to [WaveShare’s guidance][waveshare-docs] [waveshare-docs], the following are necessary: The latest version of [libbcm2835][lib-bcm2835-site][libbcm2835site] here’s a link to the [src tarball][lib-bcm2835-tarball][libbcm2835tarball], The version of WiringPi [specifically from this repo.][wiringpi-repo][wiringpi-repo] I don’t think this was strictly necessary though. In fact, I’m fairly certain this was a red herring. Nevertheless this was the install process.. it’s useful so as to be able to ascertain if the problem is papertty or the eink display / pi BCM2835 #CopyPasta: cd /usr/src && \ wget http://www.airspayce.com/mikem/bcm2835/bcm2835-1.71.tar.gz && \ tar xzvf bcm2835-1.71.tar.gz && \ cd /usr/src/bcm2835-1.71 && \ ./configure && make && make install && \ ls -la /usr/local/lib/libbcm2835.a /usr/local/include/bcm2835.h Acutally running the commands: root@coredns-03:~# cd /usr/src root@coredns-03:/usr/src# wget http://www.airspayce.com/mikem/bcm2835/bcm2835-1.71.tar.gz root@coredns-03:/usr/src# tar xzvf bcm2835-1.71.tar.gz root@coredns-03:/usr/src# cd bcm2835-1.71/ root@coredns-03:/usr/src/bcm2835-1.71# ./configure && make && make install Inspect them for good measure: root@coredns-03:/usr/src/bcm2835-1.71# ls -la /usr/local/lib/libbcm2835.a /usr/local/include/bcm2835.h -rw-r--r-- 1 root root 430648 Sep 18 23:21 /usr/local/lib/libbcm2835.a -rw-r--r-- 1 root root 105329 Sep 18 23:21 /usr/local/include/bcm2835.h WiringPi #Copypasta: cd /usr/src && git clone https://github.com/WiringPi/WiringPi.git && cd WiringPi && /usr/src/WiringPi/build root@coredns-03:/usr/src# cd /usr/src && git clone https://github.com/WiringPi/WiringPi.git Cloning into 'WiringPi'... remote: Enumerating objects: 1730, done. remote: Counting objects: 100% (613/613), done. remote: Compressing objects: 100% (112/112), done. remote: Total 1730 (delta 554), reused 501 (delta 501), pack-reused 1117 Receiving objects: 100% (1730/1730), 802.92 KiB | 3.72 MiB/s, done. Resolving deltas: 100% (1186/1186), done. root@coredns-03:/usr/src# cd WiringPi && /usr/src/WiringPi/build ... sysctls #TBD oepn files network buffers calomel tips Prometheus #apt-get install bwm-ng libconfig9 libfreetype-dev libio-pty-perl libipc-run-perl libpng-dev libpng-tools libsnmp-base libsnmp40 libtime-duration-perl libtimedate-perl lldpad lldpd moreutils nfs-common prometheus-node-exporter prometheus-node-exporter-collectors python-is-python3 python3-pip smartmontools snmp snmp-mibs-downloader sockperf spi-tools Extra Credit #WTFUtil #https://wtfutil.com https://github.com/wtfutil/wtf.git ⬅⃖⃖ Back to Robustify …Continue ➡⃗⃗