Photo slideshow to projector on boot using RPi 1

August 4, 2024, 09:05

nick06259

Hi there, I have an old RPi 1 and an old Sanyo projector with VGA in and I'd like to project a photo slideshow for a family event this coming weekend. It's something I've been wanting to do for a while but never got around to it. I'm not an expert by any measure so would maybe need my hand held a bit but how would I go about doing this? I'm thinking something that runs on boot with the media on a USB drive, a male HDMI > female VGA plug from the RPi to a VGA lead and into the projector. Is a version 1 even capable of this and does anyone have any easy to follow guides on how to do it and do you guys have any recommendations for a lightweight OS that can be run headless and accessed via SSH when needed? Thanks! Nick. PS, I am OK with using Docker.

oops.se

HDMI is digital VGA is analogue So your envision will not work. There is USB to VGA "graphic cards but not all is Linux compatible so you need to check that. The other route you could take is to use the composite video but as you haven't stated the model that could also be a no go.

matthewmojo1806

Right, so you would need to grab a HDMI to VGA adapter, and a USB drive. I would reccommend to use Raspberry Pi OS Lite since it is lightweight and works pretty decently on older hardware like the Pi1. Flash the SD card and enable SSH. Update the pi with sudo apt-get update sudo apt-get upgrade and install feh (image viewer) with sudo apt-get install feh. Copy your photos onto the USB drive (for the sake of this im going to say the path is
/media/usb/photos
and put it into the Pi. Normally the Pi will mount under
/media/pi
but if it doenst you can mount it with sudo mount /dev/sda1 /media/usb. Create a script to run the slideshow on boot: nano ~/start_slideshow.sh Add this to the script: #!/bin/bash feh --fullscreen --slideshow-delay 5 - randomize /media/usb/photos then makeit an executable chmod +x ~/start_slideshow.sh. Configure the Pi to run it on boot by editing the ~/.bashrc file with nano ~/.bashrc and add this to the end of the file
if [ "$(tty)" == "/dev/tty1" ]; then
    ~/start_slideshow.sh
fi
reboot the Pi with sudo reboot. If the display looks a bit funky you might nede to adjust the HDMI settings. The following will set the resolutionto 1024x768:
hdmi_group=2
hdmi_mode=16
Then you can make the Pi accessable via ssh with ssh pi@<raspberry_pi_ip>. The default username is pi, and the default password is raspberry. Make sure to name and order the photos correctly if your not randomising, and enjoy 👍

nick06259

Hi, thanks for this. Apologies, I should have been clearer - this is an adapter from The Pi Hut, so this will work.🙂

nick06259

Yay! Thank you so much for putting the time into writing this up for me, sounds like exactly what I need. many thanks for answering all of my questions here, this is this evening's project for sure!

oops.se

Ok, I have seen similar from BlackBox.

matthewmojo1806

All good mate

nick06259

OK, I think i have followed everything correctly but it boots to a login prompt. What might I have made a mess of here?

nick06259

Lemme have a look at things and I'll give some more details...

nick06259

OK, it looks like the usb drive is not being mounted on boot. Here's the terminal output: ls /media/usb gives an empty prompt, so nothing there. ls /dev/usb gives: ls: cannot access '/dev/usb': No such file or directory

oops.se

How does the mount command look like?

nick06259

Looks like its mounting it: sudo mount /dev/sda1 /media/usb returns:
mount: (hint) your fstab has been modified, but systemd still uses the old version; use 'systemctl daemon-reload' to reload.
then: systemctl daemon-reload returns:
==== AUTHENTICATING FOR org.freedesktop.systemd1.reload-daemon ====
Authentication is required to reload the systemd state.
Authenticating as: ,,, (nick)
Password: 
==== AUTHENTICATION COMPLETE ====
And I now see the content that wasn't there before:
ls /media/usb/photos/
awning.JPG  fabric_to_replace.JPG  IMG_2152.jpeg  IMG_4625.JPG  jd.jpeg
If I reboot, ls /media/usb/photos returns an empty prompt. Thanks, Nick.

oops.se

output from lsblk ?

nick06259

I have a usb hub, usb stick 64 GB) and the SD card (8 GB) plugged in:
NAME        MAJ:MIN RM  SIZE RO TYPE MOUNTPOINTS
sda           8:0    1 57.3G  0 disk 
└─sda1        8:1    1 57.3G  0 part /media/usb
mmcblk0     179:0    0  7.5G  0 disk 
├─mmcblk0p1 179:1    0  512M  0 part /boot/firmware
└─mmcblk0p2 179:2    0    7G  0 part /

