shurui91
Posts: 7
Joined: Wed Jan 22, 2014 8:11 am

Using Pi as a remote slideshow player

Wed Jan 22, 2014 8:20 am

I am developing a project using Pi. One of the objects is using Pi to display image slideshow on a TV in the lobby of my building. I read some articles about using fbi or pqiv, I don't think either of these two options work. The reason is, once the Pi is being hooked to the TV, it needs to stay there (since I use scp to keep images up-to-date directly from a server) and ideally I can remotely control the Pi using something like PuTTY to update images, reboot or etc. Both fbi and pqiv commands need to be typed in on the Pi command line, it won't work when I type those commands in PuTTY.

Hopefully anyone can help me with a better solution.
Thanks!

Ant232
Posts: 115
Joined: Thu Jul 12, 2012 9:34 pm

Re: Using Pi as a remote slideshow player

Wed Jan 22, 2014 9:04 pm

Hi,

Try using

fbi -T 1 (and then the rest of you command)

The -T 1 should let you start it from putty.

Ant

shurui91
Posts: 7
Joined: Wed Jan 22, 2014 8:11 am

Re: Using Pi as a remote slideshow player

Wed Jan 22, 2014 10:09 pm

Hi! I will give a try on this command. Mind telling me what does T do in this command? And what number 1 does in this command?

Thanks!
Ant232 wrote:Hi,

Try using

fbi -T 1 (and then the rest of you command)

The -T 1 should let you start it from putty.

Ant

Ant232
Posts: 115
Joined: Thu Jul 12, 2012 9:34 pm

Re: Using Pi as a remote slideshow player

Wed Jan 22, 2014 11:08 pm

To be honest I don't really know. Maybe as a guess the T might mean which termial to run it from where 0 would be the Pi itself and 1 would be the SSH session.
It's just a guess though.

Ant232
Posts: 115
Joined: Thu Jul 12, 2012 9:34 pm

Re: Using Pi as a remote slideshow player

Wed Jan 22, 2014 11:09 pm

It did work for me though..

User avatar
AndyD
Posts: 2334
Joined: Sat Jan 21, 2012 8:13 am
Location: Melbourne, Australia
Contact: Website

Re: Using Pi as a remote slideshow player

Thu Jan 23, 2014 12:27 am

If you run fbi -help you get a list of command line options:-

Code: Select all

-T  -vt <arg>           start on virtual console <arg>
Edit: so -T 1 will start on virtual console 1.

shurui91
Posts: 7
Joined: Wed Jan 22, 2014 8:11 am

Re: Using Pi as a remote slideshow player

Thu Jan 23, 2014 3:21 am

I tried with this command

Code: Select all

