MQTT publish/receive examples

0
Hello, I'm currently working with the MQTT publish/receive examples from the Siemens documentation: Publish example • Siemens.Simatic.S71500.Communication library • Reader • Industrial Operations X Documentation   The PLC connection itself works fine. I can confirm that the connection to the PLC is established. However, when I call: // setup mqtt with the connection, receive sink and a clientId mqtt.Configure(connection := connection, sink := sink, clientId := "MQTT-Publish"); I get the following warning in the development environment:  Possibly partial assignment between classes. Only fields of 'Ip4AddressConnection' type are copied.  st(Core.PartialAssignmentBetweenClasses)   I tried changing the variable declaration from: connection : Ip4AddressConnection; to: connection : Siemens.Simatic.S71500.Communication.OpenUser.Ip4AddressConnection; But unfortunately, that didn't help. The warning still appears and the clientId is most likely not applied. As a result, the MQTT client connects with a default or empty ID, and messages are not properly received.   Has anyone encountered this issue or found a proper way to resolve it? Thanks in advance.
asked
1 answers
1

Hi Vanessa,

 

Thank you for the question.  While we do see a compiler warning when calling the mqtt.Configure method, clientID is still applied successfully.  See below for how our clientID is picked up by our MQTT broker.

 

Configure and connect with MQTT:

mqtt-configure

 

Confirm the configured clientID is passed to our broker (Mosquitto):

mqtt-testClient

 

Our teams will investigate the compiler warnings to see if there are any other implications.   In the meantime, I hope that this provides some assurance that the process is still working as intended.   

 

Best regards,

Daniel

 

 

answered