mqtt_udp icon indicating copy to clipboard operation
mqtt_udp copied to clipboard

QOS implementation ideas

Open Adesin-fr opened this issue 5 years ago • 0 comments

Hi

Some thoughts about QOS implementation : In facts, I was looking for such a protocol for my home automation : I have almost the same devices than you I think, and I'm trying to move from my old-fashioned stuff to ESP8266. For now, I still use MQTT with broker, but it is not ideal.

What I have imagined, was an UDP protocol , with "associations" between nodes. ie : A push button is associated to one or multiple lights. Let's say our button has device ID 1, and it is binded to lights n° 2 and 3; So we have a "mapping settings file" on our button node, which is in facts, the list of node which MUST ACK the messages coming from n°1.

When n°1 sends a message, we do publish on his regular topic. We then have a look on the "settings file" to see which devices are binded to this topic. If there is no device binded, then we don't care about ACK. If there is one or more devices, we will wait for X ack to arrive, and then we will be able to send the message again if the ACK is not there after the timeout. If n°2 has sent the ACK , but not n°3, n°2 will have to discard the message when it will receive it again. So, it mean that each message must have an ID, and a node must keep track of last received messages ID, so we can discard a duplicate message.

This is a quick idea, might be ok, and might be wrong !

Adesin-fr avatar Jun 17 '19 07:06 Adesin-fr