Problem with MQTT

Problem with MQTT

supportPHJ4A
Observer Observer
11 Views
5 Replies
Message 1 of 6

Problem with MQTT

supportPHJ4A
Observer
Observer

[ FlexSim 23.2.3 ]

Hello, When I use FlexScript to establish an MQTT connection, sometimes the connection can become unstable and disconnect. When the connection is restored, FlexSim will reconnect, but FlexSim will not automatically subscribe to messages after reconnecting. If the model is in a stopped state at this time, is there a way to make FlexSim automatically subscribe? Or, besides ondrawtrigger, is there a trigger that can trigger logic when the model is in a stopped state?

0 Likes
Accepted solutions (1)
12 Views
5 Replies
Replies (5)
Message 2 of 6

Jeanette_Fullmer
Community Manager
Community Manager

@Luciano Cavallero, @Tancredi Canonico, @Fiorenzo A, can you please take a look at this emulation-related question?

0 Likes
Message 3 of 6

jason_lightfootVL7B4
Autodesk
Autodesk
Accepted solution

MQTT should handle the disconnect/reconnect for you but you should set cleanStart to 0 when you initialize the client and make sure you're using a clientID string that isn't empty.

Also you shouldn't need a loop (which you seem to be asking for) - the messaging is handled asynchronously once subscribed, independently of any draw/model events.

Message 4 of 6

tancredi_canonico
Not applicable

Are you using the MQTT class or MQTT connection in the Emulation module?

0 Likes
Message 5 of 6

supportPHJ4A
Observer
Observer

Thank you for your reply.

0 Likes
Message 6 of 6

supportPHJ4A
Observer
Observer

Yes, it is.

0 Likes