oops.se

To make the mount permanent you need to add it to /etc/fstab

nick06259

Very many thanks for the super-helpful guide. I screwed a few things up but thankfully realised my mistakes and corrected them. Its mounting at boot now, but still no slideshow.

oops.se

Slideshow how? Web browser, LibreOffice, photo app ?

nick06259

Shouldn't this run on the attched monitor on boot?

oops.se

bashrcis flaky, I would use the local users crontabmethod

matthewmojo1806

you still got the issue w this?

nick06259

Yes, I am in a total muddle with it now.

nick06259

OK, so just some info to hopefully help troubleshooting: USB is mounted:
lsblk -f
NAME        FSTYPE FSVER LABEL     UUID                                 FSAVAIL FSUSE% MOUNTPOINTS
sda                                                                                    
└─sda1      ext4   1.0   USB STICK 5de95c58-91cb-41a3-a5a6-939f5bf8162a   53.2G     0% /mnt/usb/photos
Directory contents are:
/mnt/usb/photos $ ls -l
total 352
-rw-rw-r-- 1 nick nick  13753 Mar  9 17:59 calibration.png
drwx------ 2 root root  16384 Aug  7 02:30 lost+found
-rw-rw-r-- 1 nick nick  77970 Jun  4 16:50 me.png
-rw-rw-r-- 1 nick nick 242531 Jan  7  2024 neil.png
Script location: /home/nick Script content: #!/bin/bash feh --fullscreen --slideshow-delay 5 - randomize /mnt/usb/photos If I run the script manually and from within the folder its stored, I get this:
./start_slideshow.sh
/bin/bash: feh --fullscreen --slideshow-delay 5 - randomize /mnt/usb/photos: No such file or directory
Any other questions then please ask. Thanks, Nick.

oops.se

Just to trouble shoot, place some pictures in your home folder and I hope your script looks like this:
#!/bin/bash
feh --fullscreen --slideshow-delay 5 --randomize /mnt/usb/photos
Note --randomize is missing a dash and have a whitespace to much. And the first row should look like this #!/bin/bash

nick06259

Thank you, <@796000224690307072> - I will look into that as soon as I can and let you know.

nick06259

OK, if I run ./start_slideshow.sh then I get feh ERROR: Can't open X display. It is running, yeah? This happens wherever i have the images stored, /home/nick or on the usb.

matthewmojo1806

I’ll be back home tmr so il help out in a bit

matthewmojo1806

I think I can help you tonight, maybe tomorrow I’m at work at the moment. Don’t know how long I’ll be but I’ll see when I can help

oops.se

If you use Bookworm it uses Wayland, not X

nick06259

Yep, I am using Bookworm.

oops.se

Then you need to change to Bullseye or find a replacement for feh

nick06259

Ah, okay - thanks for that, I'll see if I can install Bullseye. Appreciated.

matthewmojo1806

Did bullseye work

matthewmojo1806

If not can you give me a little rundown of what you have done so far and what the issues you are facing are? Would really appreciate 👍

oops.se

fehis a X windows application and the current OS version "Bookworm" uses Wayland. So going back to the "Bullseye" version that uses X could be an alternative or a alternative to fehthat works with Wayland.

matthewmojo1806

Okay okay

matthewmojo1806

<@1026625483938480221> are you still having problems with this?

matthewmojo1806

??

nick06259

Hi guys - sorry but on holiday at the moment so not at home. I’ll post back when I return. Thanks for your help, I do appreciate it.

matthewmojo1806

All good!