Jump to content
Alberto Fornés

Subscribe to a topic with TIcsMQTTClient

Recommended Posts

Hi, I have a Mosquitto server that publishes messages and I can subscribe to it using programs like MQTT Explorer. By testing with TIcsMQTTClient, I can connect to the host and port (it also uses a username and password) and it validates. I subscribe to a topic, but I don't receive any messages like I see in MQTT Explorer. Is there anything I should check that could be causing me to not receive the messages?

Share this post


Link to post

First place to look would be the Mosquitto log file, maybe subscribe failed for some reason.  

 

I did test the latest version against local and remote Mosquitto servers, but my knowledge of the MQTT protocol is almost nil so I don't know what to expect when I click the various test buttons.

 

Angus

 

Share this post


Link to post
2 hours ago, Alberto Fornés said:

 I subscribe to a topic,...

Did you receive a SUBACK response when you subscribed?

 

Share this post


Link to post

My  Mosquitto log shows exactly that. 

 

2025-03-21T12:51:02: Received SUBSCRIBE from CID64860
2025-03-21T12:51:02:     update/memo (QoS 2)
2025-03-21T12:51:02: Sending SUBACK to CID64860

 

Angus

 

Share this post


Link to post

This is the Mosquito log when connect to server:

 

Quote

1747327152: New connection from 192.168.1.130:52181 on port 1883.
1747327152: New client connected from 192.168.1.130:52181 as CID52177 (p1, c0, k10, u'keeptrack_cajas').
1747327152: Will message specified (19 bytes) (r0, q2).
1747327152:     will/CID52177
1747327152: Sending CONNACK to CID52177 (0, 0)
1747327152: Received SUBSCRIBE from CID52177
1747327152:     lectura/cajas/+ (QoS 1)
1747327152: CID52177 1 lectura/cajas/+
1747327152: Sending SUBACK to CID52177

 

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×