ESP32 stop be stable when it is installed in another location - Page 1
Forum section: electronics / general

author: Fermin1989
author_rank: Newbie
timestamp: October 16, 2023, 03:46:50 pm
content: I describe a problem I have with a system based on an ESP32 microcontroller.After many programming tests that I carried out in the house where I live, I got a stable system (without resets) , but, when I moved it to its destination to my country house, to control irrigation, boiler, hot water, heating, mains water pressure, temperature... etc. , I discover that the system resets randomly many times a day. The only explanation I can find is that the mains current reaches my house with an unusual noise. I have tried different power supplies for the ESP32, but the differences are minimal, and it is independent if I keep the ESP32 disconnected from all the sensors and relays, the problem is always the same.The only option I can think of now is that the power in this house is quite poor (noise), and causes the ESP32 to restart. If anyone could help me or give me some idea on how to proceed I would be very grateful.

author: Bud
author_rank: Super Contributor
timestamp: October 16, 2023, 04:22:44 pm
content: Try powering from a battery. If it will still have problems then the issue may be with strong RF interferrence - you will need to put the device in a metal box to shield it.

author: Lindley
author_rank: Regular Contributor
timestamp: October 16, 2023, 04:25:29 pm
content: Plus what Bud has just said -Its probably not the ESP32 , most Micros can suffer the same problem , which is usually down to the relays and devices they are controlling, things like mains voltage solenoid coils can often be problematic.Try taking out one relay at a time and see what effect it has. Are you using mechanical relays or Solid Statte ones which are less prone to such problems.Also try taking out one sensor at a time to see if the noise is coming via their cables, again what type of temperature sensors are you using.Do you have any mains filtering on your power supply input ? Do you have any contact suppressors across the relays, if mechanical ones ?

author: Fermin1989
author_rank: Newbie
timestamp: October 16, 2023, 04:50:41 pm
content: Thank you for your ideas.I have already tried leaving the ESP32 without any relay or sensor and the problem continues. A good test to know if the problem is coming from the power supply is to power it with a battery. I had thought about installing an EMI filter at the input, but I don't know if it is suitable for this type of device. I'm going to try both procedures, the Faraday cage and if it doesn't work I'll try it with the battery.

author: GromBeestje
author_rank: Frequent Contributor
timestamp: October 16, 2023, 09:06:17 pm
content: As it is an ESP32, are you connecting it to WiFi?May there be an incompatibility with the access point at the new location?

author: Fermin1989
author_rank: Newbie
timestamp: October 17, 2023, 07:50:23 am
content: Yes, it is connected to Wi-Fi, I find this new approach interesting, but I don't understand how it could be related to the ESP32 reset. Could you explain it? Thank you.

author: Ian.M
author_rank: Super Contributor
timestamp: October 17, 2023, 08:26:29 am
content: Another possible cause of crashes is EMI due to the location being 'painted' by a high power radar beam. Is it close to a commercial airport, a military base or facility, docks or other port facilities, or any shipping route or commercial waterway?

author: Psi
author_rank: Super Contributor
timestamp: October 17, 2023, 08:28:01 am
content: Does the WIFI on the ESP32 have dynamic power control? Maybe it is ramping up the output power when out in the field and that is causing brown outs at peak draw. But when at home your near the router and the ESP is ramping down the output power since it's not needed.Just a random guess, try a bigger cap across the ESP32 supply rail, 100uF or something.Wifi can draw quite high peak currents.

author: Fermin1989
author_rank: Newbie
timestamp: October 17, 2023, 08:40:12 am
content: Thanks Ian.M, is not the case.

author: Fermin1989
author_rank: Newbie
timestamp: October 17, 2023, 08:48:25 am
content: Thanks Psi, it might be possible, I'll try to see what happens.

author: GromBeestje
author_rank: Frequent Contributor
timestamp: October 19, 2023, 08:02:49 pm
content: This ain't my personal experience, but a colleague of mine once told if certain energy saving features are enabled on the wifi access point, it may cause the ESP firmware to crash (and thus reboot)

author: kripton2035
author_rank: Super Contributor
timestamp: October 19, 2023, 09:52:44 pm
content: you should try it on another completely different location, to see if it works ONLY at the first place, or it DOES NOT work at the final place.

author: Psi
author_rank: Super Contributor
timestamp: October 19, 2023, 10:33:23 pm
content: Another option might be if the wifi router at the country house is old and does not support the wifi standards correctly, or is just fully of bugs.This maybe is confusing the wifi stack in the ESP32 and eventually it crashes when buffers get to large.There is every reason to think the wifi stack in the ESP32 may have bugs and when you combine bugs in ESP32 with bugs in wifi router you will get crashing as buffers overflow etc... Either router locks up and need restarting or the ESP32 reboots.Try a different router at your country house.

author: Fermin1989
author_rank: Newbie
timestamp: October 20, 2023, 12:08:07 pm
content: Thank you for your ideas.The truth is that I am eager to try all the proposed options, unfortunately at the moment I do not have a scheduled date to go there.Faraday cage.Router.EMI filter.Powered by external battery.Condenser installation.....I'm sure some option will solve the problem. I am betting on interference from the electrical grid input, since there have been many water restrictions due to its scarcity and several neighbors are using electric pumps that, if not properly installed, can cause a lot of noise.As for the result, I'll let you know, and if anyone comes up with something else, I'd be happy to try it.

author: BBBbbb
author_rank: Unknown
timestamp: October 20, 2023, 12:45:50 pm
content: How about something simpler like an unhandled (in SW) unexpected input from the sensors that occurs there on the real system, but not at the test environment at home?But yeah first instinct is power issue and trying from a battery.

author: Fermin1989
author_rank: Newbie
timestamp: October 22, 2023, 02:43:29 pm
content: Hi BBBbbb if you readMy first post i sayd that I did it without success.The batery is a good idea I will try.

author: DavidAlfa
author_rank: Super Contributor
timestamp: October 22, 2023, 03:56:01 pm
content: Stop guessing and fully determine the reset cause:https://espressif-docs.readthedocs-hosted.com/projects/arduino-esp32/en/latest/api/reset_reason.html

author: Fermin1989
author_rank: Newbie
timestamp: October 24, 2023, 07:32:26 am
content: Good and bad news, let's start with the good, I have been in my country house very briefly and I have managed to do a few tests.- External battery test result, everything perfect, no reset.- Second EMI filter test after power input, everything perfect for more than 48 hours without any problem and until now it continues without problems, (I have left the EMI filter installed).Now the bad news, there is water in the area and there are no cuts and therefore no one uses water pumps anymore.Conclusion: There is no problem with the software or hardware under these conditions. I will have to wait until they see water restrictions again to find out if anything has changed.