Skip to content

Capturing commands from the admin console

Commands lists the documented actions, but the Management API is the same API the Gateway Admin Console uses — so anything the console can do has a message behind it, whether or not it is written down here.

This is how you find that message: perform the action in the console, watch the WebSocket traffic, and copy what it sent.

  1. Make sure your MQTT connection is active if you intend to replay over MQTT. You can use a free broker such as test.mosquitto.org for testing. Set a publish topic and a subscribe topic, and tick Allow Gateway management.

  2. Open the Gateway Admin Console and press F12 to open the browser’s developer tools.

  3. Go to the Network panel.

  4. Press Shift + Refresh to reload, so the WebSocket connection is captured from the start.

  5. Find and click realtime in the request list. That is the WebSocket connection.

  6. Open the Messages tab and filter the view to Send, so you only see what the console is sending to the gateway.

  7. Perform the action you want to copy in the admin console — for example, open a PHANTOM® Sync group and press Prepare and Send Beacon. Its message appears in the list.

  8. Right-click the message and copy it. The full message is shown at the bottom of the panel.

  9. Add the gwSerial property if you are going to replay it over MQTT, using the 9-digit serial of the gateway or DEFIANT™:

    { "gwSerial": 589248404 }

    The finished message looks like this:

    {
    "type": "observeerequest",
    "action": "doPhantomSync",
    "gwSerial": 589248404,
    "params": { "index": 0, "action": "prepareandactivate", "timeout": 600 },
    "subordinate": null
    }
  10. Paste it into your MQTT client and send. Any client works — MQTTX is a free one that is easy to test with.

The console exercises the whole API surface, so this technique documents itself against the firmware you are actually running. It is the fastest way to find the message for a feature this page does not cover.