Example sketches for the new Arduino IDE for ESP8266

Moderator: igrr

User avatar
By mugginsjm
#36508 Hi
I'm in need of some help. My goal is to use an ESP-12 to scroll text using a chinese 32x8 led matrix (2 of in fact).
I have already battled my way through most of the problems including row-wise fonts and have now got it working. I want it to subscribe to several MQTT topics and scroll the message twice.
The issue I have is that whilst the text is scrolling the callback function does not see the next incoming MQTT message and I don't know how to resolve this. I think this project might be useful to others and am happy to post my (novice) sketch.
Any guidance appreciated.
John
User avatar
By bobcroft
#37454 John, I am not certain of the exact cause of your problem but on taking a look at your code I see a delay(70) in the display update. I would suggest changing that to a non blocking delay. My logic is that if a subscribed message comes in during that delay it will be missed. I believe the issue is to do with persistence of messages, the Arduino / ESP pubsubclient library only has a QOS of 0 which means the message is sent but there is no further try to sent or confirmation of receipt.
If you look at the website of hiveMQTT there is a brilliant tutorial series on MQTT .
If you know how to use the Eclipse environment using the Espressif SDK then there is a more fully functional MQTT client available from TuanPm.
Hope that helps

Bob
User avatar
By mugginsjm
#37501 Hi Bob
Thanks for your advice on this. I have already tried non blocking delay but for some reason it scrolls partially and then collapses with a "wdt reset". I'm at a loss here. Also I think that the PubSubClient by Knolleary supports QOS. I've messed with that too but to no avail.
thanks
John