stefandreyer / CODESYS-MQTT

MQTT client library for CODESYS, supporting all QoS
MIT License
109 stars 24 forks source link

Help needed...... ;-) #55

Closed azanke closed 1 year ago

azanke commented 2 years ago

Hello Stefan and all the other guys!

@stefandreyer : Thank you for sharing your creat work!

I´m using your MQTT Library successful in my project on a WAGO PFC100.

I used your IntegrationHowTo Project and i could Publish and Subscribe to my Topics.

Now I`m running into a problem.....

If I subscribe to a static topic like: v1/devices/me/attributes I´m receiving data without any problem.

To receive control messages for PFC from Thingsboard I need to subscribe to:

v1/devices/me/rpc/request/+

Thingsboard is sending the control messages via Sub Topics.

For example: If I want to switch on the light I will receive the message: {"light":true} on the topic v1/devices/me/rpc/request/1 The next control action will increase the Subtopic by 1. So i receive message on Topic: v1/devices/me/rpc/request/2 And so on for the next messages.

If I subscribe for Topic: v1/devices/me/rpc/request/+ I do not see any messages or sub topics.

Is there a solution to get the message from latest Subtopic?

Would be great if anybody could give me an idea to realize that.

Regards

André

stefandreyer commented 2 years ago

Hi azanke,

trying out your subscription on a user client may bee usfull to see if its ok, like mqtt explorer. If your subscription topic works there it sould in Codesys and my lib too.

you may try else:

v1/devices/me/rpc/request/#

else: how do you check your received topic in the callback? If you use my auto topic FBs incemental topics needs to be handeld different.

Didn't see those until now.

But solvable.

BR Stefan