Pretty sure this is a question that probably summarises my (lack of) understanding of MQTT, so apologising in advance.
I am using MQTT to communicate between two devices, and by using QoS 1 I expect that I can publish a message at any time and my subscribing device can pick that message up at any time when it next connects.
So for example, I want to send the following message:
mosquitto_pub -t switch/sign/switch -m "ahoy world!" --qos 1 -d
If I have a subscriber already subscribed to this topic, then it will consume the message (and this bit works well). But if I don't, the message will be consumed as soon as a new client subscribes to the topic (at least that's how I understand QoS).
My understanding is that I should immediately get the message by subscribing as such:
mosquitto_sub -t switch/sign/switch --qos 1 -d
When I subscribe, however, I don't get any messages.
Would appreciate some help here.
Thanks