Networking Is Magic

Good Morning from my Robotics Lab! This is Shadow_8472, and if you missed last week’s post, feel free to check it out. It… was a minor disaster. I tried setting up PiHole network adblocker, but my home router unexpectedly moved its local IP address in the process. I cleaned up what I could really quickly and noticed my little hackjob of a subnet router was running an end-of-life operating system. Today, I am fixing that oversight. Let’s get started!

Replacing My Hackjob Router

Hackjob Router was my consolation prize after a failed quest to implement the open source router firmware, OpenWRT, onto my Raspberry Pi 4B in early 2020 and another in 2021. Both times, the exact version I needed was still under development. Dealing with testing versions was too advanced of a magic spell for me. I did, however, find an easy tutorial within my reach, but it did little to advance me beyond an aspiring networking mage with smoke and mirrors, but no fire or glass. When I looked this week, the beta warning was lifted.

I downloaded OpenWRT and flashed it over Hackjob Router’s SD card. Sure enough, the web interface was complete. I’ve used at least half a dozen ranging from limited config options to full access. OpenWRT’s “Lu-Ci” web interface puts everything on display with a helpful tool tip. It is comparable to other network devices I’ve worked with, but is simpler to look at, and has slightly more functionality.

My final configuration was surprisingly easy for a project that’s been hanging for almost three years now. At no point did I gain a key insight directly from an online search. But mistakes were made, and background information was researched and shelved for later.

My first mistake was a wrong Wi-Fi password. When I finally located and corrected it, my connection to OpenWRT died. I quickly learned how to assign a static IP in KDE’s settings thanks to intuitive interface design. I researched br-lan, a virtual network interface used for assigning one IP to multiple physical interfaces, thinking I needed to add the physical Wi-Fi radio to the one automatically generated to host all of the one Ethernet port and “bridge” the two sides that way.

The problem was actually a bad netmask. IPv4 network addresses come in four eight-bit numbers between 0 and 255. Local networks mask off leading bits – typically in multiples of 8 (for example: 10.0.0.1/8). Routers can use DHCP to dynamically assign local IP addresses with in their assigned subnet. My subnet ranges between 192.168.1.0 and 192.168.1.255 – properly denoted 192.168.1.1/24. Originally, my trailing mask was /16, allowing DHCP to assign my workstation to 192.168.0.200. Correcting the mask made it behave.

An unanchored memory I have regarding this week’s research is that some devices can route packets directly between network interfaces as opposed to routing them manually. I doubt the Raspberry Pi 4 has this ability, but it would be nice to know for sure.

Takeaway

Networking is magic at times. I still have a long way to go before I understand enough to do everything I want to, but I’ve cleared a large and long-standing burrier toward that goal this week. This is in part thanks to OpenWRT’s Lu-Ci with its educational help tips about every drop-down menu, text field, and tick box.

Final Question

Do you ever study a known science and everything inside you insists it’s magic?

I look forward hearing your answers on in the comments below or on my Socials.

My Raspberry Pi 400 Runs Android

Good Morning from my Robotics Lab! This is Shadow_8472 with a side project of the week. Let’s get started!

Android Practice

I have been going without a smartphone for a while because I don’t accept Google’s terms of service. Apple is no better. The only option I’ll be happy with is one with nothing but open source software at its heart.

Unfortunately, 3rd party Android builds like LineageOS are infamously difficult and potentially a little unforgiving to install yourself. I need practice, which is why I installed an unofficial LineageOS build for the Raspberry Pi a couple months ago – right before I made an incomplete mad dash for assembling Button Mash into a proper home server.

I used balena Etcher to safely install a build of Android made for the Raspberry Pi 4 lineup built by Konsta [1].

The initial boot was a bit longer than reasonable, and there were some impressive graphical glitches I have never been able to reproduce since. It was a little wired using a mouse with Android menus – especially since I had no way to switch the mouse buttons to a more comfortable lefty configuration. My greatest impression was that there was nothing to do besides browse settings and the file system.

I wanted something a little more to present today, so I installed F-Droid, an app store for open source apps. The challenge wasn’t so much installation, but loading the .apk installation file where the file browser could see it. I had to plant a directory from within LineageOS and use the find command to locate it. Before moving the SD card back to the Pi 400 again, I changed the owner from root to the number 0 and made sure it had the needed permissions. Installation was smooth after that.

Only while doing this writeup did I realize this build was Android TV based. I expect to revisit this project with the correct installation.

Takeaway

I have no idea if this is supported at all beyond the efforts of KonstaT, or if it’s even anything more than a tech demo. While I would not recommend using a setup like this long term, it is still an excellent learning tool for where I am at right now.

Final Question

Have you ever used Android on something other than a smartphone or tablet?

I look forward to hearing your answers in the comments below or on my Discord server.

Work Cited

[1] Konsta, “Raspberry” konstakang.com, 2022. [Online]. Available: https://konstakang.com/devices/rpi4/. [Accessed May 2, 2022].

