Device Connect To Atlato#
TCP#
Below is a diagram illustrating how a TCP connection is established between a device and the server.To establish a TCP connection between a device and a server, follow these steps:#
First, both the device and the server initialize their respective TCP sockets. The server binds its socket to a specific IP address and port number using the bind() function, and then listens for incoming connections using the listen() function. Meanwhile, the device prepares its socket for the connection.Next, the device initiates the connection by requesting to connect to the server's IP address and port number using the connect() function. Upon receiving this request, the server uses the accept() function to accept the incoming connection. This results in the creation of a new socket dedicated to this specific connection, and the server returns a new socket descriptor along with the client's address.The actual establishment of the connection is completed through a three-way handshake. The device sends a TCP segment with the SYN (Synchronize) flag set to the server to initiate the connection. The server responds with a segment that has both SYN and ACK (Acknowledge) flags set, acknowledging the device's request. Finally, the device sends a segment with the ACK flag set, confirming the connection. Once this handshake is complete, a TCP connection is successfully established between the device and the server, allowing data to be transmitted securely and reliably.Current Brand Integration:Currently, our system supports integration with the following brands:For integrating a new brand with our system, please refer to the New Integration section in the documentation for detailed guidelines and submission instructions. Socket.IO#
Devices supporting socket connections can integrate their data with our system as illustrated below.To establish a Socket.IO connection between a device and a server, follow these steps:#
To establish a Socket.IO connection between a device and a server, the process begins with the server initializing a Socket.IO server instance, which listens on a specified port for incoming connections. On the device side, the client initializes a Socket.IO instance to connect to the server. The client then attempts to establish a connection by specifying the server's URL and port number.Once the connection request reaches the server, the Socket.IO server facilitates the establishment of a WebSocket connection with the client. If WebSocket support is unavailable, Socket.IO seamlessly falls back to alternative transport mechanisms such as HTTP long-polling to ensure connectivity.Once connected, both the client and server can engage in event-driven communication. They can emit events containing data payloads and listen for specific events to trigger actions on either end. Socket.IO supports namespaces, allowing for logical separation of communication channels within the same server-client relationship. Additionally, clients can join specific rooms within namespaces to receive targeted messages broadcasted to those rooms.Socket.IO clients are designed to handle automatic reconnection attempts in case of network disruptions or server unavailability. The server maintains session state, enabling clients to resume their interaction seamlessly upon successful reconnection.Socket.IO's flexibility and robustness make it ideal for real-time applications requiring responsive, bidirectional communication between devices and servers. It simplifies the implementation of features like live updates, notifications, and collaborative functionalities in various web and mobile applications.HTTPS#
Below is a detailed diagram illustrating the process of establishing an HTTPS connection between a device and a server.Establishing an HTTPS Connection Between a Device and a Server#
To establish an HTTPS connection between a device and a server, follow these steps:1.
Server: Configure the server with an SSL/TLS certificate to enable HTTPS. This certificate ensures secure communication by encrypting data exchanged between the device and the server.
2.
Device: The device initializes an HTTPS client instance to connect to the server.
3.
Connection Establishment:Device: The client sends an HTTPS request to the server's URL, including the port number if necessary (typically port 443 for HTTPS).
Server: Upon receiving the HTTPS request, the server authenticates the client (if required) and establishes a secure connection using SSL/TLS handshake.
4.
Key Exchange: The server and client exchange cryptographic keys to establish a secure session.
Certificate Validation: The client verifies the server's SSL/TLS certificate to ensure authenticity and trustworthiness.
Encryption Setup: Once authenticated and validated, the server and client negotiate encryption parameters for secure data transmission.
5.
Secure Data Transmission:Data Exchange: With the HTTPS connection established, the client and server can securely exchange data. All data transmitted over HTTPS is encrypted to protect against eavesdropping and tampering.
6.
Session Persistence: HTTPS sessions can be maintained over multiple requests, allowing for efficient communication between the device and server while ensuring data integrity and confidentiality.
HTTPS provides a secure and encrypted communication channel between devices and servers, making it essential for protecting sensitive data transmitted over the internet. By following these steps, applications can ensure secure and reliable data exchange in various scenarios, including web browsing, API interactions, and IoT deployments where data privacy and security are paramount.MQTT#
Below is a diagram illustrating how an MQTT connection is established between a device and the server.

Establishing an MQTT Connection Between a Device and a Server#
To establish an MQTT connection between a device and a server, follow these steps:1.
Server: Configure and start an MQTT broker (e.g., Mosquitto, HiveMQ) on a specific port. The broker acts as a middleware that facilitates communication between devices (clients) and other clients or applications.
2.
Device: The device initializes an MQTT client instance to connect to the MQTT broker.
3.
Connection Establishment:Device: The MQTT client connects to the broker by specifying the broker's URL or IP address and port number (typically port 1883 for MQTT or 8883 for MQTT over TLS).
Server: Upon receiving the connection request, the MQTT broker acknowledges and accepts the client's connection, assigning it a unique client identifier.
4.
Topic Structure: MQTT communication revolves around topics, which act as channels for message exchange. Topics are organized in a hierarchical structure (e.g., home/livingroom/temperature
).
Publishing: Clients (including the device) publish messages to specific topics using the publish()
method. These messages can contain data such as sensor readings, commands, or status updates.
Subscribing: Clients subscribe to topics of interest using the subscribe()
method. The broker delivers messages published to these topics to all subscribed clients.
5.
Quality of Service (QoS):Message Delivery: MQTT supports different QoS levels:QoS 0 (At most once): Messages are delivered at most once. They may be lost or duplicated.
QoS 1 (At least once): Messages are guaranteed to be delivered at least once to the recipient.
QoS 2 (Exactly once): Messages are guaranteed to be delivered exactly once by using a four-step handshake.
6.
Persistence: The MQTT broker can store the last message published to a topic as a retained message. New subscribers receive the most recent retained message immediately upon subscribing.
7.
Last Will and Testament (LWT):Connection Management: Clients can specify a LWT message that the broker publishes on their behalf if the client disconnects unexpectedly. This feature informs other clients about the disconnection.
MQTT facilitates lightweight and efficient communication between devices and servers, making it ideal for IoT applications, telemetry, and real-time data exchange scenarios. By following these steps, applications can establish a robust and scalable MQTT-based communication infrastructure, ensuring reliable and secure data transmission across distributed networks.Definitions#
Term | Definition |
---|
IMEI | "Device IMEI" typically refers to the International Mobile Equipment Identity, a unique identifier assigned to mobile devices. |
ACK | "ACK" stands for "Acknowledgement." In the context of communication protocols, especially in networking and data transmission, an ACK is a signal or message sent by the receiving system to indicate that it has successfully received and processed a message or data packet sent by the transmitting device. |
Data Array | The "Data Array" refers to the collection of data generated or processed by the device. This data typically includes information such as sensor readings, device status, or any other relevant metrics that the device collects or outputs. |
JWT Token | "JWT Token" stands for JSON Web Token. It is a compact and self-contained method for securely transmitting information between parties as a JSON object. JWTs can be used to authenticate users and securely transmit information over the network. They consist of three parts: a header, a payload, and a signature, which are encoded and can be digitally signed. |
Modified at 2024-07-18 06:23:28