Verified Commit 2feb6686 authored by Jakob Moser's avatar Jakob Moser
Browse files

Reformat files, remove one redundant line

parent 1a41f0c3
Loading
Loading
Loading
Loading
+23 −23
Original line number Diff line number Diff line
@@ -7,20 +7,20 @@ Maintainer: Jakob Moser <moser@cl.uni-heidelberg.de>
### Base Image

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
    - 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.
    - 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
@@ -30,7 +30,7 @@ Maintainer: Jakob Moser <moser@cl.uni-heidelberg.de>
Connect female-female cables to the RC522 module:

| Pin  | Color     |
| ---- | -------- |
| ---- | --------- |
| VCC  | 🩶 Gray   |
| RST  | 💜 Purple |
| GND  | 💙 Blue   |
@@ -54,9 +54,9 @@ Then, connect the cables to the Pi as described in this chart:
2. Go to “Interface Options”
3. Go to “SPI”
4. Enable it (no reboot necessary)
   * This will enable the first SPI bus (SPI0)
    - This will enable the first SPI bus (SPI0)
5. Add the line `dtoverlay=spi1-1cs,cs0_pin=16` somewhere in `/boot/firmware/config.txt` (reboot might be necessary here)
   * This will enable the second SPI bus (SPI1). Furthermore, it will set the Chip Select pin for device 0 (`cs0`) to GPIO 16.
    - This will enable the second SPI bus (SPI1). Furthermore, it will set the Chip Select pin for device 0 (`cs0`) to GPIO 16.

<details>
<summary>Links</summary>
@@ -75,8 +75,8 @@ Then, connect the cables to the Pi as described in this chart:
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`)
    - 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:

@@ -113,14 +113,14 @@ Then, connect the cables to the Pi as described in this chart:
<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):
- You can create a hotspot (which will create more or less the same config as seen above using):

    ```bash
    sudo nmcli dev wifi hotspot ifname wlan1 ssid PoolPayPi password $PASSWORD
    ```

* 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.
- 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>

@@ -132,15 +132,15 @@ Then, connect the cables to the Pi as described in this chart:
    ```ini
    dtoverlay=fbtft,spi0-0,ili9486,width=320,height=480,regwidth=16,reset_pin=25,dc_pin=24,rotate=270
    ```

3. Add `fbcon=map:2` at the end of the line to `/boot/firmware/cmdline.txt`
   * This will tell the framebuffer console (fbcon) to map all its terminals to `/dev/fb2` (which doesn't exist), i.e. don't show a Linux TTY on the display
    - This will tell the framebuffer console (fbcon) to map all its terminals to `/dev/fb2` (which doesn't exist), i.e. don't show a Linux TTY on the display

<details>
<summary>Links</summary>

- [Raspberry Pi Forum post mentioning the line to include in the config (German)](https://forum-raspberrypi.de/forum/thread/55290-displays-mit-spi-anschluss-unter-raspberry-pi-os-bullseye-bookworm/)
- [Python pygame fails to output to /dev/fb1 on a Raspberry Pi + TFT screen](https://stackoverflow.com/a/54986161/)
CC BY-SA 4.0 (https://creativecommons.org/licenses/by-sa/4.0/)
- [Device tree overlays README](https://github.com/raspberrypi/firmware/blob/master/boot/overlays/README)
- [RB-TFT3.5 Manual (German)](https://joy-it.net/files/files/Produkte/RB-TFT3.5/RB-TFT-Anleitung_04082020.pdf)
- [Frame Buffer Kernel Docs](https://www.kernel.org/doc/html/latest/fb/fbcon.html)
@@ -157,8 +157,8 @@ sudo apt install cryptsetup

Create a user account called `poolpay`. Equip it with the necessary permissions:

* Allow `poolpay` to access GPIO
* Allow `poolpay` to use `sudo` **to use `luks`** (don't give it general sudo access)!
- Allow `poolpay` to access GPIO
- Allow `poolpay` to use `sudo` **to use `luks`** (don't give it general sudo access)!

Create a folder `/coli`, cd into it and make sure the permissions are correct.

+3 −3
Original line number Diff line number Diff line
@@ -4,8 +4,8 @@

I currently want to avoid having to start an X Server or Wayland, mostly because:

* I am afraid they will introduce additional ways to escape my application.
* They will likely add additional complexity I don't need.
- I am afraid they will introduce additional ways to escape my application.
- They will likely add additional complexity I don't need.

This means we will likely even use **Raspberry Pi OS Lite**, because if we don't need an X Server or a desktop environment, why install it?

@@ -14,7 +14,7 @@ This means we will likely even use **Raspberry Pi OS Lite**, because if we don't
1. Create extra user (without `sudo` etc.) for login
2. Configure auto login for that user (there should be official documentation on that)
3. Change shell to the Python app
   * For 2. and 3., see [`autologin.md`](autologin.md) for details
    - For 2. and 3., see [`autologin.md`](autologin.md) for details
4. Build a terminal-based Python app (e.g. with Textualize)

## Autostart via systemd unit
+2 −2
Original line number Diff line number Diff line
@@ -17,8 +17,8 @@ python3 -m poolpay.card id

We want to extract the following data:

* 7 byte UID of the card (see MF0ICU1 data sheet, section 1.2.1)
* Complete user Read/Write area
- 7 byte UID of the card (see MF0ICU1 data sheet, section 1.2.1)
- Complete user Read/Write area

As a reference we use the NXP TagInfo smartphone app. We want to extract everything in the “Full Scan” → “Memory Content” section.

+1 −1

File changed.

Contains only whitespace changes.