Private Deployment Methods

· Gateway Method
· Broker Method
All private deployment methods provided by ThingBoot support both public cloud servers and local area networks (LANs), and are applicable to all currently sold products.

Working Mechanism of Gateway Method

The "Gateway" mentioned here can be a "Hardware Gateway", a "Software Gateway", or even "No Gateway":
The "Hardware Gateway" is a hardware device launched by ThingBoot for centralized management of privately deployed devices, and it is still under development.
The "Software Gateway" is a software developed by ThingBoot for managing privately deployed devices, which is free and cross-platform.
When a device operates in gateway mode, it builds in a set of interface services to respond to requests from external applications. Therefore, the device can also work independently in the "No Gateway" mode.

When the device operates in gateway mode:
If a gateway address is specified, the device will maintain communication with the gateway.
In this case, commands can be sent to the gateway, which will then forward them to the device
If no gateway address is specified, the device can still work independently.
In this case, commands can be sent directly to the device's IP address

The private deployment mechanism of the Gateway Method is as follows:
1. The device has a built-in web service. Once the device is connected to the network, it immediately starts listening for external HTTP requests and responds to them.
2. If a gateway (either Hardware Gateway or Software Gateway) is configured, the device will maintain communication with the gateway and report its own information.

Communication:
Command Delivery: In the Gateway Method (Hardware or Software), commands can be sent to the gateway, which forwards them to the device; in the No Gateway Method, commands can be delivered directly by requesting the device's HTTP interface.
Message Reporting: Device messages are reported to the gateway in real time. The No Gateway Method cannot receive uplink messages from the device and only supports command delivery.

Working Mechanism of Broker Method

The private deployment mechanism of the Broker Method is as follows:
1. After the device is connected to the network, it will request the configured registration (reg) interface with its device information to obtain the username and password for MQTT connection.
2. After successfully obtaining the identity information, the device starts connecting to the configured broker (MQTT server) and maintains a long connection with it.

Communication:
Command Delivery: Send messages to the topic subscribed by the specified device.
Message Reporting: The device will publish its own messages in real time to the topic it has subscribed to.