Maintainer: Jakob Moser <moser@cl.uni-heidelberg.de>
## Setup
### Raspberry Pi
1. Use the official “Raspberry Pi Imager” to flash an SD card
* Use “Raspberry Pi OS” (the one recommended)
* Use custom OS settings:
* Hostname `poolpaypi`(`.local`)
* Username `jakob`
* Password: Auto-generate a safe one
* Don't setup WiFi
* Timezone: Europe/Berlin
* Keyboard layout: de
* Enable SSH auth via public-key, generate a keypair manually
* Disable telemetry
2. Insert the SD card into the Pi and boot it up
3. On your main computer, use Network Manager (GUI or [CLI](https://ubuntu.com/core/docs/networkmanager/configure-shared-connections)) to enable a “Shared Ethernet” connection
4. Use an ethernet cable to connect the Pi to your main computer
* Your computer should immediately start acting as a “wired hotspot” now and provide IP address and internet access to the Pi.
5. You can now `ssh jakob@poolpaypi.local` on your main computer and it shoud Just Work™.
#### NFC Reader
1. Open `sudo raspi-config`
2. Go to “Interface Options”
3. Go to “SPI”
4. Enable it (no reboot necessary)
<details>
<summary>Further information on enabling SPI</summary>
Enabling SPI will place the line `dtparam=spi=on` in the file `/boot/firmware/config.txt`
</details>
#### Pi as a WiFi hotspot
1. Plug in a WiFi stick (on the Raspberry Pi 3 Model V1.2, I didn't get the internal WiFi to work as a hotspot, however, that seems to be an issue that only I with my specific Pi have)
2. Create a network manager configuration in `/etc/NetworkManager/system-connection/PoolPayPi.nmconnection`, get the following information ...
* The `interface-name` for the stick (`wlan1` if the Pi has built-in wifi, `wlan0` if it hasn't)
* A secure password (Pre-Shared Key, `psk`)
... and insert it into this ready made template, which you then save:
```ini
[connection]
id=PoolPayPi
uuid=a58d13bb-4d84-4b20-8bea-7b061c73ed0c
type=wifi
autoconnect=true
interface-name=wlan0
[wifi]
mode=ap
ssid=PoolPayPi
[wifi-security]
group=ccmp;
key-mgmt=wpa-psk
pairwise=ccmp;
proto=rsn;
psk=PutASecurePasswordHere
[ipv4]
method=shared
address1=10.17.0.1/24,10.17.0.1
[ipv6]
addr-gen-mode=default
method=ignore
[proxy]
```
<details>
<summary>Further information on hotspots</summary>
* You can create a hotspot (which will create more or less the same config as seen above using):
* If you want the hotspot to start on boot, you need to add `autoconnect=true` to the config file (which you can, btw, also do using some `nmcli` command)
* If you use both the WiFi hotspot and the shared ethernet connection (which is easily possible), [one of the connections needs its own IP range](https://askubuntu.com/questions/844913/how-to-control-ip-ranges-of-network-managers-hotspots), otherwise, they will collide.
</details>
### Software
Clone the repository (you can use a Project Access Token for that, Settings → Access Tokens) and cd into it.
```bash
python3 -m venv venv
source venv/bin/activate
pip install-r requirements.txt
```
You can then, for example, run the card interfacing tool using: