Connect a site
This guide connects one site to Avrel in about 20 minutes. You need an owner of your organization in Avrel (see Accounts and access) and someone with sudo on the site gateway. These can be the same person.
Fill in the site worksheet first.
Before you start#
| What | Requirement | How to check on the gateway |
|---|---|---|
| A site gateway | A Linux computer that stays on at the site and uses systemd. A Raspberry Pi, an industrial PC or the controller's own computer all work. | systemctl --version |
| Python and curl | Python 3.9 or newer, and curl. | python3 --version and curl --version |
| Your controller's address | Where the gateway can read the controller's dashboard API. If the collector runs on the controller's own computer, this is usually http://127.0.0.1:8888. | curl http://127.0.0.1:8888/api/system/status |
| Outbound access to Avrel | The gateway must reach your Avrel server address. Nothing needs to reach the gateway. | curl https://<your-avrel-server>/api/collector/agent |
Supported data source: hydro-readonly, which reads a controller dashboard that serves /api/system/status and /api/sensors/latest. Other controllers need a new source type; see Not available yet.
Step 1. Create your organization#
Skip this step if your organization already exists in Avrel.
- In Avrel, open the organization menu at the bottom of the sidebar and choose New organization.
- Enter the organization name. Industry and the first system ID are optional.
- Choose Create organization.
The new organization starts empty. Avrel shows no systems, readings or scores until a collector reports, so nothing on screen is made up. Avrel turns the name into an organization ID, such as easterton, which you will see in the install command in Step 2.
System Health now shows a setup guide with five steps: name your systems, describe the hardware, connect a collector, record the release you are running, and run your first release checks. Each step turns green only when what it needs is stored or has been reported, and the guide goes away once all five are done. This page follows the same order.
Start with Add systems. List each machine or site you want to watch, with a short ID such as SITE-01 and where it is. The collector reports under this ID.
Step 2. Create a collector key#
Create one key for each gateway. A key only lets that gateway send readings for your organization. Only owners can create keys.
- Switch the sidebar to Edge and open Collectors. (The setup guide on System Health has a shortcut to the same step.)
- Choose Add collector, give it a name that says where it is (for example Polytunnel Pi), choose the system it reports for, and choose Create key.
- Copy the key, which starts with
avc_, and keep it safe until Step 3. Avrel shows the key only once. It keeps only a fingerprint, so it cannot show the key again. If you lose it, revoke it and create a new one. - Copy the install command shown under the key. It already has your server address and organization ID filled in.
If Avrel warns that this server address only works on this computer, the gateway will not be able to reach it. Ask whoever runs your Avrel server for an address the site can reach, then add the collector again.
Step 3. Install the collector on the gateway#
Sign in to the gateway, then paste the install command from Step 2. It looks like this:
curl -fsSLO https://<your-avrel-server>/deploy/collector/install.sh
sudo bash install.sh --server https://<your-avrel-server> \
--org <org-id> --unit <system-id> \
--source hydro-readonly --source-url http://127.0.0.1:8888
When it asks, paste the collector key. The key is hidden as you paste and never goes on the command line, so it stays out of your shell history. To install without a prompt, save the key in a file only root can read and add --key-file /path/to/key.
| Option | Meaning | Default |
|---|---|---|
--server | Your Avrel server address. | Required |
--org | Your organization ID. | Required |
--unit | The system ID this gateway reports for. Letters, digits, ., _ and -. | Required |
--source | The kind of data source. | hydro-readonly |
--source-url | Where the gateway reads the controller's dashboard. | http://127.0.0.1:8888 |
--interval | Seconds between readings, 10 or more. | 60 |
--key-file | Read the key from a file instead of asking. | Ask |
--queue-mb | Most disk space the queue of unsent readings may use, in megabytes. When full, the oldest readings go first. | 32 |
--host-watchdog | Also arm the computer's hardware watchdog, so the whole computer reboots by itself if it hangs. Only use it on a gateway you are allowed to reboot. See Running a collector. | Off |
--uninstall | Remove the collector. See Running a collector. |
What the installer checks first#
The installer stops with a plain message, and changes nothing, if any of these fail:
- It runs as root, the machine uses systemd, and Python 3.9 or newer and curl are installed.
- Your Avrel server accepts the key, and the key belongs to the organization you named.
- The collector it downloads matches the SHA-256 checksum your Avrel server publishes, and runs on this Python.
It also tries the data source once. If the controller is not answering, it warns you and installs anyway, and Avrel shows the controller as offline until it answers.
What it changes on the gateway#
| Path | What it is |
|---|---|
/opt/avrel-collector/avrel_agent.py | The collector program. |
/etc/avrel-collector/collector.env | Settings and the key. Root only, mode 600. |
/etc/systemd/system/avrel-collector.service | The service definition. |
/var/lib/avrel-collector/ | Readings queued while Avrel cannot be reached, and a small file noting how the collector last stopped. |
/etc/systemd/system.conf.d/avrel-host-watchdog.conf | Only with --host-watchdog. Turns on the hardware watchdog. |
Nothing else on the machine is touched. The service starts straight away and on every boot. If it fails to start, the installer prints its last log lines.
Step 4. Check it is working#
Within two minutes of installing:
- In Edge > Collectors, your collector shows REPORTING and the system ID it reports for.
- Your system appears in the systems list with a status and its latest readings.
On the gateway, systemctl status avrel-collector shows the service, and journalctl -u avrel-collector -f follows its log.
What each status means#
| Status | Meaning | What to do |
|---|---|---|
| LIVE | Readings are arriving from the controller. The age shows when the last one came in. | Nothing. |
| CONTROLLER OFFLINE | The collector is running, but the controller is not answering. Hover for the error. Avrel keeps showing when the last good reading was taken. | Check the controller and --source-url. |
| COLLECTOR SILENT | Avrel has heard nothing from the collector for more than 3 minutes. The gateway may be off, have lost power, or have lost its network. | Check the gateway is on and online. Queued readings upload when it returns. |
| NO DATA | No collector has reported for this system yet. | Finish Step 3. |
| SIMULATED | Readings come from a collector in simulation mode, not from hardware. | Only used for testing. |
| DEMO | Sample data, shown because the demo switch is on in Settings > General. Nothing here comes from your site. | Turn it off in Settings to see real data. |
On Edge > Collectors, SILENT means the collector reported before but has stopped, NOT CONNECTED YET means its key has never been used, and REVOKED means its key no longer works. The Controller column shows whether the collector could read the controller on its last report (ANSWERING or NOT ANSWERING), and Collector version shows the version it reported, with UPDATE when a newer release is available.
If the gateway and the controller are the same computer and it loses power, both stop at once. Avrel then shows COLLECTOR SILENT, not CONTROLLER OFFLINE, because nothing is left at the site to report the fault.
Step 5. Declare your topology#
Readings tell you what is happening. The safety audit and the release checks also need to know how the site is wired. You describe that once, in the app or as a topology file. Until you do, the audit shows No hardware declared yet rather than a score.
Either way, the description has three parts:
- Nodes: each component, with an
id, atitleand arole, such asenergy_source,power_bus,compute_logicorcharger. - Edges: each connection, with
from,to, akind(powerordata), and protection facts such asfused,isolatedandmax_inrush_a. - Safety invariants: guards the site relies on, such as a boot guard that sets all relays off before automation starts.
The audit runs fixed rules over it. For example, it flags an unfused feeder from an energy source to a main bus, or a high-inrush load sharing an unisolated supply with control electronics.
Only declare what you have checked on site. The audit trusts the file, so a wrong fuse or a missing connection gives a wrong result. Leave out a value you have not measured, such as a startup current, rather than estimate it.
The topology drawing colours a part only where a rule found something about it. Declare a boot guard with boot_guard_verified set to false until you have recorded a boot test on the hardware: the audit shows it as a warning, and the release gate stays blocked until it is verified.
Describing it in the app#
You need to be an owner. Choose Describe hardware in the setup guide, or Edit hardware on the Topology & 3D Audit page.
- Components: add each part with a name and a type, such as Battery or power source, Power distribution, Controller or computer, Relay board or motor driver, or Pump, fan, motor or valve. Details such as a rating are optional.
- Connections: for each power cable or data link, choose what it runs from and to. For a power cable, say whether it has a fuse or breaker (or leave it as Not checked yet), enter the startup current only if you measured it, and tick Isolated from the controller's supply if it is. For a data link, tick Termination missing or Has devices not yet commissioned if they apply.
- Fail-safe at start-up: declare the boot guard or watchdog that puts every output in a safe state before automation starts. Leave it as Declared, not yet tested until you have recorded a boot test on the hardware.
- Choose Save and run the audit. Avrel checks the description, draws the wiring and runs the safety rules straight away.
Starting from a photo or a drawing#
At the top of the same window, Photo or PDF reads the hardware for you. On a phone it opens the camera, so you can photograph the wiring or harness on site; on a computer, choose photos or a schematic or wiring diagram as a PDF (up to 4 files, 3 MB together).
Claude reads the files and fills the rows in the window with a draft. Nothing is saved yet:
- Each row says how sure the reading is (Read clearly, Partly legible, check it or Unsure, check it) and what it was based on.
- A list under Could not read, check on site names the labels, values and wire ends it could not make out.
- A fuse is only filled in where one is visible, and a startup current only where it is written on the drawing. Everything else stays blank for you to fill in.
- A fail-safe seen on the drawing is entered as Declared, not yet tested, never as tested.
Check every row, correct what is wrong, then choose Save and run the audit. Cancel throws the draft away and keeps what was saved before. The files are sent to the Anthropic API to be read and are not stored by Avrel; see Security and data.
If you already have a topology.json, choose Upload topology.json in the same window instead. Download saves what is declared now as a file.
Step 6. Record your release and run the checks#
- Choose Record release in the setup guide, or on the HIL CI & Release Gate page. Enter the release name or version, its commit or build ID, and the build you would roll back to. Avrel stores the release gate's result at that moment next to the release.
- Choose Run checks. The release gate checks the declared hardware, the collector's read-only policy and your release records, and replays any regression checks made from recorded incidents. Each failing check says what clears it.
The gate stays BLOCKED until every check that applies passes. For a new site that usually means testing the fail-safe on the hardware and naming a rollback target for each release.