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;

The STL files for the keyboard cover are here;

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

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.

Description=Sets up gpio-poweroff to handle Hyperpixel backlight upon shutdown/reboot
ExecStart=/bin/sh -c '/sbin/rmmod gpio-backlight;/usr/bin/dtoverlay /boot/overlays/gpio-poweroff.dtbo gpiopin=19 active_low=1'

 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



and change it to;


Then find;


and change it to;


 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.

Saturday, May 25, 2024

Radxa X2L Single Board Computer

 I will be coming back to the Garbage Terminal shortly, I had some hiccups with my original design, which is what happens when you pull a bunch of junk out of a parts box.

In the mean time, I have been messing around with a new bit of hardware I bought. Up until version 5, I was a big fan of the Raspberry Pi. With the Raspberry Pi 5 however, I felt it had jumped the shark. Yes, it was a good product, but it has reached the point where they are just as expensive as a low end computer and therefore lost much of their original luster. Enter the Radxa X2L, powered by an 4 core Intel Celeron Processor J4125. This little board costs as little as $39 for the 2GB of RAM version, I picked up the 4GB version for $52 and there is an 8GB version for $82. You can also get them with various amounts of EMMC storage. The really cool thing about this board is it comes with an RP2040 microprocessor built in, along with exposed GPIO headers very similar to the Raspberry Pi Zero.

The first thing I should say about this is don't bother getting it with any EMMC storage. EMMC is stupid slow and for about the same cost as the upgrade, you can get a 128GB NVME M.2 SSD, trust me, you will be happier. Second don't bother getting the M.2 wifi card either, they cost $20-$30 plus shipping, it is just not worth it. Instead just go find a $10 wifi dongle on Amazon, yes it takes a USB port, but the price makes it worth it.

Things I liked:

This board is basically a complete computer the size of my cell phone. It is a larger than an Raspberry Pi, but still reasonably small, so you can mount it on the back of a monitor or an out of the way corner of your media center, even with a 3D printed case.

I love having an RP2040 integrated into this board, I think all computer should have this.

The BIOS has CSM options for booting non UEFI operating systems like FreeDOS. Fewer and fewer systems are coming with this option and I am glad to see Radxa decided to include it.

Considering this is a Celeron CPU, it performs pretty well. runs smoothly, Chrome and Firefox render well and no problems with Youtube.

Things I didn't like:

 When I was messing around with the RP2040, I found some problems than annoyed me. First off, it does not play well with Micropython, I could not get any I2C hardware to work. I had to use CircuitPython instead. 

The second thing I found was I could not chain multiple I2C devices together. I should be able to chain a dozen devices, but I could not even get two to work properly.

I am not sure what the issue here is, I know it is not the RP2040 itself, I have several Raspberry Pi Pico's and a couple of Waveshare Pico Zero's, I2C and Micropython  work flawlessly on these devices. I should not be having these problems and the GPIO is really the selling point of this board, otherwise I might as well just buy a Mini PC.

What am I going to do with this?

The short answer is I don't know. The longer answer is, I have a couple of idea, like maybe a Cyberdeck, ie a custom built hand made computer with flare and style. However, before I start on something, I need to work out the RP2040/GPIO problems I am having. I am currently working on getting some form of two way communication going via serial between the intel processor and the RP2040, once I have worked that out, I will post about how I did it, along with source code.

Saturday, May 11, 2024

Garbage Terminal: Part 1

I decided I wanted a little Linux handheld terminal. I had seen some YouTube videos of them and thought they were a neat idea. However when I went out and started pricing them, I was surprised at how expensive they were. I am sure part of that was just post COVID bullshit, but still. Then I started thinking about it and I realized I probably already had all the parts I needed. So I dug through my parts box and found a Raspberry Pi Zero W, a Pimoroni HyperPixel 4, a mini keyboard, 3 AA battery pack, a toggle switch from the junk drawer and an embarrassingly large pile of various USB flash drives. All stuff from other projects that were upgraded, abandoned or long forgotten. Now I just had to put it all together and make it work.

In the next installment I will go into the building process and include some pictures. However, before I get to building it, I am also thinking about what upgrades I might want to make in the future. I am also thinking about what I would do if I were buying these parts today.  I went out and looked at the current price and found these parts would cost $106.75 at today's prices. Mind you, I bought most of this stuff pre COVID, so it was considerably cheaper, I suspect at the time all of this stuff cost me less than $75.

If I were buying these parts rather than digging them out of my parts box, I would probably make some different choices. For instance the Hyperpixel 4 LCD screen does not play well with the current version of Raspberry Pi OS, which is why I am going to have to use an old version for this build. This LCD also uses all the GPIO pins, I would like to have a few left exposed for other things. I would likely choose the Miuzei Raspberry Pi 4 Touchscreen with Case Fan, This would cost me $30, but it would give me a touch screen and open GPIO pins. This flows right into using a Raspberry Pi 4 rather than a Pi Zero. While this would make the build much bigger and heavier, it would give me a lot more CPU power, memory and sound. I would also get a rechargeable battery pack, 3 AA batteries will probably not last nearly long enough. Unfortunately, buying all this stuff today would probably throw the price well into what just buying one of those Linux handheld terminal I was talking about earlier.

Here is my parts list for anyone who cares.

 Obviously if you shop around, You might get this cheaper, like the switch you can probably get at a hardware store for 89 cents and it never hurts to shop ebay for used hardware.