Commit 5c1c68a1 authored by Dorian Zedler's avatar Dorian Zedler

added detailed setup instructions for the basestation raspi

parent e4be9483
......@@ -4,6 +4,7 @@ body_classes: 'title-center title-h1h2'
taxonomy:
category: docs
---
# Overview
* The Base Station is a small pyramid-like Box that houses two speakers and a small computer (Raspberry Pi).
* Its job is to manage the whole race, including the extensions.
......@@ -28,4 +29,91 @@ taxonomy:
![baseStation (.jpg)](/images/baseStation.jpg?cropResize=200,200&classes=js-lazy-loaded,float-left#left)
# Setup
- Flash the [latest version of raspbian](https://downloads.raspberrypi.org/raspbian_latest) to a sdcard
- Create an empty file called "ssh" on the "boot" partition of the sdcard
- Attach the Pi to your network, boot it up, find out its ip address and login to it via ssh
- Configure the ScStwAp wifi hotspot as explained [here](https://www.raspberrypi.org/documentation/configuration/wireless/access-point.md) (no need to Add routing and masquerade)
- Setup the rtc module as explained [here](https://tutorials-raspberrypi.de/raspberry-pi-rtc-modul-i2c-echtzeituhr/)
- Install Qt on the Pi as explained [here](https://mechatronicsblog.com/cross-compile-and-deploy-qt-5-12-for-raspberry-pi/)
- Use the RasPi profile and Qt Creator to compile the base station code and deploy it to the pi
- enable GPIO access in the raspi-config
- install wiringpi and omxplayer
```
sudo apt install wiringpi omxplayer
```
- Use the RasPi profile and Qt Creator to compile the ScStwMonitor code and deploy it to the pi
- install xserver
```
sudo apt install xserver-xorg xinit xserver-xorg-video-fbdev x11-xserver-utils
```
- Create the file /home/pi/speed_climbing_stopwatch/start.sh with content
```
#!/bin/bash
parent_path=$( cd "$(dirname "${BASH_SOURCE[0]}")" ; pwd -P )
cd "$parent_path"
function doScStwUpdate {
# check if there is a new version available
UPDATE_FILE=./bin/speed_climbing_stopwatch_basestation-update.zip
if [ -f "$UPDATE_FILE" ]; then
echo "UPDATE FOUND"
# check if a backup of the old version is still present
OLD_VER_DIR=./bin.old
if [ -d "$OLD_VER_DIR" ]; then
echo "DELETING OLD BACKUP"
rm -r "$OLD_VER_DIR"
fi
# move the new version archive out of the bin dir
mv ./bin/speed_climbing_stopwatch_basestation-update.zip ./
# backup the old version
mv ./bin "$OLD_VER_DIR"
# create dir for new version
mkdir ./bin
# move the new version archive there and unpack it
mv speed_climbing_stopwatch_basestation-update.zip ./bin
unzip ./bin/speed_climbing_stopwatch_basestation-update.zip -d ./bin
# remove the new version archive
rm ./bin/speed_climbing_stopwatch_basestation-update.zip
echo "UPDATE DONE"
fi
}
doScStwUpdate
sudo LD_LIBRARY_PATH=./bin/ ./bin/speed_climbing_stopwatch_basestation
```
- Create the file /home/pi/StartScStw.sh with content:
```
#!/bin/bash
sudo /home/pi/speed_climbing_stopwatch_basestation/start.sh &
sudo xinit /home/pi/ScStwMonitor/start.sh &
```
- Create the file /home/pi/ScStwMonitor/bin/start.sh with content:
```
#!/bin/bash
parent_path=$( cd "$(dirname "${BASH_SOURCE[0]}")" ; pwd -P )
cd "$parent_path"
sudo xset s off
sudo xset -dpms
sudo xset s noblank
./bin/ScStwMonitor -platform xcb
```
- Add to /etc/rc.local to auto start everything:
```
sudo /home/pi/StartScStw.sh
```
- \[optional\] configure custom splash screen as explained [here](https://www.raspberrypi.org/forums/viewtopic.php?t=231288)
- note: append 'fbcon=map:2' to the end of /boot/cmdline.txt
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment