Get current value after subscription

8 years 8 months ago #3120 by lmaarsen
Hi,

My IoT hardware is working fine, but I can't find a easy way to get the current value of a paramter after I subscribed to that topic. I need a change of value before I get the value.

I read something about the retained flag.

Any idea?

BG,
Bert

Please Log in or Create an account to join the conversation.

8 years 6 months ago #3287 by imsony
I also need same feature. I have terminal and it sleeps in idle and waking up in every 10 minutes. If the value of topic is changed while terminal is sleeping, I want to get last value when the terminal waked. MQTT standard fixed that problem with retained flag. But I could not find how to activte that flag on module properties.

Please Log in or Create an account to join the conversation.

8 years 6 months ago #3288 by Zaitsev
So do I. I found this feature in local EasyIot.exe, but failed to find one on the cloud. :(

Please Log in or Create an account to join the conversation.

8 years 6 months ago #3290 by EasyIoT
Ok, we will add this in Cloud...
The following user(s) said Thank You: Zaitsev, imsony

Please Log in or Create an account to join the conversation.

8 years 6 months ago #3291 by imsony
This is great news, hope to see it soon,

Please Log in or Create an account to join the conversation.

8 years 6 months ago #3305 by EasyIoT
In new Cloud version all topics are retain by default when sending commands. After subscription last value will be received. If you are using ESP8266 to publish value also change code to send state as retain:

myMqtt.publish(topic, valueStr); -> myMqtt.publish(topic, valueStr, 0, 1);
The following user(s) said Thank You: imsony

Please Log in or Create an account to join the conversation.

Time to create page: 0.290 seconds

Forum latest

  • No posts to display.