How does the built-in MQTT endpoint work?

So, the current Blynk build starts a netty endpoint for MQTT on port 8440, but I could not find any documentation on how to use this?
I can publish to that broker with mosquitto_pub on any topic, but can’t subscribe on # topic with mosquitto_sub, getting a connection lost error after a few seconds…

Any information on the protocol?

Hello. No docs right now. MQTT was done as the demo for one of our clients and never get developed further. Now I have a bit more time. I’ll try to release some documentation on usage soon.

3 Likes

Ok, thanks, good to know.
I’m trying to figure out from source code and debugging… I’ll try&document what I find.
Actually I think it would be useful to have Blynk as a MQTT client to a separate broker too, would be more flexible IMHO, although I understand it’s a different paradigm than what you had in mind to begin with.

Thanks

What I found out so far:

  1. publish userid is the blynk user and password one of the device tokens
  2. Need to publish on topic named ‘hardware’
  3. payload is the Blynk message, which is then passed onto the Logic processing.
  4. The message is made of pinType pinNumber value separated by space char

Also found a slight bug which is that connecting on MQTT without usid or pw throws an internal NPE which hangs the MQTT connection until timeout, instead of gracefully aborting.

2 Likes

thanks for your answer.
How about port and client ID?