Skip to main content

IDENTIFY

Syntax​

IDENTIFY

Description​

Discovery command. Every HMCLS device answers with its IP address, even when the command is sent to a broadcast address. The HMCLS app uses it to list the boards of the local network.

Response​

HMCLS ip=<a.b.c.d>

The reply is sent to the sender on port 55153, like any other reply.

Example​

Find the boards of a subnet:

discover.py
import socket
import time

BROADCAST = "192.168.1.255" # broadcast address of your subnet

rx = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
rx.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
rx.bind(("0.0.0.0", 55153))
rx.settimeout(0.2)

tx = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
tx.setsockopt(socket.SOL_SOCKET, socket.SO_BROADCAST, 1)
tx.sendto(b"IDENTIFY", (BROADCAST, 55152))

found = set()
end = time.time() + 1.5
while time.time() < end:
try:
data, _ = rx.recvfrom(256)
except socket.timeout:
continue
text = data.decode(errors="replace").strip()
if text.startswith("HMCLS ip="):
found.add(text.split("=", 1)[1])

print(sorted(found))