0

MqTT server
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

MqTT server

by mobility on Sun Mar 10, 2019 2:47 am

How can I set up to save the pub information, for example: I have an offline device that does not receive the subscription information, I hope that this device can get the subscription information when rebooting or networking. I tried to receive the subscription information only when the device is online. I can't get the latest information after rebooting or re-networking. I don't know how to set it up. Please advise, thank you.

mobility
 
Posts: 2
Joined: Sun Mar 10, 2019 2:38 am

Re: MqTT server

by KarelKotrba on Mon Mar 11, 2019 7:21 am

Hello mobility,
do you mean this? See https://learn.adafruit.com/welcome-to-a ... entation-2
paragraph "Retrieving the Last Published Value"

KarelKotrba
 
Posts: 2
Joined: Tue Jan 29, 2019 5:20 am

Re: MqTT server

by brubell on Tue Mar 12, 2019 9:53 am

Can you post your code? What device are you using? You should be able to use the /get modifier (we don't support the retain flag with our MQTT broker) as a workaround: https://learn.adafruit.com/welcome-to-a ... alue-16-10

brubell
 
Posts: 282
Joined: Fri Jul 17, 2015 10:33 pm

Re: MqTT server

by mobility on Tue Mar 12, 2019 10:04 pm

feeds.png
feeds.png (20.42 KiB) Viewed 39 times

Thank you very much for your answer. I read the documentation. I built an onoff/get in the feeds, then I ran {mosquitto_sub -h io.adafruit.com in the dos window -p 1883 -u mobility -P 9b411f5748054f1f8d11e7a741193a34 - t mobility/feeds/onoff} Subscribe to the onoff message, and run {mosquitto_pub -h io.adafruit.com -p 1883 -u mobility -P 9b411f5748054f1f8d11e7a741193a34 -t mobility/feeds/onoff/get -m "\0"} to Sends the message to "mobility/feeds/onoff /get" , but I didn't receive the mobility/feeds/onoff message, please help me find out, I understand where the problem is wrong, thank you very much.

mobility
 
Posts: 2
Joined: Sun Mar 10, 2019 2:38 am

Please be positive and constructive with your questions and comments.