dl9rdz / rdz_ttgo_sonde

266 stars 93 forks source link

Unable to connect to MQTT #208

Closed ZL1LAC closed 2 years ago

ZL1LAC commented 2 years ago

I can seem to get my ttgov2 to connect to the MQTT server. I get the following error.

Client <unknown> disconnected due to protocol error

The username and password are correct, I can connect to the server using MQTT explorer just fine, what am I missing?

dl9rdz commented 2 years ago

Thanks, yes, this was broken (has always been, surprising that it did not cause more problems before).

ZL1LAC commented 2 years ago

Hi, I just fixed it for myself.

I changed the MQTT client ID value from rs41 to just 41, rebooted, and now it's happy.

image

dl9rdz commented 2 years ago

Well, not really, the bug is that the mqtt placed the dynamically generated client id (from the config, but appending a random number) on the stack. This value can and will be overwritten later while the mqtt library is using it. So basically it is rather unpredictable if it will work or not. I would say the observation that it worked now for you is not due to the id change, but to luck.

Anyway, I just commited a fix for that issue, so now it should be fine.

ZL1LAC commented 2 years ago

Oh alright, when the fix be live? I got an expected sonde launch in about an hour.

dl9rdz commented 2 years ago

It already is. Since 10 minutes ago.

ZL1LAC commented 2 years ago

Ah cool so update my ttgov2 LoRa then?

dl9rdz commented 2 years ago

Yes, should be good to update.