Family Photo Chest Part 13: Early Prototype Workflow

Good Morning from my Robotics Lab! This is Shadow_8472, and today, I am merging a couple projects into one and hoping they stick. Let’s get started!

Overview

I’ve been piecing bits of my photo trunk project workflow together now for way too long. Right now, the architecture is looking like I’ll be scanning sets of pictures to a directory on a Network Attached Storage, then I can use a cluster of dedicated microcomputers from another unfinished project to separate and deskew the raw data into individual files. These files will then live permanently on the NAS.

Progress is rarely linear though. My end goal for this week hopped around quite a bit, but in the end I felt like I did nothing but figuring out how not to proceed: ground work with no structure. Routers are hard when you’re trying to learn them on a schedule!

Lack of Progress

In a perfect world, I would have been well on the way to configuring a cluster node by now. In a less unreasonable one, I would have had my Pi 4 OpenWRT ready to support the cluster. Late-cycle diagnostics chased me into an even more fundamental problem with the system: Wi-Fi connectivity.

During diagnostics, I’m learning about how different parts of the system work. Physical connection points can be bridged for a single logical interface, and Ethernet cables can support separate ipv4 and ipv6 connections. I can’t configure the Ethernet (on either logical interface) the way I want because that’s how I’m connecting to the Web UI and SSH. I end up stuck using two computers besides the two router Pi’s (OpenWRT and a Raspian hack router that actually works) because I don’t like switching my Ethernet cables around on the switch, but I need to do that anyway when I have to copy a large block of text. In short: the sooner Wi-Fi gets working, the better.

I understand I am essentially working with a snapshot. It’s been tidied up a bit, but bugs still exist. Wi-Fi is apparently one of those things that’s extra delicate; each country has its own region, among other complexities. On the other hand, I don’t know if that’s actually the case, as diagnostics are ongoing.

Takeaway

I’m probably going to work on this one in the background for a while. The OpenWRT help forum’s polish at least in part makes up for routers being dull to learn. If it takes too long, I do have other projects, so I may need to replace the cluster with a more readily available solution.

Final Question

Have you ever had upstream bugs that kept you from completing a task?

A Collection of Raspberry Pi Projects: Volume 2

Good Morning from my Robotics Lab! This is Shadow_8472, and today, I am giving my day one review of LibreELEC running on the Raspberry Pi 4. Let’s get started!

Installation

Depending on how I divide this up, LibreELEC was one of the most painless distros to install, or one that’s taken me the longest to date. I believe my first attempt months ago failed because the download from their website was actually a small program to help download and install an image and I tried flashing it directly.

As per my custom for flashing SD cards, I made the download and tried installing on an actual Pi because it minimizes the chance for accidentally overwriting the wrong drive. This installer though, refused to work. I figure it was only compiled for desktop-style computers. It was a case of my own experience getting in my way.

Once I used their downloader to select the correct image and flash the chip, it worked. I did the usual new install setup procedures: establishing language, keyboard layout, time zone, etc. and spent a few hours poking around.

Kodi

The whole point of LibreELEC is to run one program and run it well: Kodi. I’ve never used it before, so I couldn’t tell you where the OS stops and the media program begins. Functionally, it feels like any media player sold in stores since DVD players were computerized for streaming content off the web, only it comes with a bunch of interface options.

I did have one problem after installation that stumped me enough to research. I had something all ready to play for the family, but the sound came up a no-go. A brief search quickly landed me in a community forum, where someone stated that for some reason, by default, LibreELEC on the Pi 4 only gives HDMI sound to the jack beside the micro USB C power plug. Otherwise, I was looking at possibly getting in there and messing around with things at the command line level over SSH; I have not yet found how to access a local terminal.

Future Work

There are a precious few keyboards in the home, and even fewer wired keyboards. Also of note is that my Pi 4 has been tied up for a while now, plugged into the TV. My endgame goal was never to leave this one tied up forever.

The Raspberry Pi 400 is largely equivalent to a Pi 4 (4 GB RAM) rearranged to fit inside a keyboard a la the Commodore 64. We put one on order, though suppliers are any combination of backordered, out of stock, or limiting how many each person can buy.

My plan has always been to make the SD card and put it in an appropriately specced host machine. Phase 2 of this project can proceed when I have an IR sensor to experiment with. When the keyboard is rendered unnecessary, I can think about moving the card over to a low end Pi 4 and see if it runs on 1 GB RAM.

Takeaway

No Linux experience is required to use LibreELEC. It is aimed at people who want more control over their home entertainment experience than is afforded by a commercial media player. It walks you through the scariest parts of installation, and the one problem I needed to research externally was trivial to find the answer for. Everything I can think of that someone might want in a basic home entertainment center is laid out plainly, but more advanced options exist for expert users.

Final Question

Have you ever been in a situation where your own experience got in the way of solving a relatively simple problem?