virtual console id changes after display power cycle

52 Views Asked by At

I am building a raspberry pi powered display. The display is a 5inch led display connected by hdmi to the rpi which is running the current linux lite version. The monitor powers up when a pir detects motion in the room, the display stays live for 5mins then powers off. When active the display will cycle through a set of images.

So I am powering up and down the console when a pir sensor detects movement in the room using..

tvservice -p

and...

tvservice -o

This all works very well. However following a display power cycle I have found that the virtual console id changes, and the command to display an image fails. So for instance this command to show this image, works once, but not following another display power cycle.

sudo fbi -ad --noverbose /dev/fb0  -T 1  /home/pi/images/flowers.png 

And I have to change it to

sudo fbi -ad --noverbose /dev/fb0  -T 2  /home/pi/images/flowers.png 

to get the image to display.

Can you suggest a simple way to rectify this? Thanks

1

There are 1 best solutions below

0
On

So I discovered that its easiest to use the vcgencmd command for controlling screen power. This always powers up and restarts the desktop state correctly.