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

Messages are stucked #1208

Closed
KurabiyeCanavari opened this issue Mar 24, 2019 · 7 comments
Closed

Messages are stucked #1208

KurabiyeCanavari opened this issue Mar 24, 2019 · 7 comments

Comments

@KurabiyeCanavari
Copy link

Hello,
I use 1.5.6 on Raspberry Pi 3 B+. I have a client that send MQTT messages about every 2.5 seconds. It works fine, but sometimes, even messages delivered from client, the broker seems to stack and later delivers it.I don't have any disconnect,the client stays always connected,but there is a timing issue.
Here is what I mean:
Those are the "datetime" information of the received messages, it works great for hours, but sometimes broker delivers late.
2019-03-24 12:01:37.994646
2019-03-24 12:01:40.451249
2019-03-24 12:01:42.934328
2019-03-24 12:01:45.410615
2019-03-24 12:01:47.896808<-The last message received,(but the client keeps sending and connected)
2019-03-24 12:02:12.472799 <- Appears again after some seconds
2019-03-24 12:02:17.606083 <-
2019-03-24 12:02:17.641012 <-|
2019-03-24 12:02:17.671671 <-|
2019-03-24 12:02:17.701272 <-|
2019-03-24 12:02:17.726313 <-|
2019-03-24 12:02:17.753246 <-| All nearly same time which is impossible
2019-03-24 12:02:17.782034 <-|
2019-03-24 12:02:17.795837 <-|
2019-03-24 12:02:18.623139 <-|
2019-03-24 12:02:18.653824 <-|
2019-03-24 12:02:18.688548 <-/
2019-03-24 12:02:20.137160
2019-03-24 12:02:22.609172
2019-03-24 12:02:25.165327
2019-03-24 12:02:27.631511

@ralight
Copy link
Contributor

ralight commented Mar 24, 2019

What client are you using? Do you have some example code that shows exactly how you are publishing?

@KurabiyeCanavari
Copy link
Author

KurabiyeCanavari commented Mar 24, 2019

I use an embedded client, esp32, compiled on ESP_IDF master.
Here is the code:

static void publish_task(void* `arg){
	while(1){
		esp_mqtt_client_publish(client, "/test/topic", "Hello World!", 0, 0, 0); //Mqtt message
		vTaskDelay(2500 / portTICK_PERIOD_MS); // 2500 ms delay
	}
}

@ralight
Copy link
Contributor

ralight commented Mar 25, 2019

Ok, that's pretty clear!

Do you have persistence enabled on the broker, and if so, how big is the persistence file? It is probably in /var/lib/mosquitto/.

@KurabiyeCanavari
Copy link
Author

KurabiyeCanavari commented Mar 25, 2019

Hi ralight,
Yes it is enabled, and is located exactly in the same path you mentioned.
The size of the file is 211 Bytes.

@ralight
Copy link
Contributor

ralight commented Mar 26, 2019

That's not the problem then. Are there any other processes running that might be taking all the CPU resources periodically? Have you been able to verify the behaviour with a different client? I realise that might be tricky if it works for hours at once.

@KurabiyeCanavari
Copy link
Author

I created a local client with python+paho , hosted in the same raspberry pi with the broker, that sends the same data.
I started the server and the client at 25th, and left them working since two days. I checked the logs, and saw the same behavior. (But only happened the first day, the other days are quite reliable).
This makes me think this is not related withe the CPU resources as it did not happen 2 days but only 1 day.

@KurabiyeCanavari
Copy link
Author

Updated 1.5.6 to 1.5.8
Seems like it does not happen with the version 1.5.8. It is working fine since 4 days without any failure. I'll close this issue, if it goes on like this.

@lock lock bot locked as resolved and limited conversation to collaborators Aug 7, 2019
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