Example sketches for the new Arduino IDE for ESP8266

Moderator: igrr

User avatar
By cal
#20773 I am not aware of any icmp ping client support on the esp but didn't looked at it explicitly.
I think the sdk is based on lwip stack so I would take a look there.
And look through the list of changes of the sdk releases.

As written before I suspect that the tcp stack needs to do foreground work, too.
For that i assume the loop needs to be left in espduino world.

I agree that most projects practice boot and prey for stability issues.

Cal
User avatar
By danbicks
#21032 Update!

Hi guys I am still trying on this and have not given up.

I have stripped the original code back and removed all MQTT elements. The network re connect code is now super stable. Checks network every 20 seconds by the use of a ticker and re establish's connection, with this alone their are no WDT resets and always a guaranteed network connection.

Question: Are there any alternative MQTT library's that work with Arduino IDE and ESP?

How did I come to this conclusion?

I modified the initial sketch to incorporate a push button connected to GPIO 0 that would once pressed connect and subscribe to MQTT broker services.

While monitoring the serial debug window if I did not connect to MQTT server and pull out network re connect all worked fine the system would always re establish network and tick as normal.

If once the network was up and connected and I pushed the button, MQTT would establish a connection and work, receiving message and sending to the broker. In this condition if I power down my wireless router the next time the ticker fires and goes through the normal network checks a WDT reset is encountered.

Summary: It is clear that using the LMleroy MQTT library and re checking network causes a failure.

Getting closer, any alternative MQTT?
User avatar
By bobcroft
#21040 Have you looked at Peter Scargills blog? He is heavily into MQTT on the ESP. however, I believe he uses Eclipse and the MQTT version developed to use under Eclipse rather then the ESP - Arduino set up.

These ESP modules might be low cost but the time spent by many people trying to get them to do relatively basic things must have cost millions in man hours!
User avatar
By danbicks
#21050 Hi Bob,

Yes I have seen Peter's blog on this subject and he uses eclipse I think. I also have eclipse and a native version by Cherts on this platform.

I was hoping to get functional version on the Arduino IDE platform running that should have been relatively easy and would serve for many people here to get their home automation systems up with reliability as the key function.

I totally agree for such a cheap little device far too many hours spent to get some basic operation.

This has halted a couple of my projects for now, I will still try and get to the bottom of this, and hopefully when Igrr gets some time he could have a little look in to this.

Thanks for your input :)

Dans