5

I'm using fbi to display some images. fbi has some keyboard controls, like +, -, Page Up, Page Down, etc. to control the images.

Instead of using keyboard, I want to send these control commands over SSH to fbi.

I have already tried the following method:

mkfifo /tmp/mycmd
fbi /myfolder/*.jpg < /tmp/mycmd &

After doing so, fbi doesn't start. I try sending some commands like echo . > /tmp/mycmd, but it doesn't start; and gives the following error:

using "DejaVu Sans Mono-16", pixelsize=16.67 file=/usr/share/fonts/truetype/ttf-dejavu/DejaVuSansMono.ttf
ioctl VT_GETSTATE: Inappropriate ioctl for device (not a linux console?)

What is the problem?

How can I send commands to fbi over SSH !?

1
  • Any help is highly appreciated.
    – Omid1989
    Jan 13, 2018 at 14:57

3 Answers 3

7

To display an image, fbi needs access to the TTY. So, you need to use -T 1:

fbi -d /dev/fb0 -T 1 zxcv.png

If you get access /dev/tty1: Permission denied, you can run the command with sudo.

Unfortunately I don't know of any way of sending commands to it. I tried using ttyecho to send things to /dev/tty1 but it caused fbi to crash. Your fifo method didn't seem to work either.

1
  • Didn't work for me sudo fbi -d /dev/fb0 -T 1 02_06_59.jpg. It just returned using "DejaVu Sans Mono-16", pixelsize=16.67 file=/usr/share/fonts/truetype/dejavu/DejaVuSansMono.ttf Jun 13, 2022 at 4:58
1

I had trouble with this too. I changed to virtual terminal 1 and it worked:

# Change to virtual terminal 1
chvt 1

# Make a dummy image with ImageMagick if you need one
magick -size 640x480 xc:red image.jpg

# Display on framebuffer
fbi -d /dev/fb0 -T 1 image.jpg

In case you are having problems, you can check if /dev/fb0 is really your frame buffer and you have write permissions with:

cat /dev/random > /dev/fb0

If your screen gets covered in randomly coloured pixels, you can deduce /dev/fb0 really is your framebuffer.

If you get a "Permission denied" error, try again with:

sudo cat /dev/random > /dev/fb0

and if that works, change the permissions on /dev/fb0 with something like:

sudo chmod 666 /dev/fb0

Or, you can start an elevated bash shell, change permissions and display all in one go:

sudo bash -c "chvt 1; fbi -T 1 -d /dev/fb0 image.jpg"

Or you'll get nothing, in which case you need to ask someone cleverer than me - there are plenty about!

1
  • sudo cat /dev/random > /dev/fb0 cannot work - the opening of the device is done before sudo gets executed.
    – Habbie
    Oct 17, 2022 at 9:24
0

Try using the -d /dev/fb0 option with fbi.

By default, fbi finds the framebuffer device it's supposed to use by looking at which virtual console device it's being used on. Apparently it looks at its standard input for this purpose. When you're redirecting its standard input from a FIFO, it gets a non-console device and cannot proceed. Specifying the framebuffer device to use explicitly might help.

You might even find that as long as you have the necessary permissions to use the framebuffer device, you even won't need the FIFO: just start fbi -d /dev/fb0 /myfolder/*.jpg over the SSH connection, if it suits your purposes.

1
  • Running fbi -d /dev/fb0 /myfolder/*.jpg gives exactly the same error: using "DejaVu Sans Mono-16", pixelsize=16.67 file=/usr/share/fonts/truetype/ttf-dejavu/DejaVuSansMono.ttf ioctl VT_GETSTATE: Inappropriate ioctl for device (not a linux console?)
    – Omid1989
    Jan 14, 2018 at 12:03

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .