Skip to main content

Gateway General Documentation

The Shifu project's gateway is a multi-protocol bridge that supports various protocols such as HTTP, MQTT and LwM2M. It provides a unified interaction interface for different IoT devices and systems, simplifying protocol conversion and integration.

Overview

The LwM2M (Lightweight Machine to Machine) Gateway consists of two main components: an LwM2M client that connects to the LwM2M server and an HTTP client that connects to deviceShifu. The LwM2M Gateway enables deviceShifu to adapt to the LwM2M protocol, handle requests from the LwM2M server, and push data to the cloud, fulfilling the two major functions required by the LwM2M protocol: the capability to pull data from the device and post data from the cloud to the device.

Key Features

  • Protocol Conversion: Supports converting HTTP, MQTT, and OPC UA requests into a unified internal message format, allowing developers to interact with different types of IoT devices without dealing directly with the underlying protocol details.
  • Device Management: Provides core functionalities such as device registration, reading attributes, executing commands, and monitoring device status, applicable to devices under multiple protocols.
  • Modular Design: Implemented in Go, the modular architecture ensures scalability and maintainability of the system.

Typical Use Case

A typical use case is an HTTP or MQTT client interacting with IoT devices:

  1. The client sends a request (e.g., containing device ID and operation instructions) to the gateway.
  2. The gateway converts the request into an internal operation request and processes it according to the device protocol.
  3. After the device responds, the gateway converts it back to the original protocol response (HTTP, MQTT, etc.) and returns it to the client.

Advantages

  • Developer-Friendly: Developers can use familiar tools and frameworks (HTTP, MQTT, OPC UA) to interact with IoT devices, reducing development complexity.
  • Flexible Integration: The gateway can be easily integrated into existing IoT ecosystems, supporting interoperability with multiple systems and protocols.
  • Unified Management: By supporting multiple protocols, the gateway provides unified management for different devices and systems, enhancing system scalability.