Showing posts with label Raspberry Pi. Show all posts
Showing posts with label Raspberry Pi. Show all posts

Saturday, February 07, 2026

One Cable, Many Screens: A Self-Hosting PoE Raspberry Pi 4 Infotainment System

This is version 2 of my multi-screen Raspberry Pi infotainment project. The first version (DIY In-Car Infotainment) required a separate pocket router for DHCP, DNS, and DLNA. This version eliminates that dependency — one prebuilt SD card image works for all terminals, and the system configures itself automatically at boot.

Last updated: February 9, 2026

What's New in v2.1

  • Touch-friendly OSD controls — New "Sync" and "Stop All" buttons in Kodi's video player OSD. Tap the screen to show controls, tap Sync to synchronize all screens.
  • Master-only visibility — OSD sync buttons automatically hide on slave devices (only visible on master with USB mounted).
  • Keyboard shortcut — Press 'S' during video playback to trigger sync immediately.
  • No startup prompts — Pre-configured Addons database eliminates "Do you want to enable this addon?" popups.
  • Accurate device count — Fixed duplicate localhost counting (shows correct 3/3 instead of 4/4).
  • Minimal dual-screen setup — Just two Pi4s connected with a direct Ethernet cable — no PoE switch needed for small deployments.

v2.0 features: Self-hosted DHCP/DNS/NTP/DLNA on master Pi, automatic master election via USB detection, one SD card image for all terminals.

Minimal Dual-Screen Setup

For a quick two-screen deployment, you don't need a PoE switch — just connect two Pi4s directly with an Ethernet cable:

Minimal dual-screen setup: two Raspberry Pi 4 terminals connected directly with an Ethernet cable, master with USB storage

Minimal setup: Two Pi4s connected directly via Ethernet. The Pi with USB storage becomes master automatically.

What you need:

  • 2× Raspberry Pi 4 with touch displays
  • 2× MicroSD cards (same image on both)
  • 1× Ethernet cable (any length, crossover not required)
  • 1× USB storage with media files
  • 2× Power supplies (5V/3A each)

How it works:

  1. Download the pre-built SD card image (v2.1) and flash it to both cards using balenaEtcher or Rufus
  2. Connect the two Pi4s with a standard Ethernet cable
  3. Attach USB storage to one Pi (this becomes the master)
  4. Power on both — master provides DHCP, DLNA, and NTP to the slave
  5. Both terminals launch Kodi and show the DLNA media library

From here, use the touch-screen OSD controls to sync playback across both screens.

Scaling up? Add a PoE switch for 3+ screens — see Multi-Screen Setup (3+ Screens with PoE Switch) below.

Multi-Screen Setup (3+ Screens with PoE Switch)

Raspberry Pi 4 multi-screen infotainment system setup diagram showing PoE switch, master terminal with USB, and client terminals

System diagram: One master Pi (with USB media) provides DHCP, DNS, NTP, and DLNA to all client terminals via a PoE switch.

A typical deployment uses:

  • 1 master Pi4 terminal (with USB media attached)
  • 3 client Pi4 terminals
  • 1 PoE switch (5-port or larger)

The topology is a pure star connection: every terminal connects directly to the PoE switch via a single Ethernet cable that provides both power and network. No AV matrix or special head-end hardware required.

How It Works

  1. PoE switch powers on
  2. All Pi4 terminals boot from identical SD cards
  3. Each terminal checks for USB storage
  4. The terminal with USB media becomes the master automatically
  5. Master starts DHCP (192.168.8.100-200), DNS, NTP, and DLNA services
  6. Client terminals get their IP address, time sync, and media access from master
  7. All terminals launch Kodi and connect to the DLNA source
  8. Users choose Personal Mode or Sync Mode

Two Operating Modes

Personal Mode

Each user gets their own screen and audio path:

  • Analog headset via 3.5mm jack, or
  • Bluetooth headset

This feels similar to in-flight seatback entertainment. Each passenger independently browses the DLNA media library in Kodi and plays whatever they want.

Sync Mode

When shared viewing is needed, the master terminal can synchronize all clients using touch-screen OSD controls:

  1. Start playing a video on the master (the Pi with USB storage)
  2. Tap the screen (or press any key) to show the OSD
  3. Tap Sync — all screens open the same video at the same position
  4. Tap Stop All — stops playback on all screens simultaneously
