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

mosquitto_pub fails on 1.0.0 but works on <= 0.9.18 #71

Open
richievos opened this issue Apr 4, 2023 · 4 comments
Open

mosquitto_pub fails on 1.0.0 but works on <= 0.9.18 #71

richievos opened this issue Apr 4, 2023 · 4 comments

Comments

@richievos
Copy link
Contributor

I just updated to the 1.0.0 tag in an attempt to resolve some memory leaks I believe are occurring from TinyMqtt. After updating I can no longer connect to TinyMqtt.

Output under 0.9.18:

$ mosquitto_pub -d -h 192.168.0.70 -p 1883 -t foobar -m '{}'
Client null sending CONNECT
Client null received CONNACK (0)
Client null sending PUBLISH (d0, q0, r0, m1, 'foobar', ... (2 bytes))
Client null sending DISCONNECT

Output under 1.0.0:

$ mosquitto_pub -d -h 192.168.0.70 -p 1883 -t execute/measure_alk/manual/next_stepasdf -m '{}'
Client null sending CONNECT
Error: A network protocol error occurred when communicating with the broker.

I'll debug more, but posting in case others see connectivity issues in the meantime.

@richievos
Copy link
Contributor Author

richievos commented Apr 4, 2023

Works in bf84e29. First stops working in e41452e.

Issue appears to be this this line:

// old
if (keep_alive && (millis() >= alive))
// new
if (keep_alive && (millis() >= alive - 5000))

what's that - 5000 about? Is that something accidentally left in after testing?

richievos added a commit to richievos/TinyMqtt that referenced this issue Apr 4, 2023
I'm not sure what the 5000 is representing, but having it there breaks connectivity for me.

hsaturn#71
@richievos
Copy link
Contributor Author

I sent a PR removing that -5000: #72

I'm not sure what that is representing, so I'm not sure how to test ramifications. This version works for me though.

@dg6nee
Copy link

dg6nee commented Apr 4, 2023

I vote a "+1", similar here, I created a fork quite a while ago and addressed the problem of memory leaks due to bad MQTT client handling (AFAIR pr23). This old version works on two of my devices, stable for many weeks.
I tried the latest official versions, but these still fail after less than one day. Same symptoms, device is still active (web server still works), but MQTT is dead, does not respond...

richievos added a commit to richievos/TinyMqtt that referenced this issue Apr 4, 2023
I'm not sure what the 5000 is representing, but having it there breaks connectivity for me.

hsaturn#71
richievos added a commit to richievos/TinyMqtt that referenced this issue Apr 4, 2023
I'm not sure what the 5000 is representing, but having it there breaks connectivity for me.

hsaturn#71
richievos added a commit to richievos/TinyMqtt that referenced this issue Apr 13, 2023
I'm not sure what the 5000 is representing, but having it there breaks connectivity for me.

hsaturn#71
@hsaturn
Copy link
Owner

hsaturn commented Apr 16, 2023

PR about 5000ms merged

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants