3

I am working on a project at a company where I read the temperature of a machine with a raspberry pi. I have downloaded the necessary program and can use it through Wine.

In addition, I have made a python script that takes a screenshot of the screen every 10 seconds, cuts out the necessary cells, reads these values and saves them in a csv file.

Now I want to keep the raspberry pi there for several weeks to read the machine during this period. So far I have only tested it with a monitor and the program worked perfectly. Then I thought if I pull out the HDMI cable now, the program will continue to run and I can connect it to the machine. But when I pulled out the HDMI cable, the program no longer recognized a screen and only black screenshots were made.

Is there a way I can make the raspberry pi think that there is a monitor connected so that it continues to take screenshots of the program?

Niels
  • 31
  • 1

2 Answers2

2

The Pi4 differs from earlier models in that there is no default resolution. No monitor - no screen.

You can't capture a screen for a computer which doesn't have a screen.

There are a number of potential solutions.

Create a virtual screen - any VNC server has the ability to do this.

RealVNC (included in Raspberry Pi OS) can either share the monitor screen or create a virtual screen. There is an option in raspi-config to set default VNC resolution which creates a screen with or without a monitor.

You can certainly view the virtual screen on a remote machine. I do this routinely and can view the same screen on monitor or remotely. Whether you can capture without a connection I don't know.

Frankly capturing a screenshot seems a poor way to capture data.

Milliways
  • 62,573
  • 32
  • 113
  • 225
1

You can also buy a 'fake HDMI dongle' i.e. at aliexpress for less than USD$ 2. The dongle plugs into an HDMI port and simulates a non-existing display with a given resolution.

Nevertheless, I fully share @Milliways opinion that screenshot is a poor way to capture data.

Romy
  • 11
  • 2