Program Loaded - EXCEPTION when MQTT FB connecting to broker

Hello,

I'am using the IIoT library for the use of the mqtt client and the AWS mqtt client. All of a sudden since a few days (it worked before) I get an EXCEPTION [Watchdog] error in PLC engineering when the mqtt client OR the AWS mqtt client tries to connect with the broker. The weird part is that it worked this morning and after stopping and starting the PLC program I get the error again. When I disconnect the core from the outside the error is not showing up. But when the mqtt FB's are able to connect to the broker (outside of the network) the EXCEPTION [Watchdog] occurs. I'm 100% certain that the AWS and the 'normal' mqtt broker are up and running. 

I have tried a Ping and a NTP server FB, which connects to the outside aswell, and they work both without a problem.

In the attachment there is a screenshot of the error inside codesys and the logbook of the ctrlX CORE. Other things i could try to find the solution to this problem? 

Kind regards

Best reply by AndroidzZ

Hello,

i wanted to give an update.

The 'Program loaded - EXCEPTION' watchdog error was triggered by using a 4G router. it seems that the DNS from the AWS broker is not accepted by the DNS server. Choosing an alternative DNS server is not possible for a 4G router. So we continued on our own company network. After this, the watchdog error was resolved.

With the help of CodeSyS we found the problem for the 'TCP_INIT_ERROR'. The 'TCP_INIT_ERROR' occurred because we removed and reinstalled the signed certificate from AWS on the core. We did this because it was installed twice.

When the CSR file is generated, then a key pair (Private/Public) is generated on the PLC. From the CSR file a signed certificate is generated by AWS. If the certificate is deleted, then the key pair on the PLC is also deleted and no connection can be established even when the certificate is imported again. In this case a new CSR file has to be created and the signed certificate has to be imported again.

 

View original
Log Codesys.JPG
220.83KB
Diagnostic_Log_mqtt_FB_EXCEPTION_2023-01-12_10-50-11.csv
2.49MB
10 replies