Our fire brigade wants to use a software that gives them details about their fire run. Unfortunately the softare is Windows only and runs on a vserver in the server room. Two displays will be mounted in the hall where the fire trucks are as well as in the locker room so that they can see all the details while preparing.
My idea was to use a VNC server on the Windows machine in the server room an a RaspberryPi as VNC client mounted to the backside of each TV.
Because I had some touble getting the system up and running, I decided to document the project here (I maybe extend this article from time to time as the system evolves).
Edit 2017-01-31: Edited the article to make it a detailed HowTo
Windows server π
We run a Proxmox setup that enables us to run several vservers on the physical server, this was straight forward, so I don’t go into the details here. One vserver is a normal Windows 10 Pro installation that runs Feuersoftware Einsatz Monitor and a UltraVNC server .
The Einsatz Monitor runs in fullscreen, that screen is set to a resolution of 1920x1080 and should be transmitted to the TV later on.
The only thing I’ve set in the VNC server is the two passwords for remote control and view only, but we will only use the view only mode later on.
Hardware π
We decided to use the following components:
- RaspberryPi 3 Model B
- SanDisk 32GB Class 10 Micro SD Card
- Sharkoon HDMI Kabel 1m 4K
- Samsung UE-40J5250
- S-Impuls Wandhalterung
- goobay Netzteil fΓΌr Raspberry Pi 1-3 3,1A
Raspberry PI setup π
1. Raspbian π
I’ve downloaded the latest Raspbian Stretch Lite from raspberrypi.org and unziped the image. Then I installed etcher and used that to flash the image onto the micro SD card.
2. Activate SSH π
To activate SSH, I simply created an empty file on the micro SD card named ssh. This will enable the SSH server when the Raspberry PI boots.
3. IP address of the PI π
To get the IP address that your DHCP server assigned to the raspberry PI, you either log into the webinterface of your router and look it up there or you use for example nmap:
|
|
Note that you need to adjust the IP range to what your router is configured to.
4. SSH into the PI π
Use putty (or even better kitty ) when on Windows and of course ssh if on Linux/Mac.
|
|
5. Configure the Raspberry PI π
We start with sudo raspi-config
- Change User password -> Choos a new password for the user pi
- Network Options -> Hostname -> Set a hostname for the pi, in our case alarmmonitor-fahrzeughalle
- Advanced -> Expand Filesystem
Then reboot the PI with sudo reboot
and login again after a few seconds using the new password
You can check the effect of the expand filesystem command by using the df -h
command:
|
|
You see that /dev/root
is now the aproximate size of your SD card.
Now continue with sudo raspi-config
- Localisation -> Change locale -> de_DE.UTF-8 UTF-8 -> OK -> default de_DE.UTF-8
- Localisation -> Change timezone -> Europe -> Berlin
For sure you can choose the locale and timezone that fits for you.
Reboot again.
6. Update and Upgrade π
Use the following two commands to update and upgrade.
|
|
7. Install packets π
Install the necessary packages.
|
|
8. Edit Xwrapper.config π
Edit the Xwrapper.config with sudo vim /etc/X11/Xwrapper.config
and set allowed_users=anybody
. (If you need help using vim, take a look at
this tutorial
)
9. Create .xinitrc π
Create a .xinitrc
in the home directory of your pi user with sudo vim ~/.xinitrc
and past the following lines into said file:
|
|
Modify the "Password123"
according to what is set in your UltraVNC server settings and the IP in the same line to the IP of that machine.
10. Create xinit-login.service π
Create a xinit-login.service
file with sudo vim /etc/systemd/system/xinit-login.service
and paste following lines:
|
|
Now enable and start the just created file with these commands:
|
|
11. CEC control π
To control the TV remote via a script, we need
VNC client π
I installed xtightvncclient
(sudo apt-get install xtightvncclient
) and mad a shell script to start the connection:
|
|
“ViewOnlyPassword!1!” is the password configured on the VNC server, 192.168.1.10 is the IP of the Windows Server.
It took me quiet a while to figure out how to pass the password to the VNC client, so that was pitfall number 1. Then I noticed that th screen hat black borders of about 30mm and the VNC image was cut off at the bottom and on the right side.
First I thought that it was configuration fuckup of th VNC server but that wasn’t the case.
Screen resolution π
fbset
showd me that the resolution of the framebuffer was 1824x984 which seemed odd to me because I had set the screen resolution to 1920x1080 via raspi-config
.
The solution was to edit /boot/config.txt
:
|
|
disable_overscan=1
mad the black border disappear, framebuffer_width=1920
and framebuffer_height=1080
mad the framebuffer resolution 1920x1080 so that nothing of the screen got cut off.
hdmi_group=1
and hdmi_mode=16
are responsible for the HDMI resolution of 1920x1080 60Hz, these were set by raspi-config
.
CEC controling the TV π
And finally I wanted to control the TV power state by CEC commands via HDMI. I made two more shell scripts for turn on and standby:
|
|
|
|
First these scripts didn’t work for me, the solution was to enable CEC in the TV settings (Samsung calls it Anynet+)
In Menu -> System -> Anynet+ (HDMI-CEC)
, I enabled both options, If I only enable the first on I can turn the TV on but not off.