0

I'm using my raspi as a mini meteo station which (for now) only measure humidity and temperature, and I want it to display those infos on a little screen. Considering technologies I can handle, the appropriate way would be to launch a web browser in full screen, pointing to a localhost project.

Basically, I'm trying to reproduce something like this or this.

The screen is connected on the HDMI port and I'm connecting to the rpi by SSH (KiTTY for Windows 10). Since I only installed some GUI packages (mostly xorg and openbox I think) on a headless rpi, it boots on the CLI which displays perfectly on the screen. I use my rpi as a server and for some hobbyist domotic so installing a full GUI environment would be an overkill. Besides, I know this can be done and I'd like to improve my little understanding of the rpi's linux.

After hours of research, I came to launch the following script with the command startx ~/my_project/start_chromium.sh.

start_chromium.sh:

#!/bin/sh
export DISPLAY=:0
chromium-browser --app=http://localhost --start-fullscreen

Despite the browser successfully displaying my HTML hello world, I have two big problems here:

  1. this only works if I run the script from the rpi CLI (I plugged a keyboard to try), and not from the SSH, even with sudo (it says that parse_vt_settings: Cannot open /dev/tty0 (Permission denied)). I still can stop it with pkill x from the SSH though. I'm logged as pi on both Pi and SSH.

  2. the window only takes half the screen width but all the available height. I uncommented hdmi_safe=1 in /boot/config.txt and rebooted, and the windows was full-screen, but with a crappy little resolution. I'm not sure it comes from chromium or some lower-level windows managing.

I installed quite a bunch of packages (I cannot remember the whole list) during my research of a solution so I hope it didn't mess around the config, but I'm a bit scared to lose other stuff if I restart from scratch.

ADDITIONAL INFO: (with links that didn't really helped me, but it could be because I don't really know everything I am doing)

  • exec openbox throws the message "Openbox-Message: Failed to open the display from the DISPLAY environment variable" like here and event reboot the CLI (.bash_profile is ran). If I run this after the startx call it only adds a top bar to my chromium windows.

  • sudo Xorg -configure lists 8 video drivers and says that there is "No devices to configure. Configuration failed" like here. There is no /etc/X11/xorg.conf file.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.