Kodi OSD showing custom Media-Mux Sync and Stop All buttons for synchronized multi-screen playback control

Kodi video player OSD on master device showing the custom Sync and Stop All buttons (highlighted). These buttons only appear on the master Pi.

Keyboard shortcut: Press 'S' during video playback to trigger sync immediately without showing the OSD.

Non-touch displays? Connect a mini 3-key USB keyboard to the master. Press KEY_1 to sync, KEY_2 to stop all. The OSD buttons are hidden on slave devices — only the master shows them.

Master audio can feed a central sound system (vehicle speakers, room PA, etc.) for group viewing.

Hardware List

For a 4-terminal setup:

Component Qty Notes
Raspberry Pi 4 (4GB) 4 2GB works but 4GB recommended
PoE HAT 4 Official or compatible 802.3af HAT
MicroSD card (32GB+) 4 Class 10 or faster
Full HD touch display 4 7" to 10" HDMI displays work well
PoE switch 1 5-port minimum, 802.3af/at
Ethernet cables 4 Up to 50m runs supported
USB storage 1 NTFS, FAT32, or ext4 formatted
3-key USB keyboard (optional) 1 Only needed for non-touch displays; touch screens use OSD buttons

Compared to v1, you no longer need the GL-MT300N-V2 pocket router — the master Pi handles all network services.

Real-World Use Cases

In-Car / Fleet Passenger Infotainment

Ideal for vehicles with multiple passengers:

  • Each passenger watches independent content with personal audio
  • One key press switches everyone to synchronized shared playback
  • Master audio routes to vehicle speakers for group viewing

Gives both freedom (personal playback) and coordination (sync playback) in one system.

Multi-Room Shared Viewing

Use case diagram showing multi-room shared viewing with synchronized screens in overflow rooms

Multi-room use case: synchronized playback across overflow rooms, halls, or training centers.

For venues where people are spread across rooms:

  • House of worship overflow rooms
  • Community halls
  • Training centers
  • Small campuses

A single PoE star network keeps wiring simple and operations predictable.

Quick Start

Option 1: Pre-built Image (Recommended)

  1. Download the pre-built SD card image (v2.1) (~1.2GB)
  2. Flash the image to all SD cards using balenaEtcher or Rufus
  3. Insert SD cards into Pi4 terminals
  4. Connect all terminals to PoE switch
  5. Insert USB media (NTFS, FAT32, or ext4) into one terminal
  6. Power on the PoE switch
  7. Wait for all terminals to boot into Kodi

Option 2: Manual Installation

On an existing Raspberry Pi OS Lite installation:

git clone https://github.com/hackboxguy/media-mux.git
cd media-mux
sudo ./setup.sh
# System reboots after base installation

# After reboot, login again and run:
cd media-mux
sudo ./setup-selfhosted.sh
sudo reboot

Troubleshooting

DLNA source shows "Couldn't connect to network server"

  • Check if master terminal has USB media attached
  • Verify minidlna is running: pgrep -f minidlnad
  • Check master log: cat /var/log/media-mux-selfhosted.log
  • Ensure USB is mounted: mount | grep /media/usb

Client terminal not getting IP address

  • Verify master booted first and has USB attached
  • Check dnsmasq is running on master: systemctl status dnsmasq
  • Try rebooting the client terminal

Time is wrong on client terminals

  • Wait a few minutes after boot for NTP sync
  • Check chrony status: chronyc sources
  • Verify master chrony is running: pgrep -f chronyd

Sync playback not working

  • Ensure you are triggering sync from the master (the Pi with USB storage)
  • Touch screen: Tap screen to show OSD, tap Sync button
  • Keyboard: Press 'S' during playback, or KEY_1 on 3-key keyboard
  • Check kodisync log on master: cat /var/log/kodisync.log
  • Verify all clients are on the same network (192.168.8.x)

OSD Sync/Stop buttons not visible

  • Buttons only appear on the master (Pi with USB storage attached)
  • Slave devices do not show these buttons by design
  • If master doesn't show buttons, verify USB is mounted: mount | grep /media/usb

USB media not detected

  • Supported formats: NTFS, FAT32, ext4
  • Check dmesg for USB detection: dmesg | grep -i usb
  • Try a different USB port or cable

Current Limitations

The system works reliably for practical deployments, but there are areas for future improvement:

  • No automatic master failover if master is disconnected
  • No web dashboard for status monitoring
  • Role is determined by USB presence (no manual pinning)

