marvinroger / async-mqtt-client

📶 An Arduino for ESP8266 asynchronous MQTT client implementation
MIT License
835 stars 266 forks source link

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

Open tobiasjaster opened 2 years ago

tobiasjaster commented 2 years ago

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?

bertmelis commented 2 years ago

You can only subscribe/publish/unsubscribe when connected.

tobiasjaster commented 2 years ago

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