Elderly MP4 Player — Complete Build Guide
Raspberry Pi 4 + ESP32 Wireless Remote
0.1 Purpose
This guide walks you through building a simple, reliable MP4 video player designed for a senior (90+ years old) who needs the simplest possible experience:
- No menus. No remote to lose. No confusing interfaces.
- Press one button — something happens immediately.
- Large, color-coded physical buttons they can find by touch.
- Videos play automatically on the TV. YouTube favorites load with one red button.
The system has two physical pieces:
| Piece | What it does | Where it lives |
|---|---|---|
| Raspberry Pi 4 box | Plays videos, runs the software, connects to the TV | Hidden behind the TV |
| ESP32 wireless remote | 6 large buttons, battery powered, no wires | On the senior’s side table or armrest |
Overall progress
Loading…
1 Part 1 — Raspberry Pi Box
Pi 4 Build — mounts behind TV
This section sets up the Pi, installs the software, wires the buttons, and mounts everything in the box.
1.1 Step 1 — Prepare the microSD OS card
Parts needed: Pi 4 board, 32GB microSD card (item 4), your laptop or desktop PC
1.1.1 Tasks
-
- Set hostname:
mpvplayer - Enable SSH: checked
- Set username:
piand a password you will remember - Configure WiFi: enter your home WiFi name and password
- Set locale / timezone to your region
- Set hostname:
TEST 1.1 — Card written correctly
- Insert the card back into your laptop after writing.
- You should see a drive called bootfs appear in Windows Explorer or Finder.
- If the drive appears, the card is ready. If Windows asks to format it, something went wrong — repeat the write.
1.2 Step 2 — Assemble the Pi in its case
Parts needed: Pi 4 board (item 1), Pi case with fan (item 3), heatsinks (included with case), 32GB microSD
1.2.1 Tasks
TEST 2.1 — Physical assembly
- Gently press each heatsink — they should not slide.
- The microSD card should be seated flush — it should not wiggle.
- The case lid should close flat with no gaps.
1.3 Step 3 — First boot and SSH connection
Parts needed: Pi in case, power supply (item 2), micro-HDMI cable (item 7), TV, your laptop on the same WiFi
1.3.1 Tasks
ssh pi@mpvplayer.localTEST 3.1 — SSH works
At the SSH prompt, type:
hostnameExpected output: mpvplayer
Type:
ping -c 3 google.comExpected output: 3 lines showing ping replies. This confirms WiFi and internet are working.
If SSH fails: Make sure your laptop is on the same WiFi network as the Pi. Try ssh pi@192.168.x.x using the Pi’s IP address instead (find it in your router’s connected devices list).
1.4 Step 4 — Install software on the Pi
Parts needed: SSH connection from Step 3
1.4.1 Tasks
Run each command below one at a time in your SSH terminal. Wait for each to finish before running the next.
sudo apt update && sudo apt upgrade -ysudo apt install mpv -ypip install flask --break-system-packagessudo apt install python3-rpi.gpio -ymkdir -p ~/mp4player/A-Data/videos
mkdir -p ~/mp4player/B-Engines
mkdir -p ~/mp4player/C-Results
touch ~/mp4player/A-Data/youtube.txtscp /path/to/your/test-video.mp4 pi@mpvplayer.local:/home/pi/mp4player/A-Data/videos/TEST 4.1 — mpv plays video on the TV
In your SSH session, run:
mpv --fs /home/pi/mp4player/A-Data/videos/test-video.mp4Expected: video plays fullscreen on the TV. Press q to quit.
TEST 4.2 — Flask installed
python3 -c "import flask; print('Flask OK:', flask.__version__)"Expected output: Flask OK: followed by a version number.
1.5 Step 5 — Copy the Python scripts to the Pi
Parts needed: SSH connection, the two Python files from this project (remote_server.py)
1.5.1 Tasks
scp remote_server.py pi@mpvplayer.local:/home/pi/mp4player/B-Engines/cd ~/mp4player/B-Engines
python3 remote_server.pyhttp://mpvplayer.local:5000/cmd/play
-
http://mpvplayer.local:5000/cmd/nexthttp://mpvplayer.local:5000/cmd/prevhttp://mpvplayer.local:5000/cmd/voluphttp://mpvplayer.local:5000/cmd/voldown
TEST 5.1 — Each command works via browser
Each URL in the browser should return a small JSON response like:
{"paused": false, "status": "ok", "volume": 70}And you should see/hear the corresponding action on the TV.
1.6 Step 6 — Set up auto-start on boot
Parts needed: SSH connection
1.6.1 Tasks
sudo nano /etc/systemd/system/mp4player.service[Unit]
Description=Elderly MP4 Player Server
After=network.target
[Service]
User=pi
WorkingDirectory=/home/pi/mp4player/B-Engines
ExecStart=/usr/bin/python3 /home/pi/mp4player/B-Engines/remote_server.py
Restart=always
RestartSec=5
[Install]
WantedBy=multi-user.targetsudo systemctl daemon-reload
sudo systemctl enable mp4player.service
sudo systemctl start mp4player.servicesudo systemctl status mp4player.servicesudo reboothttp://mpvplayer.local:5000/
TEST 6.1 — Auto-start after reboot
After rebooting, open browser and go to:
http://mpvplayer.local:5000/
Expected: a simple page saying “MP4 Player Remote Server”. This confirms the server started automatically without you doing anything.
TEST 6.2 — Video plays on boot
If you have a video in A-Data/videos/, it should start playing on the TV automatically within ~30 seconds of powering on the Pi with no keyboard or mouse needed.
1.7 Step 7 — Wire the 6 buttons to the Pi
Parts needed: 6 arcade buttons (items 8–11), female-to-female Dupont wires (item 13), Pi in case
1.7.1 GPIO wiring reference
| Button | Color | Pi GPIO pin (BCM) | Also connect to |
|---|---|---|---|
| Play / Pause | GREEN | GPIO 17 (pin 11) | GND (pin 9) |
| Previous | BLUE | GPIO 27 (pin 13) | GND (pin 14) |
| Next | BLUE | GPIO 22 (pin 15) | GND (pin 20) |
| Vol Down | WHITE | GPIO 23 (pin 16) | GND (pin 25) |
| Vol Up | WHITE | GPIO 24 (pin 18) | GND (pin 20) |
| YouTube | RED | GPIO 25 (pin 22) | GND (pin 25) |
Important: Each button has two terminals on the microswitch (the small black box clipped to the button). One terminal gets the GPIO wire, the other gets a GND wire. The orientation does not matter — either terminal can be either wire.
1.7.2 Tasks
TEST 7.1 — Each button triggers the correct action
With the Pi running, press each button one at a time and watch the TV:
- Green → video pauses / resumes
- Left Blue → goes to previous video
- Right Blue → goes to next video
- White (left) → volume decreases
- White (right) → volume increases
- Red → YouTube playlist starts
Check the log file to confirm button presses are registered:
ls ~/mp4player/C-Results/
cat ~/mp4player/C-Results/remote-server-*.txt | tail -20You should see [DEBUG] Received command: lines for each button press.
1.8 Step 8 — Mount Pi box behind the TV
Parts needed: Pi in assembled box, micro-HDMI cable, power supply, USB SD card reader (item 6), 128GB media microSD (item 5)
1.8.1 Tasks
# Find the mount path of the USB card reader
lsblk
# It is usually something like /media/pi/YOURCARD/videos
# Update VIDEO_DIR in remote_server.py accordinglyTEST 8.1 — Full system test from power-on
- Power off the Pi completely (unplug power).
- Wait 10 seconds.
- Plug power back in.
- Watch the TV — within 60 seconds, the first video should start playing automatically.
- No keyboard, no mouse, no login prompt — just video.
This is the final Pi build test. If this passes, the Pi box is complete.
2 Part 2 — ESP32 Wireless Remote
ESP32 Build — handheld wireless remote
This section installs the Arduino IDE, programs the ESP32, wires the buttons, and assembles the handheld remote box.
2.1 Step 9 — Install Arduino IDE on your laptop
Parts needed: Your laptop, USB-A to USB-C cable (item 24)
2.1.1 Tasks
https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_index.json
TEST 9.1 — Board installed correctly
Go to Tools → Board — you should see “ESP32 Dev Module” listed and selected with a checkmark.
2.2 Step 10 — Edit and upload the ESP32 sketch
Parts needed: ESP32 board, USB-A to USB-C cable (item 24), laptop with Arduino IDE
2.2.1 Tasks
const char* WIFI_SSID = "YourWiFiName"; // your home WiFi network name
const char* WIFI_PASSWORD = "YourWiFiPassword"; // your home WiFi password
const char* PI_IP = "192.168.x.x"; // your Pi's local IP addressFinding your Pi’s IP address: In your SSH session on the Pi, type hostname -I — it will show something like 192.168.1.50. Use that number.
TEST 10.1 — ESP32 connects to WiFi
In the Serial Monitor you should see:
[DEBUG] ESP32 Remote booting...
[DEBUG] Connecting to WiFi: YourWiFiName
.....
[DEBUG] Connected! ESP32 IP: 192.168.x.x
And the small LED on the ESP32 board should blink 3 times.
If you see dots continuing for more than 20 seconds without connecting, double-check the WiFi name and password (they are case-sensitive).
2.3 Step 11 — Wire the 6 buttons to the ESP32
Parts needed: 6 arcade buttons (item 15), Dupont wires, ESP32 board, breadboard (item 23) for testing first
2.3.2 Tasks
[DEBUG] Button: PLAY/PAUSE (GPIO 13)
[DEBUG] Sending: http://192.168.x.x:5000/cmd/play
[DEBUG] Response code: 200
TEST 11.1 — All 6 buttons work wirelessly
With the Pi running and the remote wired, press each button and verify:
- Green → TV video pauses or resumes
- Left Blue → previous video plays on TV
- Right Blue → next video plays on TV
- Left White → volume decreases (watch OSD on TV)
- Right White → volume increases
- Red → YouTube starts playing
Range test: Walk to the far end of the room and press buttons — they should still work. WiFi range in a typical home is 30–50 ft through walls.
2.4 Step 12 — Wire battery power and assemble remote box
Parts needed: 3×AA battery holder with switch (item 16), AA batteries (item 17), remote enclosure box (item 18), rubber feet (item 19)
2.4.1 Tasks
TEST 12.1 — Battery power works
- Turn the remote switch to ON.
- LED blinks 3 times = connected.
- Press every button — all 6 should work.
- Turn switch to OFF — LED goes dark.
- Turn back ON — blinks 3 times again within ~5 seconds.
TEST 12.2 — Fully wireless end-to-end test
- Power off and unplug everything.
- Plug the Pi back in — wait 60 seconds for boot.
- Video starts playing on TV automatically.
- Turn the remote switch ON.
- Use only the remote buttons to control the player — no laptop, no keyboard, no phone.
If this test passes, the build is complete.
3 Part 3 — Maintenance & Troubleshooting
3.1 Adding new videos
3.1.1 How to add new MP4 files
3.2 Adding YouTube favorites
3.2.1 How to add YouTube URLs
nano ~/mp4player/A-Data/youtube.txthttps://www.youtube.com/watch?v=XXXXXXXXXXX
https://www.youtube.com/watch?v=YYYYYYYYYYY
sudo systemctl restart mp4player.service3.3 Common problems
| Problem | Most likely cause | Fix |
|---|---|---|
| TV shows no picture | Wrong HDMI input selected | Press TV’s INPUT button and cycle through inputs |
| Video does not start on boot | Service not running | SSH in and run sudo systemctl status mp4player.service |
| Remote button does nothing | WiFi disconnected | Check LED on ESP32 — if not lit, turn switch off/on |
| Remote LED blinks 2x on press | Pi server not reachable | Confirm Pi is powered on and IP address has not changed |
| No sound | TV volume or wrong audio output | Check TV volume; also try amixer set Master 80% via SSH |
| Video plays but is jerky | File format not H.264 | Convert the video using HandBrake to H.264 MP4 |