Parental Sanity, Child Compliance on the Road

Technology advances at such a rapid pace. Back in the 90’s, all of the “cool” kids parent’s had TV’s equipped with VCR’s in their family road trip vehicle. These were typically some sort of van (Chevrolet Astros, Ford Econolines, Dodge Ram wagons, etc.) and at the time no one really cared about whether or not it got good fuel mileage. They just wanted something big enough to take the whole family across the country in. Y2K hits and the technology gets even smaller as DVD players become options on vans, SUVs, even some pickups and portable DVD players even become low cost alternatives. My mother’s first entry into the soccer “mom” platform was with a Chevrolet Trailblazer EXT which was totaled 18 months later (still the only vehicle she has ever wrecked) but I distinctively remember taking road trips in it and laying watching DVD’s on a Pentium 4 laptop. It’s replacement was a 2004 Chevrolet Trailblazer EXT with the LT trim package and rear entertainment system and she would drive that car for the next 8 years before I would get tired of constantly fixing one of my F150’s and opting to sell it and buy that Trailblazer EXT off of my parents. I distinctly remember playing Zelda: Wind Waker to and from Texas to Colorado on multiple occasions and watching many movies (I actually watched 2 Fast 2 Furious on the way home from the dealership). Everything still worked as far as the rear entertainment system goes the day I hauled that EXT to the junkyard with a blown 4.2L inline 6 (on it’s third 4L60E transmission) behind my “new to me” 2013 GMC Sierra and after 5 years and 125,000 miles that truck shows no sign of even hiccupping and I fully intend to reach at least 1/4 of a million miles in it.

I lost one quite important thing (if you ask my kids, even though none of them remember that Trailblazer) which was the DVD player. No big deal as a few years later my wife and I would find a heck of deal on a fully loaded 2014 Lincoln MKT with all wheel drive and a 3.5L EcoBoost under the hood. While the build quality of the vehicle was no better than the Ford trucks I’ve had in the past it didn’t just have a DVD player in it…it had two (and the kids go wild). My wife racked up the mileage (bought with 42k miles) on that vehicle and we ended up trading it in July 2020 after only having it for 26 months as she had gotten it up to 132k miles and it was beginning to have more issues than I wanted to deal with. The vehicle we bought, a 2020 Toyota Highlander Hybrid as that Lincoln only got 19 mpg which was only marginally better than the 5.3L V8 in my Sierra. Since we consider my Dieselgate Jetta SportsWagen to be too small to take long trips in, the Highlander became the new road trip vehicle for the family. Only one catch, it’s 2020 (hell of a year if you ask me) and they don’t put DVD players in cars anymore (typically no CD either).

The first solution, download movies onto the kids Kindle Fire tablets. It’s easy, as long as I remember to renew downloads and update movies before we leave. I can also only put so many movies on the tablets due to my oldest two having older model Kindle Fire’s with less storage compared to my youngest who has 4x the storage. We played with this idea on and off for a few years when I would take the kids somewhere in one of my vehicles (because I didn’t exactly enjoy driving the Lincoln) and it mostly worked for three or four hour trips but for some of the longer cross country, multi-state trips of which I am known for…not so much. I had an epiphany when we bought the Highlander though…Plex as I already had quite an extensive Plex library.

Needed Equipment

So what is this going to take?
– Raspberry Pi (Pi 4 B with 4GB of memory)
– MicroSD card (128 GB SanDisk in my case)
– USB-C power source (12V adapter to use in the car)
– Flirc case (I was looking for one with decent heat sinking capability)
– Time and media

From this point forward, I will assume that the reader has some familiarity with Linux and/or Raspberry Pi Single Board Computers.

Configuring the Raspberry Pi

First off, go to the Raspberry Pi Foundation’s website and get the latest (or a more recent) version of Raspbian (which is now called Raspberry Pi OS). I personally get the lite veriosn of the OS as I don’t need the GUI nor do I even intend to ever run this Pi 4 with a monitor. https://www.raspberrypi.org/downloads/raspberry-pi-os/

