├── README.md ├── aws-ssm └── README.md ├── kiosk ├── README.md ├── kiosk.service └── kiosk.sh └── time └── README.md /README.md: -------------------------------------------------------------------------------- 1 | # Raspberry Pi Dashboards 2 | 3 | There are a few Raspberry Pi dashboards (a.k.a 'radiators') around the office - a Raspberry Pi 4 | hooked up to a spare monitor, showing useful information to the team, but there can be a few 5 | hiccups getting them going, here's a guide you might find useful. 6 | 7 | ## Setting up the Raspbian operating system 8 | ![raspbian_logo](https://user-images.githubusercontent.com/52038/30706646-f012e490-9ef0-11e7-8be0-dca3524fbd0e.png) 9 | 10 | There any many custom operating systems for the Raspberry Pi, including [FullPageOS](https://github.com/guysoft/FullPageOS) 11 | (sadly currently distributed over insecure HTTP) which are tuned for dashboard/kiosk use, but it turns out that the default 12 | [Raspbian](https://www.raspberrypi.org/downloads/raspbian/) operating system can work fine for these purposes 13 | (mostly because of Chromium support for 'kiosk mode'). 14 | 15 | ### Getting on to the network 16 | 17 | Getting onto the Guest network is easy, and might be sufficient for you, if you can set your dashboards 18 | up right (eg. using Librato's shareable read-only dashboard links, aka [_Shared Spaces_](https://www.librato.com/docs/kb/visualize/faq/shared_spaces/)). Note that you won't be able to SSH into the Raspberry Pi across networks. 19 | 20 | For further details on networking, and how to get on to the _internal_ network, see [this doc](https://docs.google.com/a/guardian.co.uk/document/d/1n8rKaCxa_eAgKSbsAhuX3Q9cxy72zgQIMGMjo9cZ6tw/edit?usp=sharing). 21 | 22 | ### Clock time! 23 | 24 | _or: why does the Raspberry Pi think this HTTPS certificate is invalid?!?_ 25 | 26 | Raspberry Pi computers don't come with a battery-backed clock, so when they turn on they 27 | have no idea what the time is - they have to connect to an [NTP server](https://en.wikipedia.org/wiki/Network_Time_Protocol) 28 | in order to find out what the time is. Here in the Guardian offices, we've mysteriously 29 | seen Raspberry Pi devices fail to do this - because of network or firewall reasons? - 30 | and so they don't know the correct time, and when they try to visit HTTPS pages 31 | they declare the certificate invalid because it seems to have been signed in the future! 32 | 33 | One way of getting round this problem is to add a [battery-backed clock](https://shop.pimoroni.com/products/adafruit-pirtc-pcf8523-real-time-clock-for-raspberry-pi) 34 | to the Raspberry Pi. We've done this successfully on the Data Technology team, there's a small 35 | bit of configuration to get it working but after that it's one less thing to worry about! 36 | 37 | ![raspberrypibatterybackedclock](https://user-images.githubusercontent.com/52038/30706462-503a4d64-9ef0-11e7-8987-e2ef56bb6e8c.jpg) 38 | 39 | ## Setting up Chromium in kiosk mode 40 | 41 | There are several good references for this, including: 42 | 43 | * https://github.com/elalemanyo/raspberry-pi-kiosk-screen#chromium-browser 44 | 45 | nano ~/.config/lxsession/LXDE-pi/autostart 46 | -------------------------------------------------------------------------------- /aws-ssm/README.md: -------------------------------------------------------------------------------- 1 | # Administering a Raspberry Pi with AWS Systems Manager 2 | 3 | We use ssm (particularly https://github.com/guardian/ssm-scala) for remote shell 4 | access to our EC2 instances, as an alternative to `ssh` that has better user & 5 | credential management, and we can actually do the same thing with the 6 | Raspberry Pi computers that we host within the building. This can be convenient 7 | if, for instance the Raspberry Pi is physically hard to get to (the Ophan one is 8 | stored down in the basement), or isn't connected to a keyboard/mouse itself. 9 | 10 | This blog post by Amazon tells you it can be done... 11 | 12 | https://aws.amazon.com/blogs/mt/manage-raspberry-pi-devices-using-aws-systems-manager/ 13 | 14 | ...but there are a couple of places where you'll need to modify the instructions. 15 | 16 | ``` 17 | $ aws ssm create-activation --profile ophan --default-instance-name SomeRPiName --iam-role SSMServiceRole --registration-limit 1 --region eu-west-1 18 | ``` 19 | -------------------------------------------------------------------------------- /kiosk/README.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | https://pimylifeup.com/raspberry-pi-kiosk/ 4 | 5 | The version of Chromium in Raspbian currently has uBlock Origin enabled - 6 | this seems to block XHR requests like 7 | https://dashboard.ophan.co.uk/graph/pageviews/data , which means the graph 8 | lines won't show. 9 | 10 | Disable uBlock Origin to get the graph working again. 11 | 12 | See https://arcanesciencelab.wordpress.com/2020/04/11/disable-chromium-update-dialog-on-raspbian-buster/ 13 | for information on how to disable the persistent Chromium-update dialog. 14 | -------------------------------------------------------------------------------- /kiosk/kiosk.service: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description=Chromium Kiosk 3 | Wants=graphical.target 4 | After=graphical.target 5 | 6 | [Service] 7 | Environment=DISPLAY=:0 8 | Environment=XAUTHORITY=/home/pi/.Xauthority 9 | Type=simple 10 | ExecStart=/bin/bash /home/pi/kiosk.sh 11 | Restart=on-abort 12 | User=pi 13 | Group=pi 14 | 15 | [Install] 16 | WantedBy=graphical.target 17 | -------------------------------------------------------------------------------- /kiosk/kiosk.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | xset s noblank 3 | xset s off 4 | xset -dpms 5 | 6 | unclutter -idle 0.5 -root & 7 | 8 | sed -i 's/"exited_cleanly":false/"exited_cleanly":true/' /home/pi/.config/chromium/Default/Preferences 9 | sed -i 's/"exit_type":"Crashed"/"exit_type":"Normal"/' /home/pi/.config/chromium/Default/Preferences 10 | 11 | /usr/bin/chromium-browser --noerrdialogs --disable-infobars --no-default-browser-check --kiosk https://www.theguardian.com/uk & 12 | 13 | while true; do # as soon as this script exits, the browser window will be killed... 14 | sleep 10 15 | done 16 | -------------------------------------------------------------------------------- /time/README.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | This is a great guide on configuring the hardware-based Real Time Clock (RTC) 5 | that you can add on to the GPIO pins of the Raspberry Pi: 6 | 7 | https://pimylifeup.com/raspberry-pi-rtc/ 8 | 9 | 10 | 11 | If the RPi can't reach NTP servers, you could try `htpdate` 12 | --------------------------------------------------------------------------------