I've successfully connected an MQTT topic in an Adafruit "io" feeder, loaded the data by an “UIflow” using the MQTT topic's publish function. I also was able to connect a MQTT PAHO client written in a Python code, using a subscribe function for my topic: “myuserid/feeds/myqueue/json”.
As long there is a real-time situation, I see the MQTT message recording in the feed, as well as the data reception at the client. There remains two open questions, regarding the following scenarios:
. Why the Adafruit feed (acts as MQTT broker) does not delete the records once the subscribed data was successfully delivered by the MQTT protocol. Is this possible by a setup option?
. What happens when a MQTT subscriber temporarily goes “off-line”? Is it possible to receive records written in past reading it from the feed queue? Is this available as an automatic process in order to synchronize the subscriber without any data loss?
Thanks for guidance.
MQTT Publish (ESP32) and Subscribe (Paho software client)
Moderators: adafruit_support_bill, adafruit
Forum rules
If you're posting code, please make sure your code does not include your Adafruit IO Active Key or WiFi network credentials.
If you're posting code, please make sure your code does not include your Adafruit IO Active Key or WiFi network credentials.
- falbriard
- Posts: 2
- Joined: Mon Nov 22, 2021 8:53 am
- brubell
- Learn User Page
- Posts: 2011
- Joined: Fri Jul 17, 2015 10:33 pm
Re: MQTT Publish (ESP32) and Subscribe (Paho software client
You may disable feed history from the feed page itself on io.adafruit.com/feeds/. Why the Adafruit feed (acts as MQTT broker) does not delete the records once the subscribed data was successfully delivered by the MQTT protocol. Is this possible by a setup option?
You can - please see this documentation about retained values here: https://io.adafruit.com/api/docs/mqtt.h ... ned-values. What happens when a MQTT subscriber temporarily goes “off-line”? Is it possible to receive records written in past reading it from the feed queue? Is this available as an automatic process in order to synchronize the subscriber without any data loss?
- falbriard
- Posts: 2
- Joined: Mon Nov 22, 2021 8:53 am
Re: MQTT Publish (ESP32) and Subscribe (Paho software client
Thanks a very precise answer. It helped to identity the reason for the data loss. This is a known and pending issue at the UIFlow software, as there is yet missing the support for the retain flag. Hope the M5stack team will fix this soon.
Forum rules
If you're posting code, please make sure your code does not include your Adafruit IO Active Key or WiFi network credentials.
If you're posting code, please make sure your code does not include your Adafruit IO Active Key or WiFi network credentials.