fbi -T 1 -noverbose -t 10 /home/pi/Dev/cron/*.png
Then I got an error,

Code: Select all

ioctl VT_ACTIVATE: Operation not permitted

shurui91
Posts: 7
Joined: Wed Jan 22, 2014 8:11 am

Re: Using Pi as a remote slideshow player

Thu Jan 23, 2014 3:26 am

Ant232 wrote:It did work for me though..
I got an error, ioctl vt_activate operation not permitted

User avatar
AndyD
Posts: 2334
Joined: Sat Jan 21, 2012 8:13 am
Location: Melbourne, Australia
Contact: Website

Re: Using Pi as a remote slideshow player

Thu Jan 23, 2014 3:31 am

I suspect it is a permission problem. When no one is logged in on the console all the ttys belong to root. Try running your command using sudo to see if it works.

shurui91
Posts: 7
Joined: Wed Jan 22, 2014 8:11 am

Re: Using Pi as a remote slideshow player

Thu Jan 23, 2014 3:35 am

AndyD wrote:I suspect it is a permission problem. When no one is logged in on the console all the ttys belong to root. Try running your command using sudo to see if it works.
Yes, sudo works.
One more question, how do I remotely stop the slideshow via PuTTY? I didn't see this command from the help menu.

Ant232
Posts: 115
Joined: Thu Jul 12, 2012 9:34 pm

Re: Using Pi as a remote slideshow player

Thu Jan 23, 2014 8:12 am

It might not be a very elegant way but you can

sudo pkill fbi

The above will kill any fbi process running.

shurui91
Posts: 7
Joined: Wed Jan 22, 2014 8:11 am

Re: Using Pi as a remote slideshow player

Tue Feb 11, 2014 3:34 am

If I use a cronjob to update the list of images I want to display, does fbi auto restart the slideshow as long as it finds newer images?

Ant232
Posts: 115
Joined: Thu Jul 12, 2012 9:34 pm

Re: Using Pi as a remote slideshow player

Tue Feb 11, 2014 6:46 am

I don't think it does. You might have to put in a second cronjob to restart fbi after the files have been updated.

shurui91
Posts: 7
Joined: Wed Jan 22, 2014 8:11 am

Re: Using Pi as a remote slideshow player

Mon Apr 21, 2014 11:21 pm

I did some upgrade on this project. I made it so that once there is any new images come in, the fbi will restart the slideshow by itself. But it doesn't stop the previous one, there are more than one slideshow playing on the screen. So my question is, is there any fbi command that I can use to first stop any previous slideshow?

pbrunson
Posts: 2
Joined: Tue Jan 07, 2014 9:40 pm

Re: Using Pi as a remote slideshow player

Sat Apr 26, 2014 5:51 pm

I have a script that I use to start and stop FBI with different settings. It is controlled by cron jobs. every hour for 15 mins to shows weather images I create with a perl script just before they are shown. and at night 11:30pm it turn off FBI and the monitor and turns them back on in the morning. To stop FBI I use 'killall fbi' works great.

Here is my script.

#!/bin/bash

show_photos () {
fbi -d /dev/fb0 -T 1 --comments -noverbose -u -a -t 15 /fileserver/DPF01/*
exit 0
}

show_wx () {
fbi -noverbose -d /dev/fb0 -T 1 --comments -a -t 10 /weather/DPFWx/* /weather/DPFWx2/*
exit 0
}

case "$1" in
photos|"")
killall fbi
show_photos
;;
weather)
killall fbi
show_wx
;;
wx)
killall fbi
show_wx
killall fbi
show_photos
;;
start)
show_photos
;;
stop)
killall fbi
;;
bedtime)
killall fbi
/opt/vc/bin/tvservice -o
;;
wakeup)
killall fbi
/opt/vc/bin/tvservice -p
fbset -depth 32; fbset -depth 16
export DISPLAY=:0.0
show_photos
;;
*|?|help|h)
echo "Usage: example [photos|wx|weather|stop|bedtime|wakeup]" >&2
exit 3
''
esac
:

steveb4pi
Posts: 62
Joined: Sun Aug 11, 2013 6:12 pm

Re: Using Pi as a remote slideshow player

Wed Nov 19, 2014 11:29 am

fbi won't :-
run in the background (if you 'loop' it, it has to be in the foreground, so your script 'stops' on the fbi command)
accept images via stdin (or via any sort of 'pipe')
clear up after itself (if you run if with a single image you 'get back focus' and the image stays 'on screen' - if you run it again, it swaps out the image on screen BUT it uses more RAM .. if you run it 50 times (to show 50 different images) the Pi will crash with 'insufficient RAM')

So here's my 'fix' to get fbi to show 'arbitrary' images (and 'pause' a fbi slideshow) = I expect my 'cunning trick' with soft links (alias) will help you ..

I will set fbi to 'loop for ever' showing 3 'static' image names, d.jpg, a1.jpg, a2.jpg (see note at end)
Make a1.jpg and a2.jpg both 'alias' of d.jpg (ln -s -f d.jpg a1.jpg, ln -s -f d.jpg a1.jpg)

When you want to 'display a new image', make d.img an alias of the new image (ln -s -f new.jpg d.jpg)
(so my slide show will 'pause' as the 'display a new image' (background task) checks for a button push before changing the alias to a new image)

NOTE. fbi has to be started with (at least) 3 images, since even with -chachemem 0, fbi will 'cache' 2 images (and thus never load the 'change')
eg. fbi -d /dec/fb0 -a -noverbose -t 3 -cahcemem 0 d.jpg a1.jpg a2.jpg
(with -t I set it to run 'for ever' on a 3 second cycle over the 3 images - so changing d.jpg should result in the new iamge appearing within 1s)

NB don't be tempted to COPY new.jpg to d.jpg (fbi will show 'corrupted' data on screen as the file it's in the process of loading is overwritten by the cp)

Whilst this 'seamlessly' changes from one image to the next, I still have a problem with fbi crashing (may be due to feeding it an 'undispayable' image = I'm just looping through a dir listing )

User avatar
RaTTuS
Posts: 10559
Joined: Tue Nov 29, 2011 11:12 am
Location: North West UK
Contact: Twitter YouTube

Re: Using Pi as a remote slideshow player

Wed Nov 19, 2014 11:43 am

if you have the links on a RAM disk then you will not cause excessive wear to the SD card ;)
How To ask Questions :- http://www.catb.org/esr/faqs/smart-questions.html
WARNING - some parts of this post may be erroneous YMMV

1QC43qbL5FySu2Pi51vGqKqxy3UiJgukSX
Covfefe

Return to “Graphics, sound and multimedia”