Control Portal

v2.0.0

Embedded MQTT Specifications and Example Code

NOTE: This document supercedes the original spec, which has been archived here.

The following page is based on requested CSE switch modifications to provide remote command-and-control. The key idea is that Azure IoT Hub (direct command/response via Eventhub). This means:

From the switch's perspective, the agent is required to connect to the MQTT broker and subscribe to an MQTT topic with a given SSL client certificate. As the agent receives commands, it processes them and them publishes its response on a topic. The payload is in JSON format based on the command parameters.

For example, on the switch with MAC 00:de:ad:be:ef:01, the switch should:

Configuration Options

Ultimately the switch will need to have the following configuration options available to be set to connect to this system:

Command Payload

Commands will vary in their specific options, but generally they will be in JSON format and look something like this:

{
    "cmd": "poe_enable_set",
    "port": 1,
    "enabled": 0
}
	    

NOTE: This is just an example, the source code for the client will be the ultimate guide.

The response will be either a simple acknowledgement in JSON or an info dump, as in a call to sys_info_get:

{
    "cmd": "sys_info_get",
    "system_name": "8P-MA-POE-V2",
    "mac_address": "38:73:EA:AA:87:4E",
    "firmware_version": "2.03.xx",
    "uptime": 12345
}
            

NOTE: Again, this is a general example and not normative.

Example Code and Development Resources

To help jumpstart development, a number of resources are available to speed both implementation and testing:

Demo Video