In order to manage a device through the RM, the device should be manually registered (through the management console or programmatically), then credentials should be preset (see Registration and Authentication) and finally a login request message should be sent. The backend will then authenticate the device (via the default authentication mechanism or custom implementation) and will send a response, acknowledging it is ready to work or notifying if an error has occurred.

Request

Topic

backend/<device-type>/<device-id>/login

Payload

{
  "token" : <string>,
  "requestId" : <string>,
  "needAck" : <boolean>,
  "loginProperties" : map<<string>, <object>>
}
  • "token" - this field is mandatory and is part of the security concept for the messaging protocol. For more information check the Security section in the MQTT Device Management Model page.

  • "requestId" and "needAck" - these fields are required if:

    • message delivery acknowledgment is required;

    • confirmation of successful request is required (success is defined as an absence of error);

    • data is expected as a result of the request;


      Note that if the fields are omitted no response of any kind will be sent by the backend and if an error has occurred the device won't be notified of it.

  • "loginProperties" - this field is mandatory and is part of the authentication mechanism. If the default authentication provided by the module is used, basic credentials (username and password) must be included in the following format:

    • key: "mqtt.device.username", value: <string>

    • key: "mqtt.device.password", value: <string>

Response

Topic

device/<device-type>/<device-id>/<token>/login

Payload

{
  "requestId" : <string>,
  "error" : <string>
}
  • "requestId" - this field will be included only if it was present in the request message and its value will match the value sent with the request.

  • "error" - this field will be included only if an error occurred during the fulfilling of the request.


    Note that if the field is present, the payload will not contain any other fields, except for "requestId".