Hello, I'm wondering if someone knows if there is any generic (lower level) background communication ongoing in MQTT while the client is just connected to the broker and subscribes to topics? And if the node red MQTT nodes eventually adds such things for any reasons?
Why I'm asking is because I plan to use MQTT in a project where the connection between clients and the broker is provided by a 4G gateway so best is of course if no data consumption happens unless some real data is sent or received either way
There is a keep alive ping/pong message exchange that happens in the background. This is about 4 bytes of data in each direction at an interval you can choose through the 'keep alive' setting in the mqtt broker configuration node.
If we're being pedantic, the keep alive interval determines how long the broker will wait for any data from a client before considering the client is dead and should be disconnected. Most brokers offer a 1.5x grace period. Clients will typically send pings (if needed) at something under the keepalive period to ensure they don't get unexpectedly disconnected.
If you're being super-pedantic - it's 4 bytes of keepalive data - which is wrapped in a TCP packet so about 70 bytes one way and 66 bytes tcp ack back.