Problem with setting Callback node for MQTT connection

Problem with setting Callback node for MQTT connection

fiona_k
Not applicable
144 Views
4 Replies
Message 1 of 5

Problem with setting Callback node for MQTT connection

fiona_k
Not applicable

[ FlexSim 24.1.0 ]

I have an issue with setting the callback node for my MQTT connection over FlexScript. First I set up the client like it's said in the user manual. That worked fine, I tested a couple of messages sent from the FlexSim model to my MQTT broker. Then I tried to receive a message from the broker using the client from the treenode with getMessage(). This also worked fine. Just the next step with setting up the default callback caused problems. I wanted it to listen to the broker and give me the topic and message whenever something is published on the broker, but I don't get any info. Maybe I messed it up during the configuration. This is how my callback node looks like (it's also linked in the client treenode).

2024-05-21-15h46-11.jpeg

Unfortunately I cannot upload the whole model.
It'd be really helpful, if you see my mistake or if someone can provide a model with a working callback node, so I can compare if mine is set up correctly. Thank you in advance.

145 Views
4 Replies
Replies (4)
Message 2 of 5

jason_lightfootVL7B4
Autodesk
Autodesk
Have you built the node as FlexScript? Did you remove the getMessage call? The syntax looks correct.
0 Likes
Message 3 of 5

fiona_k
Not applicable
I did both, but still don't get anything printed
0 Likes
Message 4 of 5

jason_lightfootVL7B4
Autodesk
Autodesk

Here's an example you can use to cross reference. It has two scripts - one to publish to the broker and another to subscribe to the topic. To test it I would first publish (retaining the message) and then subscribe to check you can receive the message.

TestMosquittoEclipseProject.fsm

Message 5 of 5

Jeanette_Fullmer
Community Manager
Community Manager

Hi @Fiona Kattenstroth,

We haven't heard back from you. Were you able to solve your problem? If so, please add and accept an answer to let others know the solution. Or please respond to the previous comment so that we can continue to help you.

If we don't hear back in the next 3 business days, we'll assume you were able to solve your problem and we'll close this case in our tracker. You can always comment back at any time to reopen your question, or you can contact your local FlexSim distributor for phone or email help.

0 Likes