Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

get MQTT subscription status #2977

Closed
euzun41 opened this issue Jan 10, 2024 · 3 comments
Closed

get MQTT subscription status #2977

euzun41 opened this issue Jan 10, 2024 · 3 comments

Comments

@euzun41
Copy link

euzun41 commented Jan 10, 2024

Hello,

I'm unable to receive messages on the topic I've subscribed to in my client software developed using the libmosquitto C APIs.

I've checked the logs on the broker's side and didn't notice any disconnection message on my connection. There doesn't seem to be an issue with my connection on the client side either because I can publish to message different topic.

My problem is that after a certain period (ex: one week no problem), messages from the subscribed topic stop coming through.

@PepeMax
Copy link

PepeMax commented Jan 11, 2024

Hello,

It's surprising that after a while you don't receive any messages. I've had C programs running for months and I've never had this problem.

Where do the messages come from? Isn't that where the problem is coming from? Try running a mosquitto_sub -d in parallel with your program to activate debug mode and redirect its output to a file to check that you're receiving all the messages.

Then I need more information to help you: where the messages come from, on which broker and where is your C program in your computer network (local network, cloud, etc.)?

Then the last thing is that you use Wireshark, 1 on your machine which sends the messages to see if you send them well, one on your broker and another on your machine where your C program is.

Bye

@euzun41
Copy link
Author

euzun41 commented Jan 11, 2024

Hi @PepeMax, thank you for your response message.

I am checking on a different machine and listening to the same topic now. I am wondering, is there any way to get the subscription status from the broker to the client?

In my case: all devices are same LAN, client to client communication.

Best regards

@euzun41 euzun41 closed this as completed Jan 15, 2024
@euzun41
Copy link
Author

euzun41 commented Jan 15, 2024

Okay, I found. I can call the 'mosquitto _subscribe' function to get the status periodically. Sorry.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 5, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants