Esp8266 MQTT dropping offline

Hello,

So I am running the following sketch https://github.com/w1ll1am23/pivot_power_genius_mqtt/blob/master/pivot_power_genius_mqtt.ino that I created for the Quirky Pivot Power Genius (Wink power strip) on 2 esp8266’s one of them is working great and the other I just set up yesterday and I am having issues with it. I am getting tons of disconnects and reconnects. I am pretty confident that they are using different client IDs since the first one is still working great. Can anyone think of a reason it would be dropping offline? Has anyone had issues with WiFi interference or anything with their esp8266s? This is my first time using a wemos d1 mini I have used the Adafruit and the Nodemcu before and haven’t had this problem.

I’m using a few Wemos D1 minis. Mine will sometimes do it and I’m not sure why. Its never really an issue as they will just disconnect and reconnect again. Of course I’m running ESPEasy on all of mine and it only really happened on older firmwares.

EDIT: Subscribe to the state topics and make sure that both devices are using unique IDs and such.

I have 3 ESP8266’s running homemade motorised blinds, controlled through MQTT. The log shows that overnight (when no one is in the room) they never disconnect. During the day when two iPads are often being used there are occasional disconnects. This suggest that WiFi interference is the cause of the disconnects for me.

So I have done quite a bit of testing and even running the most basic MQTT script (the example esp8266 in pubsubclient) doesn’t work. In fact that basic script is the worst on, the wemos disconnects every second and then reconnects. I have never had this issue with any other eps I have used.

I wonder if the power supply could be a factor? I use a 2 amp supply and have a 470uF capacitor across the supply.

Maybe, but I would think that would be an issue with other esps as well. Not sure the amps on the supply in the powerstrip but with nothing attached to the esp and pluged in via USB to my computer the test pubsubclient script fails.

Are both dropping or just one? Are you just using basic MQTT? have you tried another firmware?

A lot of people use the Wemos stuff for a lot of projects, not just on here, and they work. If its just one dropping out it could be a bad device, if its both then it could be they are conflicting with each other.

One devices is running on an adafruit huzzah and the other a wemos. The adafruit works fine the wemos doesn’t. I agree that others are using them fine just stange that I have tried 2 and they both won’t work with the basic mqtt sketch. I guess I should also mention these are generic wemos from eBay not the official ones so maybe they are just duds.

I would try ESPEasy or something along those lines before giving up. I’ve bought mine from China, Amazon, Ebay and they’re all different and I’ve no issues other than with older firmwares. At this point what do you have to lose other than an hour of your time?

1 Like

I’ll take a look. Thanks.

I loaded Tasmota on it, and so far it seems to be running fine. I tried getting ESPEasy to run, but didn’t have any luck getting it to compile in the Arduino IDE. Going to let the Tasmota stuff run over night and see how it is.

1 Like

Well tasmota has been workijg for 12+ hours now without dropping offline. Couldn’t get 15 minutes on my sketch. Thanks for the suggestions. Pretty sure tasmota is using pubsubclient under the covers so I am still confused but glad it’s working.

ESP8266 is great but when it comes to software stability, then you have very few options. The best of them is of course Mongoose OS. Industrial-grade system based on FreeRTOS.

https://mongoose-os.com