MQTT/S
NUBISON IoT's standard MQTT/S protocol.
Last updated
NUBISON IoT's standard MQTT/S protocol.
Last updated
The MQTT/S connection authentication requirements are as follows.
username
password
The above information corresponds to the authentication key items clientId and clientSecret, which were introduced in the section titled Getting Started.
deviceKey: The following strings constitute a device identification key for the NUBISON IoT platform.
{productCode}_{deviceIdentifier}
They correspond to the product code (productCode) and device identifier (deviceIdentifier), which were introduced in the section entitled Getting Started.
sessionId: This is a temporary key issued by the gateway server of the NUBISON IoT platform to identify a transaction with a device. Every time a request is transmitted, a new key is generated and added to the request topic. When responding to a server request, the sessionId of the request topic must be included and sent.
MQTT/S-compatible devices can connect to the NUBISON IoT platform using this communication protocol. Regardless of whether the protocol is MQTT or MQTTS, the device must attempt to connect with the specified authentication values. Initially, devices must be registered on the NUBISON IoT platform. To register the device, please refer to the manual provided below.
Following is a description of the exchanged topics between the device and the NUBISON IoT platform. The topic varies depending on the issuer, and the device publishes and subscribes only to the topic with the relevant items.
When the MQTT/S connection is successful, the device subscribes to the server-published topic in the following manner.
{deivceKey}/#
Task
Topic
Description
Connect to NUBISON IoT Platform
connect/{deviceKey}
Published when connected to the cloud.
The timeline is saved.
Data Notification
data/{deivceKey}
Published when data is uploaded to the platform from the device.
Heartbeat
heartbeat/{deivceKey}
Published when updating the device connection state.
Get produce model list
models/{deivceKey}
Published if you need a list of SDK-only product models. [{productName, productModelId}]
Regist device
register/{deivceKey}
Published when registering SDK-only devices. deviceName,modelName
Response
res/{sessionId}
Published when a request is received from the server. If any of the following applies, please send the payload as follows. connect response: blank payload data response: payload remote dignosis response such as data topic: Diagnosis result payload log response: blank payload
When it is a response to control, remote diagnostics, and log requests, the timeline is saved.
Disconnct to NUBISON IoT Platform
disconnect/{deivceKey}
Published when notifying disconnection from the cloud.
The timeline is saved.
LWT(Last will and testament)
lwt/{deviceKey}
When the connection is unexpectedly severed, MQTT Broker notifies the cloud of the disconnection.
The timeline is saved.
When the connection is unexpectedly severed, MQTT Broker notifies the cloud of the disconnection.
The timeline is saved.
The NUBISON IoT platform offers a flexible architecture that enables existing device data to be stored on the platform without any modifications to the device or device data to be received by the platform at the touch of a button with minimal modifications to the device firmware.
Through a device driver and driver production request, users can send and receive data without having to modify existing devices. Please refer to the user guide below.
In contrast, according to the standard protocol of the NUBISON IoT platform, data can be exchanged. If you click the [Automatically Generate Driver] button in the product model details section above, a driver is automatically generated for that product model and driver registration is performed automatically, allowing the device to connect to the IoT platform at any time.
The following are the standard rules of the NUBISON IoT platform.
When transmitting device data to the platform, concatenate the data of each unit (sensor, etc.) in the order of unit number, with "|" sent between each string. After slicing the data with "|" and sorting it by unit number, save the data to the platform in the automatically-generated driver when receiving data.
When transmitting a device control command from the platform, the following is the transmission payload. In the code below, the commandType value is "control".
When sending a non-control command, the payload is as follows.
The server response, which means ACK, is sent as "1" for success and "0" for failure.