For some dealers and customers who want to build their own cloud server by using KinCony’s IOT smart home products, we have summarized three ways to build their own smart home software system with the fastest speed, such as server program, PC program, iOS and Android mobile APP. Let’s take a look at these three ways and the differences between them:
1. TCP server mode:
The computer server is the server, and the KC868-Hx controller is the client. The server is in the listening state. After the controller is powered on, it will actively establish socket communication connection with the server to realize data interaction. The TCP connection mode is long connection. If you need to specify a device with MAC address to connect to the server, you can set the function of “Send MAC when TCP establish” in the vircom network configuration tool’s “More Advaced Settings” option. In this way, when the client connects, it will automatically report MAC address, and the legitimate host will be connected by the server again, otherwise no connection will be established. This way all protocol use strings for data interaction.
2. TCP client mode:
The PC is the client and the kc868-Hx controller is the server. The controller server is in the listening state. After the PC client clicks the connect button, it will establish a socket communication connection with the server to realize data interaction. The TCP connection mode is long connection. This way all protocol use strings for data interaction.
3. UDP mode:
The computer server is the server, and the KC868-Hx controller is the client. The server is in the listening state. After the client hardware is powered on, it will actively establish a communication connection with the server to realize data interaction. The UDP connection mode is short connection. Use hex format for data interaction. The process of hardware online is as follows:
A: Controller register & login to the server;
B: After successful registration, send heartbeat packet to the server;
C: The server replies the heartbeat packet to the controller;
D: The server sends commands to control hardware devices, such as: turn ON relay1 or trun OFF relay1 ;
E: The hardware replies to the server with information about the success or failure of control.