# LAN discovery :id=top

------

> Date: 11/14/2026  
> App Ver: 2.6.6.54

About every 2 seconds, `sa-di` broadcasts one JSON datagram to UDP **7000**. SA2's online-device page and the field phone app use it to find this SA1 box and the TCP port of its web UI.

This is not wavelength data. Wavelength stays on UDP 8190. The datagram has no password.

------

## 1. What is in the packet :id=packet

```json
{"IDN":"SA","SN":"sn001","IPs":["192.168.3.122"],"Port":80,"Ports":[80,8080,81]}
```

| Field | Meaning |
|-------|---------|
| `IDN` / `SN` | Identity and serial |
| `IPs` | This host's IPv4 addresses, excluding 127.x |
| `Port` | **Web UI port**, the first entry below |
| `Ports` | Every port `sa-web` is listening on this start |

`Port` is not 8190 and not 7000.

------

## 2. Where the port comes from :id=listen

The default list is **80, 8080, 81**, so `Port` is **80**. Override with `SA_WEB_LISTEN`, and keep it identical to `sa-web -listen`.

| How it is started | `Port` in the packet |
|-------------------|----------------------|
| systemd `sa-di.service`, container | 80 |
| `sa1-supervise` running as root | 80 |
| `sa1-supervise` not running as root | **8080** (web listens on 8080 and 81 only) |

Changing `-listen` without changing `SA_WEB_LISTEN` makes other programs open the wrong port.

If port 80 does not open, use `Ports`: `http://<device-ip>:8080/login` or `:81`. The login is the same account as the device web UI. The discovery packet does not carry it.

------

## 3. Who listens :id=recv

- The field phone app listens on UDP 7000 and 8192. The row shows `address:port` and logs in on `Port`. If the packet has no port, the app tries 8080.
- SA2 `sa_web` listens only on 7000 and only accepts JSON.

Quotes in the name are escaped. Each IP is written whole; if the whole packet does not fit, the IP list is omitted and the JSON stays complete.
