Trying to display picture on Raspberry Pi with fbi ... doesn't really work

1.7k Views Asked by At

I can show videos all day with omxplayer, no problem. Showing a simple jpeg, apparently is rocket science. I've spent days with fbi library and it doesn't work very well. I'm running buster raspbian (and same issues on stretch raspbian) and programming in Python.

Simple: I want to display picture for an arbitrary amount of time then either show another or return the display to normal. No such luck.

sudo fbi -T 2 -a --noverbose -1 -t 30 foo.png

I do this with:

subprocess.Popen().

I use:

"-T 2" 

because it is HDMI. If I don't do -1 and run fbi again, bad news. It appears to cache each image and will display each again like I'm building a playlist. But if I do "-1" it will not block but will insist on showing the image for the full -t time (30 secs above). There seems to be no way to "send" it a keyboard key to quit before the -t time. I can use the physical keyboard. Since it doesn't block, you'd think I could always do a

"sudo killall -9 fbi"

but doing so while an image is still on the screen freezes the image there.

So any other python library or shell command for display an image? Anyway to get this fbi to actually work?? Thanks much!!

1

There are 1 best solutions below

0
On

Try using "feh",

something like:

feh --hide-pointer -x -q -B black -g 1280x800 "image.jpg"

with subprocess.Popen or os.system

Or if you want to use only fbi, with python,

Use:

import os

and then use os.system in front of the code you are using, works with python code.

Something like this has worked for me:

os.system('sudo fbi -a /dev/fb0 --noverbose -T 2 image.png')