Chat freely about anything...

User avatar
By betgear
#6186 Hi,

Would it be possible to put a callback function into the MQTT_Publish function so that we can get a confirmation the message has been sent.

The reason for asking this, is that I intend to sleep the ESP8266 after sending a message, however there seems to be no easy way with the task system of knowing when a message has been sent. I did try setting a volatile variable once a message was sent, but a tight while loop "while(var == 0);" causes the task system to lock up. A callback would solve this issue.

Alternatively, is there an equiverlent of the DoEvents() type call, which will allow the task system to keep working, whilst I'm waiting for the variable to be set?

Cheers

Glen.
User avatar
By tuanpm
#6191 Hello Everyone,
There are many things have been resolved at the github issues. Maybe you should check out.
@betgear: I think that it is reasonable, you should create an issue, so you'll know when I finish it.
@r73_pablog: can you show me an example? I think the best way to know when a sensor has lost the link is keepalive timer. And it is available.
User avatar
By ystrem
#6207 Hi, thanks for great job here. :]

I'm playing with this fw, mqtt is great and I wan t to use it in my "project". For now I can turn on/off LED when message arrive. I tried to combine blink example and mqtt, but then it stopped work. I think there is a collision between tasks for mqtt and gpio. I don't know where to call MQTT_Publish periodically. Another thing is that I have problem with loading settings for wifi and mqtt. I don't know if it is only problem with my piece of HW or not. Because, I looked on issues on github, there was this problem, but now is solved.

https://github.com/ystrem/esp8266-node-mqtt