Skip to content

Discover a gateway ​

Find gateways on your local network by broadcasting a discovery message over UDP port 9001. Bind the receiving socket to 0.0.0.0 and send the message to 255.255.255.255 (0xFFFFFFFF). A UDP debugging tool can be used to try the exchange before writing an integration.

Open the registration window

Press the gateway's physical button to enable registration for 10 seconds. During that window, link_enabled is true and link_remian_ms counts down in milliseconds. When the countdown reaches zero, registration closes.

These field names match the response examples below. The discovery operation may be listed as HEAD /use_udp_broadcast_to_find_gateway in exported API definitions; the network exchange described here uses UDP.

Discovery message

json
{
  "op": 101
}

Parameters ​

FieldLocationTypeRequiredDescription
opbodyintegerYesOperation code. 101: discovery request.

Example response

json
{
  "op": 102,
  "data": {
    "name": "Bwee Bridge",
    "model": "BWB001",
    "version": "v1.0.0",
    "mac": "60:A4:34:B0:00:0B",
    "ip": "192.168.41.104",
    "link_enabled": false,
    "link_remian_ms": 0,
    "reset_id": "4A0E443C-3444-4592-8662-DDAE45AD7AF7"
  }
}
json
{
  "op": 102,
  "data": {
    "name": "Bwee Bridge",
    "model": "BWB001",
    "version": "v1.0.0",
    "mac": "60:A4:34:B0:00:0B",
    "ip": "192.168.41.104",
    "link_enabled": true,
    "link_remian_ms": 9700,
    "reset_id": "4A0E443C-3444-4592-8662-DDAE45AD7AF7"
  }
}

Responses ​

Status codeMeaning
200OK

Response fields ​

HTTP 200 OK

FieldTypeRequiredDescription
opintegerYesOperation code. 102: discovery response.
dataobjectYesResponse payload.
data.namestringYesProduct name. Name
data.modelstringYesProduct model
data.versionstringYesVersion
data.macstringYesMAC address. Uppercase hexadecimal, separated by colons.
data.ipstringYesEthernet IP address. Use this address as the host for API requests.
data.link_enabledbooleanYesRegistration enabled
data.link_remian_msintegerYesRemaining registration time. In milliseconds.
data.reset_idstringYesDevice ID