Device Private Deployment Broker Configuration - Private Deployment Hotspot

By enabling a "private deployment hotspot" on-site at the device, the device will send a request for private deployment configuration (e.g., interface request) to the server after connecting to the hotspot, and save the configuration information returned by the interface.

The private deployment hotspot method not only configures private deployment settings but also allows network configuration for the device simultaneously.
The private deployment hotspot configuration method requires programming to implement an interface for the device to request configuration information.

Enable Private Deployment Hotspot

Please enable a 2.4G wireless hotspot on-site at the device:
Hotspot Name:
pvt-ip-port
Hotspot Password:
unisoft.cn [Fixed]
1. After enabling the hotspot, restart the device. The device will scan for "private deployment configuration hotspots" in nearby networks.
2. Once the hotspot is detected, it will connect to it using the above name and password.
3. After successfully connecting to the hotspot, the device will send a request to http://ip-address:port-number/private.
4. After the request succeeds, the device will save the private deployment configuration information returned by the interface.
Example: Enable a wireless hotspot on-site with the name "pvt-192.168.1.5-888" and password "unisoft.cn". After the device successfully connects to this hotspot, it will immediately request the configuration interface at http://192.168.1.5:888/private to obtain its private deployment configuration information.

Device Initiates Configuration Request

When the device successfully connects to the private deployment configuration hotspot "pvt-ip-port", it will immediately request the private deployment configuration interface:
http://ip-address:port-number/private
Request Protocol: HTTP; Request Method: GET.
If the device does not detect the private deployment configuration hotspot or fails to connect to it, it will not send a request to this interface.
If the request fails, the device will disconnect from the hotspot, reconnect (as long as the hotspot exists), and continue requesting this interface.

The device carries parameters when initiating the request. You can return targeted configuration information based on these parameters.

Parameter / Name / Type Description
Product Code
product
String
The product code (Key) is a constant. It is the same across different devices of the same product and never changes.
The product Key can be viewed on the product details page in the console.
Device ID
device
Integer
The device ID is unique on the platform. It never changes for the same device.
The device ID is the numeric ID on the device label attached to the device casing. It can also be viewed on the corresponding device details page in the console.
Timestamp
ts
11-digit Integer
The time when the device initiates the request. The value of this parameter depends on the device's standard time, which is obtained by the device through the NTP interface. If the NTP interface fails to obtain the time, this value will be 0.
Signature
sign
32-character String
To verify the validity of the request, you can use the signature. Specific algorithm:
md5(Interface IP Address + "." + Port Number + "." + Product Code + "." + Device ID + "." + Device Password + "." + Timestamp)

In scenarios such as local area networks (LANs), signature verification can be skipped.

Configuration Interface Implementation Method

This interface can be implemented through a web service on any network server that the device can access.

Any web container such as IIS, Apache, or Nginx can be used.
It can be deployed on the same server as the Broker.
Log records can be added to the interface for debugging purposes.

Since the device connects to the network through the hotspot and initiates the interface request, it is necessary to ensure that the device enabling the hotspot (which can be a mobile phone, laptop, etc.) is network-interconnected with the interface server.

Please ensure the device can access this interface normally!

Configuration Interface Return Format

After the device connects to the hotspot, it will immediately initiate a request. Please output the private deployment configuration parameters based on the device's needs.

Parameter / Name Description
Status Code
code
Must be 200
Data
data
The returned data format is as follows: (No order requirement)
Time Interface
ntp
String (max. 100 characters)
If the device has no requirement for standard time, this field can be left blank (not recommended for production environments)
When the device goes online, it will send an HTTP request to the specified URL to synchronize the time between the Broker and itself. This is very important.
The specific implementation method of the time service is described in detail in the "NTP Interface" section.
Note: The NTP service here is an HTTP request (a URL), not the system's NTP service. Do not output the domain name of the NTP server in the NTP address field.
Registration Interface
reg
String (max. 100 characters)
If registration verification is not required, this field can be left blank (not recommended for production environments)
When the device goes online, it will send an HTTP request to the specified URL to obtain the Username and Password required to connect to the Broker. If this interface is not specified, the device will use its default Username and Password.
The specific implementation method and return format are described in detail in the "Registration Interface" section.
If the registration interface is output and the following information is included in the interface response, then the following information fields are all optional.
Host
host
String (max. 64 characters)
Output the IP address (usually the IP address or domain name of the server where the Broker service is located) and port exposed by the Broker service. Ensure it is interconnected with the wireless network that the device will connect to later; it can be a local area network (LAN) IP address.
(It is recommended to use an IP address instead of a domain name, as DNS resolution failures may occur on many public network lines)
If left blank: The address information needs to be output through the registration interface;
If output: If the registration interface outputs address information, the address information from the registration interface will be used first; if the registration interface does not output address information, the output information will be used.
Port
port
Integer (max. 65535)
Output the port exposed by the Broker service (the IP address is usually the IP address or domain name of the server where the Broker service is located). Ensure it is interconnected with the wireless network that the device will connect to later; it can be a local area network (LAN) IP address.
(It is recommended to use an IP address instead of a domain name, as DNS resolution failures may occur on many public network lines)
If left blank: The address information needs to be output through the registration interface;
If output: If the registration interface outputs address information, the address information from the registration interface will be used first; if the registration interface does not output address information, the output information will be used.
Device Topic
topic
String (max. 255 characters)
The topic used by the device to subscribe to and publish messages. Leave it blank, or output "key", "client", or other values.
The complete topic subscribed to by the device is: {pre}/{type}/{side}, where
{pre} is the topic prefix:
When "key" is output (or left blank), the topic is: thing/Product Code/Device Code/{type}/{side};
When "client" is output, the topic is: thing/Product Code/Device Client/{type}/{side};
When other non-empty strings are output, the topic is: [Output Value]/{type}/{side}

{type} is the message type
{side} indicates client or server: server / client
User Information
user
JSON Object
Output the user information required for the device to log in to the Broker: ClientID, Username, Password.
If left blank: The user information needs to be output through the registration interface;
If output: If the registration interface outputs user information, the user information from the registration interface will be used first; if the registration interface does not output user information, the output information will be used.
Network Information
wifi
Array (max. 5 elements)
Enter the WiFi network information that the device will connect to.

Return Example: