-->
Page 1 of 1

I need your help/examples

PostPosted: Tue Jul 14, 2020 12:34 am
by julezparker
Hello everyone,

I try to keep it as short as possible,
I'm running several different devices built with NodeMCU Boards (ESP8266) in my house like a wifi speaker, doorbell, doorlock, door camera, lighting controls, wireless sockets, and so on.

Over the years I've faced problems with random reboots and losing connection.
I've logged everything, I've changed my router, I've changed to fixed IP, I've tried several power supplies, I've tried original and chinese board types, I have tried PLENTY of different wifi codes but the problem always stays the same. i've googled my butt off to find a solution but nothing ever helped and I'm getting tired thinking about buying an expensive arduino with ethernet shield. I don't wanna steal ur precious time to show you the thousands lines of codes or logs that I got. So i'm kindly asking for an example script of a system from one of you that's been working for a long period of time now without any problems. Also what power supply are you using, any hardware modifications (caps, diodes) etc.

I need an example script which I can be sure that's working 100% cz anything else won't help me.

Thank you in advance!

Re: I need your help/examples

PostPosted: Wed Jul 15, 2020 3:52 am
by pangolin
In my experience, this type of problem is 99% a problem with the code, either yours or a library you are using. One of the things to do is to check the the serial output and see if you are getting e.g. a watchdog timer reset.

If you are using MQTT there is an obvious "usual suspect" which has a serious bug that randomly disonnects and reconnects.

If not, then the only way forward is to see the entire code of one of your sketches and all the error messages it displays.

Re: I need your help/examples

PostPosted: Sun Jul 19, 2020 3:18 am
by eriksl
Check power supply, reset and enable lines. The power supply should be rock-solid and the reset + enable lines should be decoupled from power with a resistor (to +V) AND a capacitor (to GND). They are VERY sensitive to noise.

If you've done that, the ESP8266 is rock solid and it must a bug in the code.

Mind you that the SDK is code too and yes there are bugs there too.

I've managed to minimise the use of any foreign code (including SDK) and my ESP's are rock solid. Please note that it is not so easy to write really good, robust code, especially in C. Many pieces of code have stack overruns or alignment errors lurking around and these are very hard to find.