|
| 1 | +--- |
| 2 | +title: Sensorbox |
| 3 | +shortTitle: Sensorbox |
| 4 | +metaDescription: Sensorbox is a self-hosted system for building OpenWrt-based Orb sensor images. Pick a supported device, provide your Wi-Fi credentials, and get a ready-to-flash image that continuously monitors your network experience. |
| 5 | +section: sensorbox |
| 6 | +--- |
| 7 | + |
| 8 | +# Sensorbox |
| 9 | + |
| 10 | +Sensorbox is a self-hosted system for building OpenWrt-based Orb sensor images. You run a small web app locally, pick a supported device, provide your Wi-Fi credentials, and customize your install. The result is an SD-card (or eMMC) image that boots into a dedicated, always-on Orb sensor — ready to continuously monitor your network experience. |
| 11 | + |
| 12 | +<img src="../../images/sensorbox/configurator.png" alt="Sensorbox configurator UI" width="560" /> |
| 13 | + |
| 14 | +:::note |
| 15 | +Sensorbox is currently in **beta**. |
| 16 | +::: |
| 17 | + |
| 18 | +## What you'll need |
| 19 | + |
| 20 | +- A supported single-board computer or router (see the [NanoPi Zero2 hardware build](/docs/sensorbox/nanopi-zero2.md) for a worked example). |
| 21 | +- A computer to run Sensorbox and flash the resulting image. The setup below is written for macOS and Linux. |
| 22 | +- [Podman](https://podman.io/) and `podman-compose`. Sensorbox runs on Podman because ASU's build worker spawns one container per build via the Podman API — Docker is not a tested drop-in substitute. |
| 23 | +- An SD card (or eMMC) and a way to flash it: [Raspberry Pi Imager](https://www.raspberrypi.com/software/), [balenaEtcher](https://etcher.balena.io/), or `dd`. |
| 24 | + |
| 25 | +## Step 1: Clone the repository |
| 26 | + |
| 27 | +Sensorbox uses git submodules, so clone recursively: |
| 28 | + |
| 29 | +```bash |
| 30 | +git clone --recurse-submodules git@github.com:orbforge/sensorbox.git |
| 31 | +``` |
| 32 | + |
| 33 | +If you already cloned without `--recurse-submodules`: |
| 34 | + |
| 35 | +```bash |
| 36 | +git submodule update --init |
| 37 | +``` |
| 38 | + |
| 39 | +## Step 2: Install Podman |
| 40 | + |
| 41 | +### macOS |
| 42 | + |
| 43 | +1. Install Podman and the compose wrapper: |
| 44 | + |
| 45 | + ```bash |
| 46 | + brew install podman podman-compose |
| 47 | + ``` |
| 48 | + |
| 49 | + An optional GUI is available with `brew install --cask podman-desktop`. |
| 50 | + |
| 51 | +2. Initialize and start the Podman VM. The resource bumps matter — ASU's ImageBuilder runs will run out of memory or disk on the defaults: |
| 52 | + |
| 53 | + ```bash |
| 54 | + podman machine init --cpus 4 --memory 8192 --disk-size 100 |
| 55 | + podman machine start |
| 56 | + podman info # sanity check |
| 57 | + ``` |
| 58 | + |
| 59 | + :::note |
| 60 | + `--disk-size 100` is a VM ceiling, not preallocated storage. ASU upstream recommends 50 GB minimum, and caches grow over time. |
| 61 | + ::: |
| 62 | + |
| 63 | +3. After reboots or Podman upgrades, restart the VM: |
| 64 | + |
| 65 | + ```bash |
| 66 | + podman machine start |
| 67 | + ``` |
| 68 | + |
| 69 | +### Linux |
| 70 | + |
| 71 | +Install `podman` and `podman-compose` from your distribution, then enable the user socket so the ASU worker can reach it: |
| 72 | + |
| 73 | +```bash |
| 74 | +systemctl --user enable --now podman.socket |
| 75 | +``` |
| 76 | + |
| 77 | +No VM is needed — Podman runs natively. |
| 78 | + |
| 79 | +### Windows |
| 80 | + |
| 81 | +Not yet validated. Podman Desktop supports Windows via WSL2; expect a flow similar to macOS. |
| 82 | + |
| 83 | +## Step 3: Configure |
| 84 | + |
| 85 | +Copy the example environment file: |
| 86 | + |
| 87 | +```bash |
| 88 | +cp .env.example .env |
| 89 | +``` |
| 90 | + |
| 91 | +Edit two values in `.env`: |
| 92 | + |
| 93 | +- **`PUBLIC_PATH`** — set to the absolute path of the `public` directory inside your clone, for example `/Users/<you>/<path-to>/sensorbox/public` on macOS or `/home/<you>/<path-to>/sensorbox/public` on Linux. Then create the subdirectories it expects: |
| 94 | + |
| 95 | + ```bash |
| 96 | + mkdir -p "$PUBLIC_PATH"/{store,logs} |
| 97 | + ``` |
| 98 | + |
| 99 | +- **`CONTAINER_SOCKET_PATH`** — run the command below and paste the result (dropping the `unix://` prefix): |
| 100 | + |
| 101 | + ```bash |
| 102 | + podman info --format '{{.Host.RemoteSocket.Path}}' |
| 103 | + ``` |
| 104 | + |
| 105 | +Leave everything else at its default. |
| 106 | + |
| 107 | +## Step 4: Run the stack |
| 108 | + |
| 109 | +From the repository root: |
| 110 | + |
| 111 | +```bash |
| 112 | +podman-compose up -d |
| 113 | +``` |
| 114 | + |
| 115 | +Open <http://localhost:8080/> in your browser, select your device, and configure your install. The first run pulls the ASU image and builds the `openwrt-builder` image, which takes a few minutes. Subsequent runs are fast. |
| 116 | + |
| 117 | +:::note |
| 118 | +Devices that aren't in the latest stable OpenWrt release have to be compiled from source, which can take a while for the initial build — around 35 minutes on an M1 MacBook Pro. After that, builds are fast. |
| 119 | +::: |
| 120 | + |
| 121 | +When the build finishes, the download section provides flashing instructions specific to your device. You can flash the image with Raspberry Pi Imager, balenaEtcher, or `dd`. On macOS, there is a helper script at `scripts/flash-sd.sh`. |
| 122 | + |
| 123 | +Tear the stack down when you're done: |
| 124 | + |
| 125 | +```bash |
| 126 | +podman-compose down |
| 127 | +``` |
| 128 | + |
| 129 | +## Recipes |
| 130 | + |
| 131 | +Sensorbox uses YAML "recipes" to power the web-based configurator, inject settings, install packages, and create scripts. See the recipes README in the repository for details on writing your own. |
| 132 | + |
| 133 | +## Hardware builds |
| 134 | + |
| 135 | +- [NanoPi Zero2](/docs/sensorbox/nanopi-zero2.md) — a small, low-cost dedicated sensor with optional eMMC storage and Wi-Fi 7. |
0 commit comments