Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add gateway general documentation #339

Merged
merged 10 commits into from
Jan 6, 2025
28 changes: 28 additions & 0 deletions docs/guides/gateway/gateway_general_documentation.md
Twilikiss marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@

Twilikiss marked this conversation as resolved.
Show resolved Hide resolved
# 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.
Twilikiss marked this conversation as resolved.
Show resolved Hide resolved

## 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.
Twilikiss marked this conversation as resolved.
Show resolved Hide resolved

## 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.
Twilikiss marked this conversation as resolved.
Show resolved Hide resolved
- **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:
Twilikiss marked this conversation as resolved.
Show resolved Hide resolved

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.