SOURCE CODE

github.com/hackboxguy/media-mux — pre-built images and release notes in Releases section

Friday, April 19, 2024

DIY In-Car Infotainment with Raspberry Pi and Kodi

Build your own in-car entertainment system — individual touch displays for each passenger, streaming multimedia over a local network with no internet required. Using off-the-shelf hardware and open-source software, each screen costs around $180–$200.

Last updated: February 7, 2026

What's New (Feb 2026)

  • Pre-built SD card image — Download, flash, and boot. No manual installation needed. Download here (~1.2GB)
  • Rock-solid sync — Integrated kodisync for frame-accurate synchronization. Now achieves sub-10ms sync spread (vs. multiple attempts needed before)
  • Auto-negotiation — No more manual master/slave configuration. Each Pi generates a unique hostname from its MAC address and devices auto-discover each other
  • One image for all — Flash the same image to all SD cards. No per-device configuration required
Detailed wiring diagram for DIY in-car infotainment system with PoE switch, pocket router, and Raspberry Pi screens

Complete wiring diagram: PoE switch powers each Raspberry Pi + touch screen over a single Ethernet cable.

How it works

The system uses a distributed architecture — no central multi-head controller needed. Each passenger screen is an independent Raspberry Pi 4 running Kodi, powered and networked through a single Ethernet cable via Power over Ethernet (PoE). A pocket router acts as the DLNA/DHCP server, serving media files from a USB drive to all screens on the local network.

What you need

Component Role
PoE switch Powers and networks all Raspberry Pi screens over single Ethernet cables
GL-MT300N-V2 pocket router DLNA media server + DHCP server (see pocket router DLNA guide)
Raspberry Pi 4 + PoE HAT Media player endpoint (one per passenger screen)
Full HD touch display Passenger-facing screen (one per seat)
USB media drive Stores multimedia files, plugged into the pocket router

Why this architecture

  • Single-cable per screen — PoE eliminates separate power cables, simplifying in-car wiring
  • Distributed decoding — each Raspberry Pi handles its own multimedia decoding and rendering, so there is no central bottleneck
  • Easily scalable — add more screens by swapping in a PoE switch with more ports
  • Fully offline — works in areas with no mobile coverage; all content is served locally
  • Individual or shared playback — each passenger can browse and play their own content, or all screens can be synchronized

Cost per screen

Each passenger display costs approximately $180–$200, including the Raspberry Pi 4, PoE HAT, and a full HD touch screen. The PoE switch and pocket router are shared across all screens.

Software stack

  • Kodi — open-source media player running on each Raspberry Pi, with DLNA client support built in
  • OpenWrt + minidlna — runs on the pocket router, serving media files over DLNA
  • Raspberry Pi OS — base operating system for the Pi endpoints
  • media-mux — synchronization software that coordinates playback across all screens

For the DLNA server setup on the pocket router, see the companion post: Transforming Your GL-MT300N-V2 Pocket Router into a DLNA Multimedia Server.

Installation

Option 1: Pre-built Image (Recommended)

The easiest way to get started — download and flash the same image to all SD cards:

  1. Download the pre-built image (~1.2GB)
  2. Flash to each SD card using balenaEtcher or Rufus
  3. Insert SD cards into your Raspberry Pi 4's and boot

That's it! Each Pi automatically generates a unique hostname and discovers other devices on the network.

Option 2: Manual Installation

For custom setups, you can install on an existing Raspberry Pi OS. See the manual installation guide for step-by-step instructions.

How sync works

Connect a 3-key USB keyboard to any Raspberry Pi — this becomes the sync trigger device. Press KEY_1 to synchronize all screens:

  1. The sync script reads the currently playing media and position from the trigger device
  2. Discovers all media-mux devices on the network via Avahi/mDNS
  3. Opens the same media file on all devices
  4. Uses kodisync to pause all players at the exact same frame
  5. Seeks all players to the same position and resumes playback simultaneously

Sync accuracy: The system achieves sub-200ms synchronization, typically with less than 10ms spread between devices. This is a significant improvement over the earlier version shown in the video, which required multiple sync attempts.

SOURCE CODE

github.com/hackboxguy/media-mux — sync software + pre-built SD card image

github.com/hackboxguy/multiscreen-media — hardware build guide and bill of materials

