Centiloc Service Documentation
Toggle Dark/Light/Auto mode Toggle Dark/Light/Auto mode Toggle Dark/Light/Auto mode Back to homepage

Connection Status

Boards have two simple states CONNECTED and DISCONNECTED. This section describes how to move from one to another, depending on Board’s connectivity. This may help you to understand the information returned by the Data Platform.

More than a simple connection status, this status provides the information that the Board is healthy and is capable of running as expected.

This includes network performance, supply stability, Wi-Fi bandwidth…

1. Wi-Fi Connection

1.1. to CONNECTED

💡 A Board is indicated as CONNECTED as soon as it has published a Hello message to Centiloc Data Platform.

To do so, the Board must:

flowchart LR

classDef class_blue fill:#00aec2,color:#fff,stroke-width:0px;
classDef class_start fill:#00aec2,color:#fff,stroke:#4a4a49,stroke-width:2px;
classDef class_error fill:#b51f1f,color:#fff,stroke:#4a4a49,stroke-width:2px;
classDef class_success fill:#a2c617,color:#fff,stroke:#4a4a49,stroke-width:2px;

Z("1. Connect to NTP Server"):::class_blue --> A("2. Connect to Wi-Fi"):::class_blue --> B("3. Connect to MQTT Broker"):::class_blue --> C("4. Publish Hello"):::class_success

If, for any reason, one of these step fails, the status doesn’t switch to CONNECTED.

1.1.1. NTP Server Connection

The Board attemps to connect to UDP port 123 of either:

  • Standard ntp fr server pools
  • Host Data Platform (⬅️ important in case on OnPremise disconnected from internet)

1.1.2. Wi-Fi Connection

The network must be accessible, in 2.4GHz only. Password must be set.

1.1.3. MQTT Broker

Depending on its configuration, all these steps must be successful to complete MQTT Broker connection:

  • The Board connects using User and Password

v5+ Boards:

  • The Board attempts to establish SSL handshake
    • Check Server certificate validity and signature by Centiloc CA
    • Presents its Certificate, signed by Centiloc CA
  • The Board connects using User and Password

v4- Boards:

  • The Board attempts to establish SSL handshake
    • Check Server certificate validity and signature by Let’s Encrypt CA
  • The Board connects using User and Password

v5+ Boards:

  • The Board attempts to establish SSL handshake
    • Skip check of Server certificate validity and signature
    • Presents its Certificate, signed by Centiloc CA
  • The Board connects using User and Password

🚫 v4- Boards: not supported

1.1.4. Publish “Hello”

Finally, the Board attempts to publish a “Hello” message on a specific topic.

  • The Board must have the authorization to publish.
  • The message must be correctly formatted.

1.2. to DISCONNECTED

There are some conditions that could make the Board turns to DISCONNECTED status.

1.2.1. Transport Layer disconnection

MQTT manages to check the good connection of its registered clients by standard KeepAlive exchanges.

In case the Board disconnects from MQTT Broker (because of Wi-Fi or ethernet…), and doesn’t answer KeepAlive procedure, the Board will turn into DISCONNECTED status (internally, a LastWill is generated).

🕰 This only happens at the end of the KeepAlive procedure (which includes timeouts and retries), which takes few minutes (up to 4 minutes worse case).

1.2.2. Application Layer disconnection

In addition to this MQTT timeout, the Data Platform checks the connection of Boards which sound inactive.

To do so, it automatically pings every mute Boards at regular period (🕰 approximately 10 minutes).

If a Board doesn’t answer Ping, it will be turned into DISCONNECTED status.

2. Serial Connection

💡 A Board is indicated as CONNECTED as soon as the gateway it is connected to publishs a Hello message to Centiloc Data Platform and the Board answers a Ping.

Indeed, in the schema, the Gateway is responsible of the connection of the Board with the Data Platform which tracks its Board Connection status.

Therefore, the Gateway must first manage its own Connection Status (the same way as a Wi-Fi Board). Then it can transmit Data Platform pings to its connected Boards, on demand of the Data Platform (See Gateway documentation).

In other words, the Connection Status of Serial Board is only updated after Pings, whether they are automatic or generated by users.

3. User Ping

User can check a Board connection by pinging it. The Board doesn’t need to be CONNECTED to send a ping.

  • If the Board’s status is DISCONNECTED and the Board answers to the ping, its status will be automatically updated to CONNECTED.
  • The opposite is the same, if the Board’s status is SCONNECTED and the Board doesn’t answer to the ping, its status will be automatically updated to DISCONNECTED.