Once that has been downloaded, it will need to be imaged over to the MicroSD card. This can be done many ways (there are now official imagers from the RPi foundation which can be found at https://www.raspberrypi.org/downloads/) but I’ve always used the Unix command dd with my Mac’s and Linux servers and since I keep a local cache of distro’s on my home server, dd is the command I will continue to use. I would also advise taking the time to add a file in the FAT32 “boot” partition of the imaged SD card named SSH as this will enable SSH on initial boot.

Next you plug the SD card into the Pi and then plug it into power and ethernet (unless you have a PoE HAT…then you may just need to plug it into ethernet). Now the fun part, figuring out what IP address your network’s DHCP server has issued to the Pi. There are several ways to do this but I simply check leases in my DHCP server.

Once you know the IP address, you can simply SSH into the Pi. If using a Mac (or Linux assuming openssh is installed) that’s as simple as opening terminal and entering ssh pi@<IP Address of Pi> and hitting return. If using Windows, quick way to go about it is to download and install Putty or going through the system settings and manually installing openssh so you can invoke the service through either Command Prompt or Powershell. I use openssh through Command Prompt due to my comfort in working out of Linux and Mac terminals and performing other tasks in Command Prompt help keep me fresh for when I need to do some work on DOS machines (it’s rare, but it does happen).

Using OpenSSH via Window’s Command Prompt

Once in, go ahead and issue the command sudo raspi-config and begin configuring your Raspberry Pi. Under System Options I would recommend changing the password and making the hostname unique. Under Localisation Options (not the American spelling which is why it may look weird) change the Timezone and Locale (for example, US>Central and en_US-UTF-8 for me). Then go to Advanced Options>Expand Filesystem which will expand the file system to the SD card (it’s only the size of the IMG file by default). I would take the opportunity to increase the video memory to at least 128 MB or higher depending on which model Pi you are using and then reboot.

The Raspberry Pi configuration menu

Once rebooted, log back in (note if you changed the hostname this will be reflected on the prompt) and issue sudo apt update && sudo apt upgrade and answer any prompts to bring your system up to date (you may want to reboot again). This step can take some time. Now the fun can begin. Start off by going to the Plex website at https://www.plex.tv/media-server-downloads/#plex-media-server and downloading the latest version of Plex server for the ARMv7 CPU. If using GUI, this can be done from the Pi but if not you’ll need to right click the link (it’ll be a .deb file) and copy the link address. Then issue the following into the Pi’s command line wget https://downloads.plex.tv/plex-media-server-new/1.20.4.3517-ab5e1197c/debian/plexmediaserver_1.20.4.3517-ab5e1197c_armhf.deb which is the current most version of Plex at the time of this writing. Once the file has been downloaded onto the Pi, simply type “sudo dpkg -i plexmedia<tab>” where <tab> is physically hitting the tab button which will autocomplete the filename and hit enter/return. Once done, Plex Media Server should be installed and running. In order to access it you will need to go into a web browser navigate to “<IP Address of Pi>:32400/web/” and begin setting up your Plex server.

Next we will need to configure the wireless interface on the Pi (which is currently disabled) to be a Wireless AP in addition to issuing DHCP addresses. For this we will reference https://www.raspberrypi.org/documentation/configuration/wireless/access-point-routed.md for setting up a Pi as a routed AP as it describes setting up DHCP and wireless and the below code blocks will come directly from it. Start off by installing hostapd and dnsmasq via the command sudo apt install hostapd dnsmasq. Once that is complete we will want enable hostapd (so it starts at boot) via sudo systemctl enable hostapd. Next we will want to configure the IP for the wireless interface (wlan0). We will need to edit “/etc/dhcpd.conf” with the text editor of your choice (nano, vim, etc) by adding the following:

interface wlan0
    static ip_address=192.168.4.1/24
    nohook wpa_supplicant 

Again, this is straight from the linked webpage. Next we are going to scroll down the reference page and setup dhcp starting with renaming the dnsmasq.conf file using the mv command.

sudo mv /etc/dnsmasq.conf /etc/dnsmasq.conf.orig

Next, we will create a new file containing the following:

interface=wlan0 # Listening interface
dhcp-range=192.168.4.2,192.168.4.20,255.255.255.0,24h
                # Pool of IP addresses served via DHCP
domain=wlan     # Local wireless DNS domain
address=/gw.wlan/192.168.4.1
                # Alias for this router

This will issue dhcp addresses between 192.168.4.2 and 192.168.4.20 on a 24 hour lease. You may adjust this to your preferences. Go ahead and issue the command “sudo rfkill unblock wlan” to enable the wireless interface on the Pi. Then we will want to create a file in /etc/hostapd/ named hostapd.conf with the following:

country_code=US
interface=wlan0
ssid=NameOfNetwork
hw_mode=g
channel=6
macaddr_acl=0
auth_algs=1
ignore_broadcast_ssid=0
wpa=2
wpa_passphrase=AardvarkBadgerHedgehog
wpa_key_mgmt=WPA-PSK
wpa_pairwise=TKIP
rsn_pairwise=CCMP

I’ve gone ahead and changed the country code to the US (because I’m located there) and moved the channel to channel 6 (2422 MHz) as two of my children’s Kindle Fire’s do not support 5 GHz operation (and that’s okay). Also it should be noted, this is only going to use WPA-PSK (which uses TKIP for encryption) and if you are running iOS 14+ you will see an error stating that the network is unsecure. It’s not a big deal for this application but just beware, WPA-PSK is no longer considered secure. Finally reboot the Pi and it should come up advertising an SSID (NameOfNetwork with a passphrase of AdrvarkBadgerHedgehog per the config file above) and should issue dhcp leases without issue. Note, we did not configure the Pi as a full blown router so with our configuration internet access cannot be obtained through WiFi.

Finalizing Plex Configuration

Now Plex does some funky things (like not allowing you to access your movies without an internet connection) by default and we will need to change those settings once we have a few things setup. For this we will be referencing https://www.howtogeek.com/303282/how-to-use-plex-media-server-without-internet-access/.

First, go to the network settings for the Plex server and provide the subnet used on the wlan interface followed by the netmask (192.168.4.0/255.255.255.0 according to what we used above) in the “List of IPs and Networks that are allowed without authentication”. Don’t forget to click save changes at the bottom of the page.

Add subnet info for authentication-less access

Finally we are going to enable DLNA which is as simple as clicking DLNA three options below network on the left menu and enabling the service via the checkbox (again, don’t forget to save).

That’s all it. Now all that has to be done is add media to the Pi (default directory is /var/lib/plexmediaserver/Library/) and connect devices to the network (if you are using a Plex App this should show up as a local server). Once you get all of that done, plug it into the car and go.

Server with Android Tablet
Starting Spirit: Riding Free from the Plex server