Error diagnosis
The following chapter provides useful information for error diagnosis, if application scenarios are not functioning as expected.
Behavior | Category | Description |
---|---|---|
Connection to message broker cannot be established | Establishing the connection | Check whether the message broker can be reached in principle from the system on which the Tc3_IotBase is executed (e.g. using another MQTT client). If the message broker cannot be reached, check your firewall settings. For an MQTT communication, the outgoing TCP port (1883 or 8883 if TLS is used) must be open by default on the MQTT client (the computer that runs the Tc3_IotBase). On the message broker side, these ports must be open for incoming messages. If the Tc3_IotBase is used, the port configuration can be checked via the input parameter nHostPort at the function block FB_IotMqttClient. |
Connection to AWS IoT cannot be established | Establishing the connection | Check whether the AWS IoT URL can be reached in principle from the system on which the Tc3_IotBase is executed (e.g. using another MQTT client). This also provides an opportunity for verifying the certificates for the connection. If the other MQTT client cannot establish a connection, check on the AWS IoT management website whether the certificates are valid and active. If AWS IoT cannot be reached, check your firewall settings. For an MQTT communication with AWS IoT, the outgoing TCP port (8883) must be open by default on the MQTT client (the computer that runs the Tc3_IotBase). If the Tc3_IotBase is used, the port configuration can be checked via the input parameter nHostPort at the function block FB_IotMqttClient. |
Connection to Azure IoT Hub cannot be established | Establishing the connection | Check whether the AWS IoT URL can be reached in principle from the system on which the Tc3_IotBase is executed (e.g. using another MQTT client). This also provides an opportunity for verifying the CA certificate for the connection. If the other MQTT client cannot establish a connection, check whether the CA certificate is valid. If the Azure IoT Hub cannot be reached, check your firewall settings. For an MQTT communication with the Azure IoT Hub, the outgoing TCP port (8883) must be open by default on the MQTT client (the computer that runs the Tc3_IotBase). If the Tc3_IotBase is used, the port configuration can be checked via the input parameter nHostPort at the function block FB_IotMqttClient. |
The connection cannot be established after a CRL update. The variable eConnectionState shows the following value: MQTT_ERR_TLS_VERIFY_FAIL | Establishing the connection | The certificate of the message broker was revoked. In this case, please contact the operator of the message broker for further information. |
After using an invalid topic in the meantime (e.g. a wildcard at the wrong position "testtopic#") the connection of the MQTT client to the broker toggles | Establishing the connection | After using an invalid topic TwinCAT must be restarted. Please make sure that no invalid topics are used. |
Messages do not arrive at the Azure IoT Hub | Publish | Check whether the messages are published to the correct topic. The topic structure is fixed for the Azure IoT Hub, based on a naming scheme that cannot be changed. Check whether your MQTT settings are valid and whether the Azure IoT Hub supports them. For further information consult the Beckhoff notes on establishing a connection to the Azure IoT Hub or the MSDN documentation. |
Messages do not arrive at IBM Watson IoT | Publish | Check whether the messages are published to the correct topic. The topic structure is fixed for IBM Watson IoT, based on a naming scheme that cannot be changed. Check whether your MQTT settings are valid and whether IBM Watson IoT supports them. For further information consult the Beckhoff notes on establishing a connection to IBM Watson IoT or the IBM Watson documentation. |
Messages content is not detected as a valid JSON message by the subscriber | Publish | Check whether the JSON document you are trying to send is valid. The Tc3_JsonXml library from Beckhoff provides support for creating valid JSON documents. Check whether the correct length information (nPayloadSize) is transferred when the publish method is called and that not too many data (null) are located after the actual payload. |
No properties for the corresponding event are detected at IBM Watson IoT | Publish | Check whether the correct length information (nPayloadSize) is transferred when the publish method is called and that not too many data (null) are located after the actual payload, in which case IBM Watson may not be able to recognize the message as a valid JSON message. |
During the conversion of incoming MQTT messages, Node-RED reports to the JSON function "Ignored non-object payload" | Publish | Check whether the correct length information (nPayloadSize) is transferred when the publish method is called and that not too many data (null) are located after the actual payload, in which case Node-RED may not be able to recognize the message as a valid JSON message. |
The connection to the message broker is suddenly interrupted in between. | Subscribe | Check if on the topics you subscribed to, a message exceeding the maximum message size (cMaxSizeOfMqttMessage) may have been received. In this case, the MQTT client driver disconnects from the broker. |