> For the complete documentation index, see [llms.txt](https://docs.bituo-technik.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.bituo-technik.com/device-api/spm-sdm-open-wi-fi-api-overview/mdns-discovery.md).

# mDNS Discovery

{% hint style="info" %}
**Status**: Stable | **Applies to:** all SPM / SDM Open Wi-Fi branches | **Updated**: 2026-10-17
{% endhint %}

After the meter joins your Wi-Fi network it announces itself over mDNS (Multicast DNS). A gateway, EMS or app on the same subnet can then find the IP address of every meter **without a static IP and without scanning**, and go on to use Modbus TCP, HTTP, WebSocket or UDP.

### 1. Introduction

<table><thead><tr><th width="192.3333740234375">Item</th><th>Description</th></tr></thead><tbody><tr><td>Service type</td><td><code>_http._tcp.local.</code></td></tr><tr><td>Port</td><td><code>80</code> (the Web UI and HTTP API; the other ports are <strong>not</strong> announced)</td></tr><tr><td>Hostname</td><td><code>&#x3C;device name>.local.</code>, by default <code>EnergySensor-&#x3C;model>[_&#x3C;variant>]-&#x3C;MAC></code> (see Section 2)</td></tr><tr><td>TXT records</td><td>None; the service carries no extra information</td></tr><tr><td>Address type</td><td>IPv4</td></tr><tr><td>When</td><td>After every successful Wi-Fi connection (including reconnects)</td></tr><tr><td>Not available</td><td>Until the meter has connected to your Wi-Fi network (no announcement while it is only in provisioning state)</td></tr></tbody></table>

### 2. Hostname format

The default hostname is generated from the model and the MAC address:

```
EnergySensor-<MODEL>[_<VARIANT>]-<MAC>.local.
EnergySensor-SDM01_3PN_01-45705E597760.local.
```

<table><thead><tr><th width="179.7777099609375">Field</th><th>Example</th><th>Description</th></tr></thead><tbody><tr><td><code>EnergySensor</code></td><td></td><td>Fixed prefix</td></tr><tr><td><code>MODEL</code></td><td><code>SDM01_3PN</code></td><td>Product model, the same as the model in Modbus register 984</td></tr><tr><td><code>VARIANT</code></td><td><code>01</code> / <code>02</code></td><td>Firmware variant, see the table below. Some models have <strong>no</strong> variant field</td></tr><tr><td><code>MAC</code></td><td><code>45705E597760</code></td><td>The 12 hexadecimal characters of the device MAC, upper case, no separators; also the serial number used in MQTT topics</td></tr></tbody></table>

Variant by firmware family:

<table><thead><tr><th width="300.8890380859375">Firmware</th><th width="96.2222900390625">Variant</th><th>Example</th></tr></thead><tbody><tr><td>Basic / Lite: SDM01_3PN and SDM01_1PN</td><td><code>_01</code></td><td><code>EnergySensor-SDM01_3PN_01-45705E597760</code></td></tr><tr><td>Basic / Lite: other models such as SPM02, SDM02</td><td>none</td><td><code>EnergySensor-SPM02-45705E597760</code></td></tr><tr><td>Basic+ / Pro</td><td><code>_02</code></td><td><code>EnergySensor-SDM01_3PN_02-45705E597760</code></td></tr></tbody></table>

Customer-customized builds may use a different name instead of the model.

#### 2.1 Renaming the device

The hostname is the **device name**, which the user can change with the `deviceName` command (at most 30 characters, see Business Command Reference) or on the Web page. The new name is announced the next time the device connects to Wi-Fi (restart it to be sure). Once renamed:

* the `EnergySensor-` prefix filter no longer finds it; discover by the **service type** `_http._tcp` and check the identity another way (see Section 3.2);
* use only letters, digits and `-` in the name. Spaces and other characters are not valid in a hostname, and some resolvers will not resolve them.

### 3. Discovering devices

#### 3.1 Filtering

1. Browse for `_http._tcp`. Many devices on the network (printers, NAS, routers) announce the same type, so you will get a list.
2. Keep entries whose name starts with `EnergySensor-`.
3. Split the name into model, variant and MAC.
4. **Only connect to variants you have validated.** The variant identifies the firmware family and thus the behavior of the HTTP API and the other interfaces (see the Overview); report an unknown variant instead of assuming it is compatible.
5. Take the IPv4 address from the answer. Cache it, but be ready to look it up again: a DHCP lease can change the address. Prefer a DHCP reservation on the router for production sites.

#### 3.2 Confirm the identity of a found device

Names can be changed and other products may use a similar one, so confirm before you start using the device:

* Read Modbus registers 978 \~ 988 (MAC and model); no sign-in is needed, see Modbus TCP.
* Or call HTTP `/signin` without a password to see whether the device is protected, then `/model` with a token; see HTTP.

#### 3.3 What to use after discovery

| Need                                   | Interface                                   |
| -------------------------------------- | ------------------------------------------- |
| PLC / industrial gateway, polling      | Modbus TCP port 502                         |
| Configuration, status, firmware update | HTTP port 80 (443 for HTTPS)                |
| Low-latency stream                     | WebSocket port 81 (plain or WSS, same port) |
| Fast one-way readings                  | UDP: configure the device to send to you    |

Ports other than 80 are not in the mDNS record; use the defaults above.

### 4. Verifying that mDNS works

<table><thead><tr><th width="249">Platform</th><th>Command / tool</th></tr></thead><tbody><tr><td>Any, with Python</td><td><code>python tools/lan/discover_mdns.py</code> (see tools/lan); lists every meter found</td></tr><tr><td>macOS</td><td><code>dns-sd -B _http._tcp</code> and <code>dns-sd -L "&#x3C;name>" _http._tcp local</code></td></tr><tr><td>Linux</td><td><code>avahi-browse -rt _http._tcp</code></td></tr><tr><td>Windows</td><td>Bonjour's <code>dns-sd</code> (installed with iTunes / Bonjour Print Services), or the Python tool above</td></tr><tr><td>Android</td><td>an app such as "Service Browser", browse <code>_http._tcp</code></td></tr><tr><td>Packet capture</td><td>Wireshark with the display filter <code>mdns</code></td></tr></tbody></table>

Quick check by name: `ping EnergySensor-SDM01_3PN_01-45705E597760.local`.

The tool needs the `zeroconf` package; without it, the tool falls back to a plain mDNS query that needs no package.

### 5. Troubleshooting

<table><thead><tr><th width="349">Symptom</th><th>Likely cause</th></tr></thead><tbody><tr><td>Device not found</td><td>Phone / PC and the meter are on different subnets or VLANs; the router blocks multicast ("AP isolation", "client isolation", IGMP snooping problems); the meter is not connected to Wi-Fi</td></tr><tr><td>Found, but cannot connect</td><td>Address changed (DHCP); firewall on your side; the target interface is turned off (for example Modbus TCP bit 15)</td></tr><tr><td>Found only after a while</td><td>Announcement happens once the Wi-Fi connection is up; wait a few seconds after power-on or a router restart</td></tr><tr><td>Name differs from what you expect</td><td>The device was renamed (<code>deviceName</code>) or it is a firmware family with another variant</td></tr><tr><td>Windows cannot resolve <code>.local</code></td><td>Install Bonjour, or use the Python tool, or use the IP address directly</td></tr><tr><td>Name resolves on one computer only</td><td>That computer has its own mDNS stack (such as Bonjour / Avahi); others need the same</td></tr></tbody></table>

### 6. Related pages

* Overview
* Modbus TCP, HTTP, WebSocket, UDP
* Machine-readable description: `spec/mdns-discovery.json`

***

### Annex-1. Verification with *Service Browser* APP

The simplest way to verify mDNS is working is with a phone app on the same Wi-Fi network.

**Recommended App:** *Service Browser* (Android) — search and install from the Play Store.

**Steps:**

1. Connect your phone to the **same Wi-Fi network** as the meter.
2. Open Service Browser and browse to **World Wide Web HTTP** (`_http._tcp`).
3. Look for a device named `EnergySensor-{Model}_{VariantCode}-{MAC}`.
4. Tap the entry — you should see the resolved **IPv4 address and port 80** (e.g., `192.168.50.135:80`).

If the device appears with a valid IP, mDNS is functioning correctly.

> Other verification methods are also available, including command-line tools (`ping <hostname>.local`, `dns-sd -B _http._tcp` on macOS/Linux) and desktop packet capture tools such as Wireshark (filter: `mdns`). Refer to the Troubleshooting section for details.