Version 2 now available: A self-hosting version that eliminates the pocket router. One Pi becomes the master automatically, providing DHCP, DNS, NTP, and DLNA. See Self-Hosting PoE Raspberry Pi 4 Infotainment System.

Thursday, June 22, 2023

Rugged Metal Buttons with LED Rings on Raspberry Pi

How to interface rugged metal pushbuttons with LED rings to a headless Raspberry Pi — using the built-in triggerhappy daemon to invoke scripts on button press and provide LED feedback, with no display or keyboard needed.

Connection diagram — pushbuttons to Raspberry Pi GPIO

Connection diagram — two pushbuttons wired to Raspberry Pi GPIO pins.

How it works

Instead of userspace I/O libraries, this approach uses the triggerhappy daemon (built into Raspbian) to map standard key codes from /dev/input/eventX to scripts via /etc/triggerhappy/triggers.d/actions.conf.

Overview of the steps:

  1. Connect pushbuttons to Raspberry Pi GPIOs as shown in the connection diagram
  2. Prepare a Raspberry Pi OS Lite SD card using Raspberry Pi Imager
  3. SSH into the Raspberry Pi
  4. Add dtoverlay config lines to /boot/config
  5. Create push-buttons.conf under /etc/triggerhappy/triggers.d/
  6. Modify /lib/systemd/system/triggerhappy.service to run as the pi user
  7. Create action scripts configured in push-buttons.conf
  8. Reboot and press a button to see the configured action invoked

Prepare the SD card

  1. Download the Raspberry Pi Imager
  2. Open the app → CHOOSE OS → Raspberry Pi OS (Other) → Raspberry Pi OS Lite (32-bit)
  3. Insert the SD card and click CHOOSE STORAGE
  4. Press Ctrl + Shift + X to open advanced options
  5. Set hostname, enable SSH, username/password, and local time settings as shown below, then click SAVE
  6. Click WRITE to create the bootable SD card
Raspberry Pi Imager advanced options

Raspberry Pi Imager — advanced options for headless setup.

Setup and demo

  1. Connect two pushbuttons to Raspberry Pi GPIO pins as shown in the connection diagram
  2. Insert the SD card, connect the Pi to your local DHCP network, and power on
  3. SSH in: ssh pi@my-raspi-001 (use the password from the Imager advanced options)
  4. Run the following commands:
sudo apt-get install -y git esptool
git clone https://github.com/hackboxguy/pi-pushbtn-demo.git
cd pi-pushbtn-demo
sudo ./setup.sh
sudo reboot
Terminal showing setup commands

Running the setup commands on the Raspberry Pi.

Wait ~40 seconds for the Pi to reboot. Press one pushbutton — its LED ring blinks at ~2 Hz. Press the other button — its LED starts blinking and the first one stops.

Extending the demo

Instead of just blinking LEDs, the buttons can invoke real tasks. For example, to flash different firmware binaries to an ESP8266 (e.g. Wemos D1 Mini) on button press, replace the action scripts:

cp /home/pi/pi-pushbtn-demo/flash-esp-1hz.sh /home/pi/pi-pushbtn-demo/key-pressed-down.sh
cp /home/pi/pi-pushbtn-demo/flash-esp-4hz.sh /home/pi/pi-pushbtn-demo/key-pressed-up.sh

After this change, pressing a button blinks the LED ring for ~30 seconds (indicating the Wemos D1 Mini is being flashed), then stops when flashing completes. See the 1 Hz flash script and 4 Hz flash script for details.

Hardware setup — pushbuttons connected to Raspberry Pi

Complete setup — rugged metal pushbuttons connected to the Raspberry Pi.

SOURCE CODE

github.com/hackboxguy/pi-pushbtn-demo — scripts and setup instructions

Friday, November 18, 2022

Bridge SMS to XMPP: Receive 2FA Codes Abroad

Bridge your mobile SMS with XMPP instant messaging so you can read and send text messages from anywhere over the internet. The primary use case: receiving 2FA verification codes while travelling internationally, without roaming or asking someone at home to read them out for you.

Setup diagram — SMS flows from GSM network through Raspberry Pi to XMPP client

Setup overview — a Raspberry Pi with a USB 3G modem bridges SMS to XMPP via a public Jabber server.

The setup uses a Raspberry Pi with a Huawei E173 (or E303) USB 3G dongle and an encrypted XMPP connection to deliver SMS securely to your phone's chat app. All code is open source, and you can use any public Jabber server (or host your own with Prosody).

