Skip to content

Instantly share code, notes, and snippets.

@jordigg
Last active August 29, 2023 12:54
Show Gist options
  • Save jordigg/30bf20eaa23f2746d9eb8eebd05fd546 to your computer and use it in GitHub Desktop.
Save jordigg/30bf20eaa23f2746d9eb8eebd05fd546 to your computer and use it in GitHub Desktop.
Setup dasboards using raspberryPi, chromium and VNC server for remote support

Raspberry pi dashboard

This is what we did to setup a few dashboards at Improbable

Chrome on kiosk mode: http://raspberrypi.stackexchange.com/questions/40631/setting-up-a-kiosk-with-chromium

You'll need

  • Raspberry Pi
  • Dashing Service
  • Wifi stick (optional)

Preparing the system

We'll install raspbian into our SD card. You can follow instructions from here http://www.raspberrypi.org/downloads

Expanding the disk

sudo raspi-config

Setting up NTP

This will sync the time time with ubuntu ntp server

sudo apt-get install ntpdate
sudo ntpdate -u ntp.ubuntu.com

Update the OS

sudo apt-get update
sudo apt-get upgrade
sudo apt-get dist-upgrade

Updating the Firmware

sudo rpi-update

Install required software

sudo apt-get install matchbox x11-xserver-utils ttf-mscorefonts-installer xwit sqlite3 libnss3

Configure your monitor resolution

Find the TV supported modes, here I search for 1920x1080 60hz. That is hdmi_mode=16 on the hdmi_group=1 Select the group depending on the results of the supported modes

tvservice -d edid
edidparser edid

Add this to the /boot/config.txt file

hdmi_group=1    # CEA=1, DMT=2
hdmi_mode=16
disable_overscan=1

Also we want to disable overscan to prevent black lines on the edges of the screen. This may produce that your images gets cropped. The best solution is disable overscan in the tv. Check the display menu options (it may be called "just scan", "screen fit", "HD size", "full pixel", "unscaled", "dot by dot", "native" or "1:1)

Configure wifi (optional)

Via command line or just use the GUI

sudo nano /etc/wpa_supplicant/wpa_supplicant.conf

network={
    ssid="SSID"
    psk="password"
}
sudo ifdown wlan0
sudo ifup wlan

Start the browser on boot

Installation of libgcrypt11 on Debian Linux 8 ( Jessie ) 64-bit

wget http://ftp.acc.umu.se/mirror/cdimage/snapshot/Debian/pool/main/libg/libgcrypt11/libgcrypt11_1.5.3-5_armhf.deb

sudo dpkg -i libgcrypt11_1.5.3-5_armhf.deb

Installation of Chromium browser 48

https://launchpad.net/ubuntu/vivid/armhf/chromium-browser/

# Download chromium package
wget http://launchpadlibrarian.net/234969703/chromium-browser_48.0.2564.82-0ubuntu0.15.04.1.1193_armhf.deb

https://launchpad.net/ubuntu/vivid/armhf/chromium-codecs-ffmpeg-extra/

# Download ffmpeg extra package
wget http://launchpadlibrarian.net/234969705/chromium-codecs-ffmpeg-extra_48.0.2564.82-0ubuntu0.15.04.1.1193_armhf.deb
# Install Packages
sudo dpkg -i chromium-codecs-ffmpeg-extra_48.0.2564.82-0ubuntu0.15.04.1.1193_armhf.deb \ 
	chromium-browser_48.0.2564.82-0ubuntu0.15.04.1.1193_armhf.deb

Boot script via lxsession autostart

nano .config/lxsession/LXDE-pi/autostart

@lxpanel --profile LXDE-pi
@pcmanfm --desktop --profile LXDE-pi
@xset s off
@xset -dpms
@xset s noblank
@chromium-browser --kiosk --disable-session-crashed-bubble --disable-infobars https://www.google.com #use full screen mode instead of kios if needed with --start-fullscreen

sudo nano /etc/lightdm/lightdm.conf

# don't sleep the screen
xserver-command=X -s 0 dpms

Install VNC Service

# Install x11server
apt-get install x11-xserver
# Select a vnc password
x11vnc -storepasswd
# Add xvncserver to autostart
nano /home/pi/.config/autostart/x11vnc.desktop
# With the following content
[Desktop Entry]
Encoding=UTF-8
Type=Application
Name=X11VNC
Exec=x11vnc -forever -usepw -display :0 -ultrafilexfer
StartupNotify=false
Terminal=false
Hidden=false
# Reboot and try it out. TighVNC client works great.
sudo reboot

Turn off automatically (Optional)

I wanted to be able to turn on and off the tv using the CEC standard via HDMI, but the tv we bought wasn't CEC compilant :(
One alternative was to turn of the HDMI signal with a cronjob and set the tv to auto turn off after a few minutes without signal.
But the power coming from the USB port stops flowing when the tv is off so I'd prefer to shut down the PI from a cronjob.

Add it to the root cronjob service running sudo crontab -e and adding

0       20      *       *       1,2,3,4,5 /sbin/shutdown -h now

More useful comands

Change hostname and root password

Change hostname and root password via sudo raspi-config

Create user

sudo useradd foo Create user foo

Change user password

passwd foo Change password for user foo

Add user to a group

adduser foo sudo Adds user to sudo group

References

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment