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
{
"op": 101
}Parameters
| Field | Location | Type | Required | Description |
|---|---|---|---|---|
op | body | integer | Yes | Operation code. 101: discovery request. |
Example response
{
"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"
}
}{
"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 code | Meaning |
|---|---|
| 200 | OK |
Response fields
HTTP 200 OK
| Field | Type | Required | Description |
|---|---|---|---|
op | integer | Yes | Operation code. 102: discovery response. |
data | object | Yes | Response payload. |
data.name | string | Yes | Product name. Name |
data.model | string | Yes | Product model |
data.version | string | Yes | Version |
data.mac | string | Yes | MAC address. Uppercase hexadecimal, separated by colons. |
data.ip | string | Yes | Ethernet IP address. Use this address as the host for API requests. |
data.link_enabled | boolean | Yes | Registration enabled |
data.link_remian_ms | integer | Yes | Remaining registration time. In milliseconds. |
data.reset_id | string | Yes | Device ID |