cancel
Showing results for 
Search instead for 
Did you mean: 
SOLVED

Program Loaded - EXCEPTION when MQTT FB connecting to broker

Program Loaded - EXCEPTION when MQTT FB connecting to broker

AndroidzZ
New Contributor

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

10 REPLIES 10

CDSAddons
Established Member

Hi,

could we get the information which version exactly is used in your application,

if it is MQTT version 1.2.0.0 could you please give the 1.3.0.0 a try?

And please do a click on the line in the plc logger to get more information for this exception.

I'm using MQTT 1.3.0.0 for both the mqtt libraries. There is no more information I can get. double click and right mouse click do nothing on the error line

georkueh
Community Moderator
Community Moderator

Hello CDSAddOns,

today we had a session with the customer.

This is the program sequence, when the error occurs:

georkueh_1-1673598650148.png

We saw the issue happening after setting the MQTTClient FB input xEnable To TRUE. It never returns and program stops working, when the watchdog occured. There's no Call stack available :-(.

Here you can see the instance data in case of the watchdog

georkueh_0-1673598442701.png

When the cable to the broker is unplugged everything works fine.

How we can go on, to get more details regarding the root cause?

kind regards

 

CDSAddons
Established Member

Hi,

without having the project- to review - hard to help.

Possible to get the projectarchive?

Hi,

Im sorry but For confidential reasons, I cannot share this project with just anyone. However, you are welcome to join me in an online meet to watch or something similar.

Kind regards

CDSAddons
Established Member

we think the basic problem is probably that the name resolution from your device does not work.

Endpoint 'xxxxxxxxxx.eu-west-1.amazoneaws.com' ist not reachable from the ctrlx.

 

 

That endpoint has worked without trouble before. As i compare the endpoint in the PLC program and from the AWS, they are identical: 

AndroidzZ_0-1675343888860.png

To connect with the AWS broker the right set of certificates is needed.

Hello,

 

the problem described above occurs when we want to go outside via with the CORE via our 4G router. With a 4G connection, the Router automatically configures a DNS address. (This could be a problem?)

If we connect the CORE to our corporate network we do not get a 'watchdog EXCEPTION' error. The mqtt client does come up with a "TCP_INT_ERROR". What could be the nature of this error? We have checked our settings.

AndroidzZ_0-1676389038522.png

Kind regards

 

 

 

CDSAddons
Established Member

A TCP_INIT_ERROR occurs when no connections can be made to the server (SysSock2Connect) or when no socket can be created (SysSock2Create).

Possible causes:

Client certificate not installed/expired correctly (see product datasheet for installation instructions).
Firewall blocks port 8883
Server IP or host not reachable

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.

 

Icon--AD-black-48x48Icon--address-consumer-data-black-48x48Icon--appointment-black-48x48Icon--back-left-black-48x48Icon--calendar-black-48x48Icon--center-alignedIcon--Checkbox-checkIcon--clock-black-48x48Icon--close-black-48x48Icon--compare-black-48x48Icon--confirmation-black-48x48Icon--dealer-details-black-48x48Icon--delete-black-48x48Icon--delivery-black-48x48Icon--down-black-48x48Icon--download-black-48x48Ic-OverlayAlertIcon--externallink-black-48x48Icon-Filledforward-right_adjustedIcon--grid-view-black-48x48IC_gd_Check-Circle170821_Icons_Community170823_Bosch_Icons170823_Bosch_Icons170821_Icons_CommunityIC-logout170821_Icons_Community170825_Bosch_Icons170821_Icons_CommunityIC-shopping-cart2170821_Icons_CommunityIC-upIC_UserIcon--imageIcon--info-i-black-48x48Icon--left-alignedIcon--Less-minimize-black-48x48Icon-FilledIcon--List-Check-grennIcon--List-Check-blackIcon--List-Cross-blackIcon--list-view-mobile-black-48x48Icon--list-view-black-48x48Icon--More-Maximize-black-48x48Icon--my-product-black-48x48Icon--newsletter-black-48x48Icon--payment-black-48x48Icon--print-black-48x48Icon--promotion-black-48x48Icon--registration-black-48x48Icon--Reset-black-48x48Icon--right-alignedshare-circle1Icon--share-black-48x48Icon--shopping-bag-black-48x48Icon-shopping-cartIcon--start-play-black-48x48Icon--store-locator-black-48x48Ic-OverlayAlertIcon--summary-black-48x48tumblrIcon-FilledvineIc-OverlayAlertwhishlist