Preparing the SD card

  1. Download the Raspberry Pi Imager
  2. Open it and select: CHOOSE OS → Raspberry Pi OS (Other) → Raspberry Pi OS Lite (32-bit)
  3. Select your SD card via CHOOSE STORAGE
  4. Press Ctrl + Shift + X to open the advanced options
  5. Set hostname, enable SSH, username, password, and timezone as shown below, then click SAVE
  6. Click WRITE to create the bootable SD card
Raspberry Pi Imager advanced options dialog

Raspberry Pi Imager — advanced options for hostname, SSH, and credentials.

Setting up the Raspberry Pi

  1. Insert your SIM card (PIN lock must be disabled) into the Huawei E173/E303 dongle and connect it to the Raspberry Pi
  2. Keep the Pi powered on and connected to your home internet 24/7
  3. Once booted, SSH in:
ssh pi@my-raspi-001
  1. Install the XMPP remote agent:
sudo apt-get install -y git
git clone --recursive https://github.com/hackboxguy/xmpp-remote-agent.git
cd xmpp-remote-agent
./setup.sh -u raspi-sim-1@jabber.de -p my-raspi-xmpp-secret-pw
sudo reboot; exit

Replace the example XMPP username and password with your own credentials.

The setup.sh script may take 10–15 minutes on a Raspberry Pi 1.

On your phone's Xabber app (Android or iOS), log in with your XMPP account (e.g. john.doe@jabber.de). The Raspberry Pi should appear online — send help to get the list of available commands.

Reading SMS

smsupdate       # fetch SMS from SIM to cache (wait for Success response)
smstotal        # show number of cached messages
smsget 0        # read the first message

Sending SMS

smssend +919876543210 this is a test message

Deleting SMS

When the SIM memory is full, new messages stop arriving. Delete all stored messages with:

smsdeleteall

Voice dialling and USSD codes

