Module C - Test Paper
Module C - Test Paper
Hardware
● Raspberry Pi 4 Model B 8GB
● 1x BME280 Environmental Sensor (I2C Connectivity, Address 0x76 or 0x77)
● 2x MAX7219, 8 character, 7 segment displays (SPI Connectivity, Port 0, Device 0)
○ Note: These devices are chained together where the output of the first is the input
of the second
● 1x SSD1351 based 128x128 RGB OLED display (SPI Connectivity, Port 1, Device 0)
Hardware access
● Access is configured via the Management UI located at https://ws.netlabs.xyz/login
● Competitors will have received their login username & password by email
● Competitors must upload a valid OpenSSH format SSH Key, these can be obtained from
○ Linux/Mac/WSL ssh-keygen then copied from ~/.ssh/id_rsa.pub
○ Copied from PuttyGen on Windows (Must be in OpenSSH authorized_keys format)
● Once a valid key has been added to the account the competitors will be able to reserve a
node from the hardware cluster, this node will be picked at random by the management
system and a base image of “Raspberry Pi OS Lite” with some minor required changes
applied
○ Users SSH Keys added
○ Apt repository modified to local mirror
○ Hostname configured to be unique on network
○ Password authentication disabled on SSH (SSH Keys are required)
○ Boot config modified to enable SPI0, SPI1, I2C
● All access to the competitors node will be via SSH
○ For ports other than SSH(22), SSH tunneling is required, an example of this is
available on the ManagementUI
Tasks
1. Download and extract the folder of country flags located at
a. https://ws.netlabs.xyz/flags.zip => /opt/flags.zip
b. flags.zip should be extracted to /opt/flags/
c. Create a new service called “oled-flag” and configure to display your countries
flag on the attached OLED display after booting up
i. This should require no interaction to run/start at boot
d. Note: Red and Blue channels may be switched, this will not be penalised
3. Create a startup service that displays the current time and cycles through the readings
from the bme280 script on the attached 7segment displays
a. An example video of this is available at
https://www.youtube.com/watch?v=T-EEsQTD8SU
b. This service should start at boot time with no interaction required by the user
7. Create a SystemD timer to insert the data from the bme280 sensor into the new InfluxDB
measurement named bme280 every minute
a. The fields for this should also be
i. “temp” in degrees Celsius
ii. “pressure” in millibar
iii. “humidity” in %
8. Configure Grafana to show the data from the readings:bme280 measurement in a new
dashboard named “Local Sensor”
a. This dashboard should have 2 panels
i. Temperature & Pressure data
ii. Temperature & Humidity data
b. Configure an alert on the Temperature & Humidity panel to raise an alert when
iii. Temperature is > 20°c
iv. Temperature is < 10°c
v. Humidity is > 60%
vi. Humidity is < 40%
c. This should be a POST webhook alert with the URL of
○ https://ws.netlabs.xyz/alerts