Example sketches for the new Arduino IDE for ESP8266

Moderator: igrr

User avatar
By gambituk
#15778 Yes, i've done different things to feedback and verify correct operation on a different platform, for example on arduino i've done digitalread to check the current state of the pin in question and published to a topic if it's state has changed from previous state, so everytime i send a command to the remote device over mqtt i expect a echo back on a different topic from the remote target, and if i dont receive it then i resend and timeout. I will try to test if it will work on esp and leave it as an example if it does. i guess it's just a complicated way of emulating qos by means of a feedback loop.

I really feel that this combination of esp and arduino ide will be the best option for accelerating and developing this community, and the more useable examples we can provide, the more examples and useable code will in turn be made available.

Gambit
User avatar
By CptanPanic
#15790
MeNoGeek wrote:Thanks, Gambit! That example's pretty useful. (I guess the publish part was written by the library's author, Nick O’Leary: http://knolleary.net/arduino-client-for-mqtt/.)
danbicks wrote:how do we make sure that a message published was actually received?
That would require a QoS of 1 or 2, but only 0 is supported by the PubSubClient library, AFAIK :( So I guess some kind of automatic publishing would be needed from the broker or another client.
Tuan's MQTT library does support all three levels of QoS, as well as other features that PubSubClient lacks.
https://github.com/tuanpmt/esp_mqtt
I wish someone could make it available in the Arduino environment.


Yes I agree and wish a library that had QoS > 0 was available for the arduino platform.
User avatar
By gambituk
#15810 Toshi, thanks for posting, i'm sure the coding is very good, but this subforum (ESP8266 / Arduino) is specifically for using the arduino ide for creating and uploading to the esp8266 , there is another section for Lua/nodemcu code, so personally i cannot test as i prefer this method of control.

Regards

Gambit