Sunday, May 26, 2024

Garbage Terminal: Part 2

First things first, I found out that 3 AA batteries will not in fact power a Raspberry Pi Zero with an LCD screen attached. My wife offered up her Jackery Mini battery bank as her contribution to this project. Thankfully this works great. Second things second, I have been trying to work out a 3D printed case for this mess, but so far I have not had a lot of luck.


 This is the current state of the project. It is fully functional, but as you can see, it is waiting for some sort of case. The biggest problem with this build is the keyboard. I remembered why I never used it in a project, it sucks to type on. The size is not the problem, it is the buttons themselves that are the problem.

As you can see here, without the 3D printed cover, the buttons are literally little finger hating buttons. The cover makes it more tolerable, no let me rephrase that, the cover makes it usable. The downside of course is the cover also makes it harder to read the the letters, but if you are going to use this keyboard, the cover is an absolute must.


 

The instructions for getting the keyboard to work are here;

https://github.com/ian-antking/cardkb

The STL files for the keyboard cover are here;

 https://www.thingiverse.com/thing:3359571

Installing the  Pimoroni HyperPixel 4.0" LCD is not terribly difficult, the instructions for getting it to work are here;

https://github.com/pimoroni/hyperpixel4/issues/177


One of the issues I ran into, was the Pimoroni HyperPixel 4.0" LCD screen will not work if I2C is enabled on the Raspberry Pi with the raspi-config tool. I think the driver for the LCD hijacks I2C in some way. This is fine though, because it seems to provide its own I2C driver and a place on the back to attach devices. The keyboard shows up on bus 11 for me. Which can be verified easily enough with "sudo i2cdetect -y 11". 

The screen also does not power off automatically when the Pi is shutdown, which is a problem for battery life. To make this happen run the following command;

 sudo nano /etc/systemd/system/hyperpixel4-backlight.service

Paste the following into the file and save it.

[Unit]
Description=Sets up gpio-poweroff to handle Hyperpixel backlight upon shutdown/reboot
ConditionPathExists=/usr/bin/hyperpixel4-init
ConditionPathExists=/boot/overlays/gpio-poweroff.dtbo
ConditionPathExists=/usr/bin/dtoverlay
DefaultDependencies=no
Before=umount.target
[Service]
Type=oneshot
ExecStart=/bin/sh -c '/sbin/rmmod gpio-backlight;/usr/bin/dtoverlay /boot/overlays/gpio-poweroff.dtbo gpiopin=19 active_low=1'
[Install]
WantedBy=reboot.target halt.target poweroff.target

 Followed by the following commands;

sudo systemctl enable hyperpixel4-backlight.service

sudo systemctl start hyperpixel4-backlight.service

One other issue I had, although not show stopping was annoying. When the Pi booted up I was getting "Boot errors: reached target sound card and error stopped target sound card". This is kind of to be expected because the Pi Zero does not have any sound device. To fix this open /boot/config.txt;

sudo nano /boot/config.txt

Find;

dtoverlay=vc4-kms-v3d

and change it to;

dtoverlay=vc4-kms-v3d,noaudio

Then find;

 dtparam=audio=on

and change it to;

dtparam=audio=off

 After the next reboot, you should not see those errors anymore.

I think that sums up the initial build pretty well. Once I have a case for it and had a chance to actually use it, I will do a part three and discuss software, battery life and usability.

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Mastodon