Welcome, Guest
Username: Password: Remember me

TOPIC: Get current value after subscription

Get current value after subscription 10 months 1 week ago #3120

  • lmaarsen
  • lmaarsen's Avatar
  • Offline
  • New Member
  • Posts: 5
  • Karma: 0
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
The administrator has disabled public write access.

Get current value after subscription 8 months 1 week ago #3287

  • imsony
  • imsony's Avatar
  • Offline
  • New Member
  • Posts: 5
  • Karma: 1
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.
The administrator has disabled public write access.

Get current value after subscription 8 months 1 week ago #3288

  • Zaitsev
  • Zaitsev's Avatar
  • Offline
  • New Member
  • Posts: 11
  • Karma: 0
So do I. I found this feature in local EasyIot.exe, but failed to find one on the cloud. :(
The administrator has disabled public write access.

Get current value after subscription 8 months 1 week ago #3290

  • EasyIoT
  • EasyIoT's Avatar
  • Offline
  • Administrator
  • Posts: 773
  • Thank you received: 248
  • Karma: 23
Ok, we will add this in Cloud...
The administrator has disabled public write access.
The following user(s) said Thank You: Zaitsev, imsony

Get current value after subscription 8 months 1 week ago #3291

  • imsony
  • imsony's Avatar
  • Offline
  • New Member
  • Posts: 5
  • Karma: 1
This is great news, hope to see it soon,
The administrator has disabled public write access.

Get current value after subscription 8 months 1 day ago #3305

  • EasyIoT
  • EasyIoT's Avatar
  • Offline
  • Administrator
  • Posts: 773
  • Thank you received: 248
  • Karma: 23
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 administrator has disabled public write access.
The following user(s) said Thank You: imsony
Time to create page: 0.197 seconds
Powered by Kunena Forum