Ring a GSM phone (caller ID shows as SIM-1's number, no audio — ringing only):

dialvoice +919876543210

Check prepaid balance or send other USSD codes:

dialussd *100#     # send USSD code (wait for Success response)
readussd           # read the carrier's response

How it works internally

Two services run on the Raspberry Pi:

  • bboxsmsrv — based on libgammu, handles SMS read/write/delete via the USB 3G modem
  • xmproxysrv — based on libgloox, acts as a headless XMPP client that logs into the Jabber server and maintains an always-on connection

When a 2FA SMS arrives, it is stored in the SIM memory by the 3G modem. On your phone's Xabber app, you send smsupdate → xmproxysrv parses the command and asks bboxsmsrv to fetch messages from the SIM → once complete, a Success response is sent back → you then read the messages with smsget.

For sending, the flow reverses: your chat message travels through the XMPP server to xmproxysrv, which hands it to bboxsmsrv, which sends the SMS via the 3G modem — delivering an SMS to any phone number without roaming charges.

SOURCE CODE

github.com/hackboxguy/xmpp-remote-agent — setup scripts and configuration

github.com/hackboxguy/brbox — bboxsmsrv and xmproxysrv sources

Saturday, September 24, 2022

AWS IoT on Raspberry Pi with 25 MB Buildroot Linux

Six simple steps to get an AWS IoT Device SDK demo running on a Raspberry Pi 4 — using a lightweight custom Linux image built with Buildroot (just under 25 MB).

Quick start

  1. Download sdcard-pi4-aws-iot-demo.img.xz (~25 MB)
  2. Write the image to an SD card using Balena Etcher
  3. Unplug and re-plug the SD card so the boot partition appears on your PC
  4. Open aws-iot-pubsub-agent.conf and set your AWS IoT endpoint
  5. Copy your AWS-generated device certificate (xyz-certificate.pem) and private key (xyz-private.pem.key) to the boot partition
  6. Insert the SD card into the Raspberry Pi 4, power on — the aws-iot-pubsub-agent will start publishing messages to your AWS IoT Core

The following image shows steps 4, 5, and 6 in detail:

SD card configuration — endpoint, certificates, and boot

Steps 4–6: configure endpoint, copy certificates, and boot the Pi.

AWS cloud preparation

Before booting the Pi, set up the following on console.aws.amazon.com:

  1. Create an AWS IoT account (payment details required even for the free tier)
  2. Navigate to IoT Core
  3. Go to Manage → All Devices → Things → Create Thing
  4. Download the device certificate and private key (copy these to the SD card boot partition as described in step 5 above)
  5. Go to Settings and note your Endpoint (needed for step 4 above)
  6. Go to Security → Policies and create a policy with 4 entries as shown below:
AWS IoT security policy configuration

AWS IoT security policy — required permissions for the device.

Building the image from source

Two commands to build the SD card image (detailed instructions in the git repository):

make -C buildroot BR2_EXTERNAL=../ BR2_DL_DIR=../../br-dl O=../../br-output raspberrypi4_aws_iot_defconfig
make -C buildroot BR2_EXTERNAL=../ BR2_DL_DIR=../../br-dl O=../../br-output

Buildroot customizations

Key changes in the Raspberry Pi 4 Buildroot config for this AWS demo image:

  1. Enabled Dropbear SSH for remote debugging without monitor/keyboard
  2. Added Buildroot package for aws-iot-device-sdk-cpp-v2
  3. Added Buildroot package for aws-iot-pubsub-agent
  4. Enabled chrony for time sync (required for TLS handshake)
  5. Enabled SDK dependencies (host-cmake, libcurl, openssl, util-linux)
  6. Included AmazonRootCA1.pem in /etc/
  7. Added aws-iot-pubsub-agent.conf to rootfs for the agent startup script
  8. Added /etc/init.d/S03MountBoot to mount the boot partition at /mnt/certs (contains certificates, key, and config)
  9. Included startup script for aws-iot-pubsub-agent

After booting

  1. Connect the Raspberry Pi 4 to a DHCP network with internet access
  2. Find the Pi on your network using hostname buildroot or its assigned IP
  3. Log in via SSH: ssh root@192.168.x.y (password: brb0x)
  4. Check the publish log: cat /tmp/aws-iot-pubsub-agent.log
  5. To modify the aws-iot-pubsub-agent code, see how to cross-compile and run on target

If everything is configured correctly (SD card and AWS security policies), Hello World! messages will appear on your AWS IoT Core console:

AWS IoT Core showing Hello World messages from Raspberry Pi

AWS IoT Core — Hello World messages arriving from the Raspberry Pi 4.

SOURCE CODE

github.com/hackboxguy/br-wrapper — build instructions and Buildroot config

sdcard-pi4-aws-iot-demo.img.xz — pre-built SD card image (~25 MB)

Friday, July 03, 2020

Vendor-Neutral Zigbee Gateway with Raspberry Pi

A one-script installer that turns a Raspberry Pi + CC2531 USB adapter into a vendor-neutral Zigbee home automation gateway running Domoticz — supporting 800+ Zigbee devices from any manufacturer.

Pimoticz hardware setup — Raspberry Pi with CC2531 USB adapter

Raspberry Pi with CC2531 USB Zigbee adapter — the complete Pimoticz hardware.

The problem

Cheap Zigbee home automation devices are everywhere, but they're locked to the manufacturer's gateway — limiting you to a small set of supported devices. With commercial off-the-shelf (COTS) hardware, you can build your own vendor-neutral gateway, but it requires setting up multiple components:

  1. Raspberry Pi
  2. CC2531 USB Zigbee adapter (with Koenkk firmware, ~$12 on Amazon)
  3. Raspberry Pi OS (32-bit)
  4. Node.js (v12 or higher)
  5. zigbee2mqtt
  6. Mosquitto MQTT broker
  7. Domoticz
  8. zigbee2mqtt plugin for Domoticz

For beginners, getting all these components working together is a challenging task. Pimoticz simplifies this with an automated installer script — in about 5 minutes you should be ready to pair your first Zigbee device.

Items needed

  • Raspberry Pi
  • Micro SD card
  • 5V power adapter
  • CC2531 USB Zigbee adapter

Important: To avoid the CC2531 programming setup, buy a pre-programmed USB adapter with Koenkk firmware (CC2531_DEFAULT_20190608.zip or higher).

Raspberry Pi OS setup

CC2531 USB adapter, keyboard, mouse, monitor, and internet connection are only needed during the initial setup.

Step 1 — Prepare the SD card using Raspberry Pi Imager and install Raspberry Pi OS 32-bit.

Step 2 — Insert the SD card, connect keyboard/mouse/monitor and internet to your Raspberry Pi, then power on.

Step 3 — On first boot, the setup wizard will guide you through:

  • Language and keyboard layout (important for correct local time — Domoticz needs it)
  • Set a new password for the pi user
  • Black border check (not important — Raspi will run headless after setup)
  • Wi-Fi setup (skip if using Ethernet)
  • Software update (optional — can skip to save time)
  • Reboot to apply settings
Pimoticz architecture diagram

Pimoticz software stack — zigbee2mqtt, Mosquitto, and Domoticz working together.

Pimoticz installation

Open a terminal on the Raspberry Pi (locally or via SSH) and run:

git clone https://github.com/hackboxguy/pimoticz.git
cd /home/pi/pimoticz
sudo ./setup.sh -h my-pimoticz    # -h hostname is optional
# wait ~5 minutes for setup to complete
sudo reboot
Pimoticz setup script running

Setup script in progress — installing all dependencies automatically.

After reboot, open a browser and navigate to http://127.0.0.1:8080 or http://my-pimoticz:8080 — Domoticz will show the detected CC2531 Zigbee coordinator.

Domoticz dashboard showing CC2531 coordinator

Domoticz running on Pimoticz — CC2531 Zigbee coordinator detected and ready to pair devices.

Your Pimoticz gateway is ready. You can now pair Zigbee devices from any manufacturer — Xiaomi, IKEA, Philips Hue, Sonoff, and 800+ more.

SOURCE CODE

github.com/hackboxguy/pimoticz — installer script and documentation

Thursday, February 27, 2020

YARMP: Lightweight Raspberry Pi Media Player

A lightweight Buildroot-based media player image (<65 MB) for Raspberry Pi that autoplays video, audio, or images in a loop — booting in under 20 seconds.

  • Supports all Pi 1 variants (Pi Zero, Pi Zero W, Pi A/B, Pi A+/B+)
  • Works on older Pis with just 256 MB RAM and a 1 GB SD card
  • Autoplays media from the internal SD card or an external FAT-formatted USB drive
Pi Zero running YARMP as digital photo album on 7-inch LCD

Battery-powered Pi Zero running YARMP as a digital photo album on a 7-inch LCD — under $50 total.

Quick start — 3 steps

  1. Download raspi-yarmp.img.xz to your PC
  2. Write the image to an SD card using Balena Etcher
  3. Insert the SD card into your Pi and power on — the default video starts playing in a loop
Balena Etcher step 1 — select image

Step 1: Select the YARMP image in Balena Etcher.

Balena Etcher step 2 — select target

Step 2: Select the SD card as target.

Balena Etcher step 3 — flash

Step 3: Flash the image to the SD card.

Flashing in progress

Flashing in progress.

Flash complete

Flash complete — SD card is ready.

Playing your own media

  1. Remove the SD card from the Pi and plug it into your PC
  2. Browse to USRDAT:\media-files\ and find sample-video.mkv
  3. Delete or back up the sample file, then add your own media (video, audio, or images) to the media-files directory
  4. Insert the SD card back into the Pi and power on — your media plays in a loop

If you can't find the USRDAT drive on Windows, try a USB SD card reader or mount it on Linux. Alternatively, copy your media to a FAT-formatted USB drive and plug it into the Pi — on boot, external USB media takes priority over the internal SD card.

Playback priority

When multiple media types are present, YARMP follows this priority order:

  1. Video files (highest priority)
  2. Audio files (e.g. MP3)
  3. Image files (e.g. JPG, PNG)
  4. If no media is found on USB or SD card, the default BBC motion gallery video plays

Seamless looping

By default, a single video file plays in seamless loop mode — no black screen between loops. For multiple videos to play seamlessly, merge them into one file using the melt tool.

For photo slideshows, adjust the display delay by editing /mnt/userdata/rc.local on the Pi (look for the fbv command line section).

Use cases

  • Digital signage
  • Portable HDMI audio/video test source (Pi Zero + battery bank)
  • Art installations — display your work on a loop
  • Museum exhibits — low-cost media playback
  • Science projects — small HDMI display with custom content
  • Digital photo album on an HDMI display

Hardware photos

Pi Zero YARMP setup — front view

Pi Zero with 7-inch LCD — front view.

Pi Zero YARMP setup — rear view

Pi Zero with 7-inch LCD — rear view showing battery bank.

DOWNLOADS

raspi-yarmp.img.xz — pre-built SD card image (<65 MB)

Wednesday, September 25, 2019

DIY Passive PoE for Raspberry Pi Under $2

How to power a Raspberry Pi 3/4 over an Ethernet cable (up to 100 m) using passive PoE — with off-the-shelf parts costing under ~$2.

Complete passive PoE setup for Raspberry Pi

Complete setup — Raspberry Pi powered over Ethernet via passive PoE.

Warning: This uses passive PoE with T568B wiring:

  • Blue / Blue-White → + (positive) terminal of DC supply
  • Brown-White / Brown → − (negative) terminal of DC supply

If you don't know what passive PoE is, do not proceed — buy a proper PoE HAT instead.

Parts needed

1. PoE injector cable (~$0.80)

PoE injector cable

PoE injector cable — splits power and data onto the Ethernet cable.

PoE injector cable — connector detail

Connector detail of the PoE injector cable.

PoE injector cable — wiring detail

Wiring detail of the PoE injector cable.

2. DC-DC buck converter (~$0.50) — look for Hesai brand on AliExpress, 12–24 V input, 5 V / 3 A output.

DC-DC buck converter module

DC-DC buck converter — 12–24 V input to 5 V / 3 A output.

Assembly

3. Solder jumper wires — Cut female-to-female jumper wire into 4 pieces and solder to the buck converter as shown:

Soldering jumper wires to buck converter

Jumper wires soldered to the DC-DC buck converter.

Wiring diagram for buck converter connections

Wiring diagram — connecting the buck converter to the PoE splitter.

4. Heatshrink and connect — Cover the DC-DC converter in a heatshrink sleeve and connect to the Raspberry Pi:

Buck converter in heatshrink connected to Raspberry Pi

DC-DC converter in heatshrink sleeve, connected to the Raspberry Pi.

5. Final setup — Feed 12 V DC and network into the PoE injector, then run a CAT-5 cable (up to 100 m) between the injector and the Raspberry Pi:

Complete passive PoE setup diagram

Complete setup — 12 V DC + network through PoE injector to Raspberry Pi over CAT-5.

Thursday, January 11, 2018

Access Your Raspberry Pi Remotely via XMPP Chat

How to remote-access a Raspberry Pi over the internet using an XMPP-based chat-bot — no port forwarding or dynamic DNS required. The chat-bot is written in C++ using the gloox XMPP client library, and communicates through a public Jabber server.

Setup diagram — Raspberry Pi chat-bot communicating with smartphone via XMPP

Typical setup — Raspberry Pi behind a firewall communicates with a smartphone via a public XMPP/Jabber server.

Building the chat-bot on Raspberry Pi

Tested on Raspbian Stretch Lite (2017-11-29). These steps work on any Debian-based Linux distro.

Step 1 — Log in to the Raspberry Pi shell (keyboard or SSH) and install dependencies:

sudo apt-get update
sudo apt-get install cmake git libjson-c-dev libgloox-dev openssl

Step 2 — Clone and build:

mkdir /home/pi/xmproxy
cd /home/pi/xmproxy
git clone https://github.com/hackboxguy/brbox
cd /home/pi/xmproxy/brbox/sources
cmake -H. -BOutput -DCMAKE_INSTALL_PREFIX=/home/pi/xmproxy/buildir -DAUTO_SVN_VERSION=OFF
cmake --build Output -- install    # add -j5 on quad-core Pi for faster build

Step 3 — Configure XMPP credentials and start the chat-bot:

cd /home/pi/xmproxy/buildir
echo "user: my-raspi-username@gmail.com" > xmpp-login.txt
echo "pw: super-secret-pw" >> xmpp-login.txt
export LD_LIBRARY_PATH=/home/pi/xmproxy/buildir/lib
/home/pi/xmproxy/buildir/bin/xmproxysrv --loginfile=/home/pi/xmproxy/buildir/xmpp-login.txt

Testing

Check on your Android phone's Hangouts (or any XMPP client) if my-raspi-username is online. Send help and the chat-bot will reply with the list of available commands.

Notes

For Google accounts, ensure Allow less secure apps is enabled on the Raspberry Pi's account.

The two XMPP accounts don't need to be on Google — any two Jabber accounts will work. See this guide for preparing Jabber accounts.

These steps work on any Debian-based Linux distro, not just Raspbian.

SOURCE CODE

github.com/hackboxguy/brbox — XMPP chat-bot sources and build instructions