homieiot / convention

🏡 The Homie Convention: a lightweight MQTT convention for the IoT
https://homieiot.github.io/
Other
705 stars 59 forks source link

Protocol Buffer for the payload? #285

Closed michcfr closed 3 weeks ago

michcfr commented 5 months ago

Hello, Is there any plan that Homie uses the Google Protocol Buffer for the payload? It enable compact mqtt messages. This is for example what Sparkplug mqtt is using.

I don't know if it is a good idea, I just wanted to share and discuss about this opportunity.

Michel

Tieske commented 5 months ago

Not likely. The current draft for version 5 doesn't change the format, and if anything introduces some JSON elements (single topic device description).

It was discussed however, here's my recollection of why not;

michcfr commented 5 months ago

Thank you for the response. The not makes sense. May we get access to the draft for version 5? Thx

Tieske commented 5 months ago

It's in the homie5 branch

Thalhammer commented 3 weeks ago

As already outlined by Tieske, protobuf has been discussed before and a decision has been made in favor of json, mostly because of its wide availability. Homie mostly uses mqtt topics for structure, so the only message that would really benefit from it is the description topic. As lined out by #287 we will likely add a binary type soonish, which means you can send arbitrary binary data there (including protobuf).

I personally would have loved to move to protobuf for its DSL and codegen features, but I have to agree, that especially in IoT devices json support is often already built in the firmware while pb would need extra space.

I assume this is resolved, if not feel free to reopen @michcfr.