2

This question already has an answer here:

I'm working on a small project and I need my raspberry pi (model 2B, rev a01041) to send a very simple image to a little screen (probably 10x5cm).

Unfortunately, I've always thought I'd never have the use of a screen so it is installed and configured in headless mode, accessed by WiFi SSH connection (using Kitty, a Putty-like Windows application).

How could I send a refreshable image to the HDMI-connected device?

I'm thinking of a light web browser and a simple HTML interface but have no clue where to find info.

EDIT1: i tried installing the gui (pixel), but controlling it with SSH is a lot harder than I thought. All I can find is about X11 forwarding, which is the opposite of what I'm looking for.

EDIT2: i also tried pygame, which is very interesting but would require me building the GUI in python which is not exactly what I want.

Somewhat related but only answered for NodeJS (which I don't know well): Show HTML from HDMI

marked as duplicate by Milliways, joan, goldilocks Jun 1 at 10:37

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

1

You can run the X server without the desktop, which then appears as a featureless black screen. Although there is no taskbar or menus, you can still start applications remotely (to do this via you need to set the $DISPLAY environment variable properly first), and/or at startup.

> export DISPLAY=0.0

If there is only one instance of the X server running, that should be the correct value. You probably don't want X to run by default since this will be prone to drag in a lot of stuff such as the GUI login, so keep the systemd target multi-user, not graphical. If you are starting from Raspbian lite that's how it will be.

You then need to create a file, .xinitrc in the home directory of the user you wish to run the X server as. To start the server from ssh:

> startx &

This may not work for a non-root user, although there should be a solution to that. You will get a brief bit of output then it will go to the background (unless you forget &).

If all you want is a static image like a jpeg, the ImageMagick package (apt install imagemagick) includes display; this doesn't require a desktop environment and if you use -window root it sets the background, i.e., the image will fill the screen. If you don't want to do that there's a lot of controls, see man display.


Even easier than that would be to use fbi, which displays images on the kernel framebuffer without X; apt install fbi and then browse questions here tagged fbi (such as the duplicate).

For more information about all this generally, look around for creating a kiosk tutorials.

  • Wow, this is gold to me! I'll probably use webkit2png or similar so I can use fbi on the output, does it sound right to you? – Dan Chaltiel Jun 2 at 8:46
  • Hadn't heard of that one but it looks appropriate if you want to use html/css to design and then convert it to a static image. I don't do a lot of graphical stuff but that is probably easier and more dynamic than putting it together in gimp/photoshop. – goldilocks Jun 2 at 12:30
-4

You could try editing the raspberry pi config. To enter use ssh, this means that you login to your router and find your pi (named raspberrypi by default) and copy the ip address.

If you are a Windows user:

  • Open PowerShell by right clicking on the start and click PowerShell,
  • Type ssh <username - default is pi>@<name of pi - default is raspberrypi> <ip address>
  • Then enter Config by sudo raspi-config
  • Locate screen boot options and then select autologin with graphics, enter, reboot and you should get some screen if the operating system of raspbian is NOT the basic.

If you are a Mac/Linux user:

  • Open terminal,
  • Type ssh <username - default is pi>@<name of pi - default is raspberrypi> <ip address>
  • Then enter Config by sudo raspi-config
  • Locate screen boot options and then select autologin with graphics, enter, reboot and you should get some screen if the operating system of raspbian is NOT the basic.

I hope this helps and I interpreted this right!

  • 3
    Thanks for trying to help but this is absolutely not what I'm talking about. I want to build an image and display it on a screen connected to the Pi by HDMI. – Dan Chaltiel May 30 at 15:42

Not the answer you're looking for? Browse other questions tagged or ask your own question.