BalenaDash and Pi4 90 degree rotate

Hello,
I am trying to rotate BalenaDash 90 degrees and having no luck. I was wondering if anyone has been able to successfully rotated their Pi4. After reading https://www.raspberrypi.org/documentation/configuration/config-txt/video.md I noticed that you must use xrandr command “https://www.raspberrypi.org/documentation/configuration/display_rotation.md” When trying to use command in HostOS getting message “command not found” and from kiosk message “can’t open display”. I have tried setting Device Variable as well but no luck. Any info would be greatly appreciated.
HostOS: [balenaOS 2.53.12+rev1]
Pi4
Application: BalenaDash

Thank you,
Ray

Hi Ray, what are you using as display? What is the device variable you are setting?

Have you tried the instructions in the balena dash repo? https://github.com/balenalabs/balena-dash#official-raspberry-pi-7-inch-display

Hello pipex,
I have the Pi4 connected to a 19’’ TV via hdmi. I have tried several device variable.
RESIN_HOST_CONFIG_display_hdmi_rotate=1
BALENA_HOST_CONFIG_video=HDMI-A-1:1360x768M@60,rotate=90

Hi again. Just to check that the configuration is being applied correctly. When you set RESIN_HOST_CONFIG_display_hdmi_rotate=1 do you see the variable appearing in /mnt/boot/config.txt?

Yes I have verified it’s in the config.txt file

Thanks for your reply. I have asked with our engineers and apparently there are some issues for display rotation on the PI4 unrelated to our OS.

Could you try one last thing? Could you try setting the variable ROTATE_DISPLAY to left or right (depending on your screen rotation) for the kiosk service and see if that changes the orientation? This should internally call the xrandr command you mentioned earlier.

So tried and worked for couple seconds. I comment out “dtoverlay=vc4-kms-v3d” in /mnt/boot/config.txt
and added RESIN_HOST_CONFIG_display_hdmi_rotate=1 System rebooted rotated 90 degrees but couple seconds rebooted again and it added back the dtoverlay in config.txt file. I removed in Device Config but still in the config.txt

Yes, One second

Well that somewhat works. It rotated it however only half screen is displaying

Ok, thanks for your reply. I think this probably warrants a bit more investigation. Could you create a Github issue in https://github.com/balenalabs/balena-dash/issues including your setup and the tests you have performed?

Also make sure to share with us if you find something that works.

Sorry, before you create an issue. Can you try one last thing?

  • Make sure you have removed the display_hdmi_rotate variable. Apparently this hangs the video driver on the PI4
  • Set the ROTATE_DISPLAY variable to left or right on the kiosk service
  • Set the WINDOW_SIZE variable for the kiosk service to the right resolution for the orientation, so if your display is 1920x1080, you should set it to 1080,1920

Let me know how that works for you

1 Like

Hello pipex,
You all are awesome! Adding the WINDOW_SIZE fixed it and looks great. Thank you again for your help.

-Ray

Great to hear that worked! I’ll pass your message along :slight_smile: