async-mqtt-client icon indicating copy to clipboard operation
async-mqtt-client copied to clipboard

Doesn't receive (onMessage callback) retained Message after subscription

Open tobiasjaster opened this issue 2 years ago • 2 comments

I am trying to handle short mqtt connections between long (60s) deep sleep sessions.

Sequence:

Start WiFi connect, wait connected Mqtt set callbacks Mqtt connect, wait connected Get variables from ulp and publish Disconnect mqtt & wifi Start Deep Sleep

Before mqtt connect I subscribe to an update-request. After connection I would like to handle incoming retained topic, but never receive anything.

Anyone getting retained Message working?

tobiasjaster avatar May 29 '22 07:05 tobiasjaster

You can only subscribe/publish/unsubscribe when connected.

bertmelis avatar May 29 '22 08:05 bertmelis

Doesn't get the topics retained message, if I subscribe after WiFi und mqtt connected

tobiasjaster avatar May 29 '22 09:05 tobiasjaster