Developing a Protocol Conversion Gateway for Access of Generic-Protocol Devices
Scenarios
Currently, the IoT platform supports only standard protocols such as MQTT, HTTP, and LwM2M. If a device uses other protocols (referred to as third-party protocols), it cannot access the platform directly.
To address this issue, protocol conversion must be performed outside the platform. It is recommended that a gateway be used to convert third-party protocols into MQTT. This gateway is called the protocol conversion gateway.
Implementation Principle
The figure below shows the overall architecture of the solution.
The protocol conversion gateway can be deployed in the cloud or locally. A third-party protocol device is connected to the platform as a child device of the protocol conversion gateway.
The protocol conversion gateway consists of the following components:
- Third-party protocol access component: This component parses and authenticates third-party protocols.
- Protocol conversion component: This component converts between third-party protocol data and platform data.
- In the upstream direction, the component converts third-party protocol data into platform-supported data and invokes the device SDK APIs to report the data.
- In the downstream direction, the component, after receiving data from the platform, converts the data into third-party protocol data and forwards the data to third-party protocol devices.
- Device SDK component: The component is the device access SDK provided by the platform and provides common gateway functions. You can implement your own gateways based on the SDK.
Service Flow
- Register a gateway with the platform. For details, see Device Authentication.
- Power on the gateway and connect it to the platform. Obtain the authentication parameters required for connection during gateway registration.
- Register a child device on the IoTDA console. The platform delivers a child device addition event to the gateway. The gateway saves the child device information and makes the information persistent. (The SDK provides the default persistent implementation. You can customize the implementation.)
- The child device connects to the gateway, and the gateway authenticates the child device.
- The child device reports data to the gateway. The gateway converts the data to the format supported by the platform and then calls an SDK API for reporting child device properties or messages to the platform.
- The platform delivers a command to the child device. The gateway converts the command into a command compliant with the third-party protocol and forwards it to the child device. The child device processes the command.
Implementation of Protocol Conversion Gateway
For details on the implementation and usage of the gateway, see IoT Device SDK (Java) and IoT Device SDK (C).
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot