# poorBird — a guide for using it *Deutsche Fassung: [`README.USER.de.md`](README.USER.de.md)* This guide is for **using** poorBird, not for building it. It assumes you can follow a copy-and-paste command in a terminal, and nothing else. Every term that matters is explained where it first appears. --- ## 1. What it actually does You hang a small camera near a bird feeder. It watches the feeder with a **radar sensor** — not a camera-based motion detector, but a module that sends out a harmless radio signal and notices when something moves in front of it. When a bird arrives, the camera takes a burst of photos and sends them over your home network to a small computer indoors. That computer stores the photos and shows them to you in a web page where you can look through them and write down which bird you saw. **Why radar and not a normal motion sensor?** A classic motion sensor (the kind in an outdoor lamp) reacts to warmth. It fires when the sun comes out, when warm air moves, when a branch sways. Radar sees actual movement and also reports *how far away* it was and *how strong* the movement was — which is enough to tell "a bird landed on the perch" from "the hedge moved in the wind". It also works through a plastic housing, so the sensor stays dry. **Three pieces, and each can fail independently:** | Piece | What it is | Where it lives | |---|---|---| | The camera | A small circuit board with a lens and the radar sensor | Outdoors, at the feeder | | The server | A program storing photos and answering the website | A small computer indoors, always on | | The website | The gallery you look at | Your browser | The camera keeps nothing for long. Photos live on the server, so if the camera breaks or is stolen, everything already uploaded is safe. --- ## 2. What you need before you start - The **server** set up and running. That is a separate, more technical job: [`../server/deploy/INSTALL.md`](../server/deploy/INSTALL.md). - An **account**. There is no "sign up" button anywhere, on purpose — see below. - A browser on the same network. ### There is no sign-up, and no default password Many devices ship with a built-in login like `admin` / `admin`. That is a back door: everyone knows it, and most people never change it. poorBird has no such account. A person with access to the server has to create yours deliberately: ```bash poorbird user add yourname --role admin ``` It asks for a password, then prints a long line starting with `otpauth://`. **Scan that line into an authenticator app before you continue.** An authenticator app (Google Authenticator, Aegis, 1Password, and others) shows a six-digit code that changes every 30 seconds. You will need one of those codes every time you sign in. **The line is shown once and never again.** If you lose it, nobody can recover it and the account cannot be repaired — there is currently no command to remove or re-arm the second factor. If you genuinely do not want the six-digit code, add `--no-totp`. It will warn you. It is a reasonable choice on a home network that nobody else can reach, and a bad one otherwise. **Three kinds of account**, so that not everyone can change everything: | Role | Can | |---|---| | `viewer` | Look at photos | | `editor` | Look, and label what it sees | | `admin` | All of that, plus the Devices and System pages | The cameras themselves are *not* accounts and never appear in this list. They identify themselves a different way and cannot log into the website. --- ## 3. Signing in Open the address of your server in a browser. You get a login form asking for your username, your password, and — if your account has one — the six-digit code from your authenticator app. If the code is refused, check your phone's clock. These codes are generated from the current time, so a phone that is a minute off produces codes the server considers wrong. A few seconds out is fine; the server accepts the code before and after the current one. **A wrong password and a username that does not exist give exactly the same message.** That is deliberate: telling you "no such user" would let a stranger work out which usernames exist. Repeated failed attempts are slowed down. This is limited **per network address, not per username** — on purpose, because limiting by username would let anyone lock you out of your own account just by guessing at it. You stay signed in for **two weeks** by default, then have to sign in again. "Sign out" takes effect immediately, because the session is deleted on the server rather than merely forgotten by the browser — there is no window in which an old login still works. It ends the session **in that browser only**, though. If you are also signed in on your phone, that stays signed in. Changing the password (`poorbird user passwd`) is what ends every session for that account at once. --- ## 4. Using the gallery The main page is a grid of thumbnails, newest first. Scroll and older photos load automatically; there are no page numbers. > Only the tiles you can actually see exist in the browser. This sounds like a > detail but it is the reason the page stays usable: a busy feeder can produce > thousands of photos a day, and a browser asked to hold a year of them at > once simply stops responding. **Click a photo** to see it full size with its details beside it. In that view: | Key | Does | |---|---| | `→` | Next photo | | `←` | Previous photo | | `Esc` | Back to the grid | Use the keyboard. Labelling a day of photos is look-decide-next a few hundred times, and that is tiring with a mouse. The arrows stop at the last photo loaded so far rather than showing you an empty frame while more arrive. Scroll the grid a little further and they continue. ### Filters Above the grid you can narrow things down by date range, by camera, and by three yes/no questions: **kept**, **reviewed**, and **pre-trigger**. Each of those is a three-way choice — *any*, *yes*, *no* — not a checkbox. A checkbox can only say "kept" or "don't care", and "show me only the ones I rejected" is a question you will want to ask. Changing a filter starts the list again from the top. It does not add to what was already on screen. **"Pre-trigger" needs explaining.** The camera is always quietly taking pictures into a small buffer it keeps overwriting. When the radar fires, it sends the couple of frames from *just before* the trigger as well. Those are often the best ones — a bird landing rather than a bird already sitting. They are marked so you know the radar had not fired yet when they were taken. ### What the details mean - **Received** — when the server got the photo. This is the timestamp the system trusts. - **Taken** — when the camera thinks it took the photo. It may say **"not synced"**: the camera has no battery-backed clock, so after a power cut it does not know the time until it can ask. It reports that honestly instead of claiming 1 January 1970, which is what a naive system shows. - **Distance / energy** — what the radar measured: how far away, and how strong the movement. - **Burst 2 of 5** — photos arrive in bursts. This is the second of five. - **A "prediction" badge** on a species means *the computer guessed*, not that a person identified it. Automatic identification does not exist yet; when it does, its guesses stay marked. The labels you write are training material for it, and a guess quietly mixed in with confirmed labels would poison that. ### Missing thumbnails A photo whose small preview has not been generated yet shows a placeholder instead of a broken image. The previews are made by a background program (the "worker"). If placeholders do not disappear, that program is probably not running. ### Themes and language Top right: three colour schemes (light, dark, and a dark blue) and two languages (German, English). Both are remembered in your browser. They are not yet tied to your account, so a different browser starts from the default. --- ## 5. Commands you may need Run these where the server is installed. `poorbird` is the program. | Command | Does | |---|---| | `poorbird check` | **Run this first when something is wrong.** Checks the settings, the database and the folders, and explains what it finds without starting anything. | | `poorbird user add NAME --role admin` | Create an account | | `poorbird user list` | Show accounts and whether each uses a six-digit code | | `poorbird user passwd NAME` | Set a new password. Also signs that person out everywhere. | | `poorbird serve` | Run the website's server part | | `poorbird worker` | Run the background program that makes thumbnails | | `poorbird migrate` | Bring the database structure up to date after an update | | `poorbird seed --captures 500` | Invent 500 fake photos, to try the gallery without waiting for birds | | `poorbird seed --clear` | Delete those fake photos again | `seed --clear` only ever removes invented data. It is restricted to the fake camera it created, so a real camera's photos are never at risk. There is a test that puts a real camera alongside the fake one and checks it survives. --- ## 6. Settings Settings live in one file, `/etc/poorbird/poorbird.env`, one `NAME=value` per line. The program is restarted to pick up a change: ```bash sudo systemctl restart poorbird-api poorbird-worker ``` The full file with the reasoning is [`../server/deploy/poorbird.env.example`](../server/deploy/poorbird.env.example). In plain language: ### The ones you must set | Setting | Meaning | |---|---| | `POORBIRD_DATABASE_URL` | Where the database is and the password to reach it. **No default** — the program refuses to start rather than guess, and it also refuses if you copied the example and left `CHANGE_ME` in place. | | `POORBIRD_ENROLL_SECRET` | A shared password the cameras use to introduce themselves the very first time. Make one with `openssl rand -hex 32`. | > **Do not change `POORBIRD_ENROLL_SECRET` casually.** It is built into the > camera's own software as a last-resort way back in if the camera can no > longer be reached. Changing it here without also updating the camera removes > that escape hatch — and a camera mounted outside is hard to reach. ### Where files go | Setting | Meaning | |---|---| | `POORBIRD_IMAGE_ROOT` | The full-size photos. Default `/srv/poorbird/images`. | | `POORBIRD_THUMB_ROOT` | The small previews. Default `/srv/poorbird/thumbs`. | | `POORBIRD_STATE_DIR` | Internal bookkeeping. Default `/var/lib/poorbird`. | These two must stay next to each other, named `images` and `thumbs`, in the same parent folder. The web server reads them from there. `poorbird check` tells you if they have drifted apart, because the symptom otherwise is photos that mysteriously fail to load with nothing written in any log. **Photos are never handed out straight from the folder.** Every request is checked against your login first, and only then are the bytes sent. A photo's address being hard to guess is not protection. ### The two that trip everyone up | Setting | Meaning | |---|---| | `POORBIRD_SESSION_COOKIE_SECURE` | Leave `true`. Set `false` **only** if you are reaching the site over plain `http://` instead of `https://`. | | `POORBIRD_SERVE_IMAGES_DIRECTLY` | Leave `false`. `true` is for a developer's machine only. | The first one matters because of a browser rule: a cookie marked "secure" is thrown away over an unencrypted connection. The browser does not warn, the login reports success, and you simply are not signed in — with nothing in any log to explain it. If you ever see "login worked but I'm not signed in", this is why. The second changes *who reads the photo off the disk* — the main program, or the web server in front of it. The web server is far better at it. **It does not change the permission check**: the same check runs either way. ### Rarely touched | Setting | Meaning | Default | |---|---|---| | `POORBIRD_SESSION_LIFETIME_H` | How long you stay signed in, in hours | `336` (two weeks) | | `POORBIRD_RATE_LIMIT_ENABLED` | Slow down repeated failed logins and flooding cameras | `true` | | `POORBIRD_API_HOST` / `_PORT` | Where the program listens. It should stay reachable only from the machine itself; the web server in front handles the outside world. | `127.0.0.1`, and set `8090` in the example file | | `POORBIRD_DB_POOL_SIZE` / `_MAX_OVERFLOW` | How many database connections it may open at once | `15` / `10` | | `POORBIRD_WORKER_POLL_INTERVAL_S` | How long the background program waits before checking for new work when there is none. It does *not* slow down work already waiting. | `5` | | `POORBIRD_JOB_MAX_ATTEMPTS` | How many times to retry a failed background job | `3` | | `POORBIRD_LOG_LEVEL` | How chatty the log is | `INFO` | | `POORBIRD_LOG_FORMAT` | `text` to read by eye, `json` for log-collecting tools | `text` | | `POORBIRD_DB_ECHO` | Print every database query. Debugging only; very noisy. | `false` | --- ## 7. When something is wrong **Start with `poorbird check`.** It is built to answer "is this machine set up correctly" and to explain, not just to fail. | Symptom | Most likely | |---|---| | Login says success, but you are not signed in | `POORBIRD_SESSION_COOKIE_SECURE=true` while using plain `http://`. See above. | | The website says it cannot reach the server | The `poorbird serve` program is not running. | | The page loads but the grid is empty | No photos yet. Try `poorbird seed --captures 500` to confirm the gallery itself works. | | Thumbnails stay as placeholders | The `poorbird worker` program is not running. | | Photos fail to load, nothing in the log | `images` and `thumbs` are not siblings where the web server expects. `poorbird check`. | | The six-digit code is refused | Your phone's clock is off. | | The login form rejects you repeatedly, then stops responding | Rate limiting. Wait, then try once, carefully. | | Refreshing on a page like `/devices` gives "not found" | The web server's configuration is missing the rule that sends unknown paths back to the gallery. It is the `try_files` line in the Caddyfile, installed in `INSTALL.md` step 6. | ### Two things to know before you trust it **There are no backups yet.** Nothing in poorBird copies your photos anywhere. If that disk fails, the photos are gone. This is planned work, not an oversight, but until it exists: do not let photos you would miss pile up here as their only copy. **The camera has never run on real hardware**, and the server has never run outside a developer's machine. Everything described here works — there are 308 automated tests and the gallery has been used against 500 photos — but "works on a desk" and "works on a pole in the rain for a year" are different claims. --- ## 8. Privacy, briefly The camera talks to your server over your own network in plain, unencrypted form. This is a deliberate trade: encryption on a device this small means a certificate baked into its software, and a camera that silently stops uploading when that certificate is replaced — while it is mounted on a pole. Anyone already on your home network could therefore see the uploads. Your own browsing of the gallery *is* encrypted, and needs a login. Nothing is sent anywhere else. There is no cloud service, no account elsewhere, and no automatic sharing. The photos are on your disk and nowhere else — which is also why the missing backup is worth taking seriously.