Stability of ESP32 vs ESP8266

All ESP32 boards running MicroPython.
Target audience: MicroPython users with an ESP32 board.
mkiotdev
Posts: 10
Joined: Sun Nov 11, 2018 9:12 am

Stability of ESP32 vs ESP8266

Post by mkiotdev » Tue Nov 13, 2018 8:20 am

Hello!

Just wanted to ask here, in the ESP32 subsection of forum. I have opened another topic here:

viewtopic.php?f=16&t=5517

The thing is; my ESP8266 after ~10 hrs of working quite fine; doing one HTTP POST request per minute is crashed/frozen/not iterating through main loop. It is suggested that there are some problems with sockets and memory/garbage collector alltogether.

As I am quite found of the whole ide around ESP and Pytrhon; the question is; whether this issues are less prominent with ESP32? Will ESP32 and it's MicroPython crash/freze less?

Thank you!

User avatar
pythoncoder
Posts: 5956
Joined: Fri Jul 18, 2014 8:01 am
Location: UK
Contact:

Re: Stability of ESP32 vs ESP8266

Post by pythoncoder » Tue Nov 13, 2018 10:58 am

The ESP8266 can be reliable if you choose your board and power supply with care.

ESP32 running official firmware is reasonably stable but it has this problem which in my opinion is a complete deal-breaker.

I'm waiting for the Pyboard D series.
Peter Hinch
Index to my micropython libraries.

mkiotdev
Posts: 10
Joined: Sun Nov 11, 2018 9:12 am

Re: Stability of ESP32 vs ESP8266

Post by mkiotdev » Tue Nov 13, 2018 4:56 pm

Peter,

Seems like you know your way around this, thank you!

About choosing board and power supply. I’ve bought few $5 NodeMCU boards from AliExpress. I can’t say I have put much of a thought into that. Could you please advise me towards which boards would be more stable/better? Would Olimex/Adafruit/Sparkfun be better choice, and wich one? Probably thouse would be better choice; those one of those stand out?

Regarding the power supply, i have 5V 3A Power supply; it was about $10; needed more amps to drive relays.

User avatar
Roberthh
Posts: 3667
Joined: Sat May 09, 2015 4:13 pm
Location: Rhineland, Europe

Re: Stability of ESP32 vs ESP8266

Post by Roberthh » Tue Nov 13, 2018 9:09 pm

Does the freezing correlate with relay operation ?

User avatar
pythoncoder
Posts: 5956
Joined: Fri Jul 18, 2014 8:01 am
Location: UK
Contact:

Application design for stability

Post by pythoncoder » Wed Nov 14, 2018 7:44 am

@mkiotdev My experience of different ESP8266 boards is limited. The reference board (Adafruit Feather Huzzah) and the Adafruit Feather are rock solid. I've found the Wemos D1 Mini to be very good. Aside from those I can't really offer any views other than the general observation that quality varies.

Attention to detail is required in the design of applications for WiFi connected devices. This is because WiFi networks are inherently unreliable: an access point (AP) can go down, the link may briefly be swamped by RF noise, or the unit may move out of range of the AP. Further, the easiest way to crash a device is by failing to close sockets after their use has ended.

Even simple applications need constantly to monitor the state of the network. If the WiFi goes down, all open sockets must be closed. When the network again becomes available sockets need to be created and connections re-established.

Having demonstrated that this works when the AP is temporarily downed, further testing should be done to prove that the mechanism works when the radio signal is degraded rather than suddenly lost. I do this by repeatedly walking the unit out of range of the AP and then back in again. A quick test can be done using a microwave oven - this provides a Faraday cage while enabling you to see any LED's. The door needs to be completely shut so you need to enclose the unit and its power source. I power the device with a battery unit intended for charging mobiles.

Once you have code which reliably recovers after those tests you are in a position to assess the underlying failure rate of the ESP8266.
Peter Hinch
Index to my micropython libraries.

GryKyo
Posts: 15
Joined: Sat Dec 15, 2018 12:43 am

Re: Stability of ESP32 vs ESP8266

Post by GryKyo » Tue Mar 05, 2019 2:51 pm

I would love to have your input on this one, a curious case of resetting CPU caused by electrical noise...

I built an application for roller door automation in an industrial premises using an ESP32 and Micropython. This works superbly on the bench and integrates the roller door control with two ESP8266 elsewhere on the same network using a cloud hosted MQTT broker. The system logs activity using RF tags and all is fine in testing. As soon as the ESP32 is placed within 5m of the switching control any movement of the power contactors causes reboot which in turn causes the contactors to drop in/out with more reboots etc.

I have tested this exhaustively and have an isolated power supply, all I/O is optically isolated. I can power the ESP32 and interposing relays separately off batteries and behavior is perfect until I close the 3ph isolator. When placed >5m away from the switch gear it is only very occasionally unstable and if I place my finger on the RF can of the ESP32 it is 100% stable.

My questions:
Is the ESP32 vulnerable to RF in your experience?
Is this likely a badly worn contactor and I am blaming the ESP32?

Your thoughts most welcome!

Garry

craigzyc
Posts: 5
Joined: Fri Aug 24, 2018 6:47 pm

Re: Stability of ESP32 vs ESP8266

Post by craigzyc » Wed Apr 24, 2019 12:16 am

GryKyo wrote:
Tue Mar 05, 2019 2:51 pm
My questions:
Is the ESP32 vulnerable to RF in your experience?
Is this likely a badly worn contactor and I am blaming the ESP32?
This has nothing to do with micropython or esp32 but I had a similar experience with a device when trying to control a VFD driven pool pump without adaquate grounding. I tried everything, the VFD ground was good, the pool pump ground was good, I put the VFD>Motor wires in a shielded cable, I used an isolator between the control board and VFD. So frustrating.

At the end of the day it turned out the DC power supply I was using wasn't grounded and provided nowhere for the interference to go within the control board. Simply grounding my negative solved all my issues.

No guarantee, but it can't hurt to try.

User avatar
pythoncoder
Posts: 5956
Joined: Fri Jul 18, 2014 8:01 am
Location: UK
Contact:

Re: Stability of ESP32 vs ESP8266

Post by pythoncoder » Wed Apr 24, 2019 8:09 am

@GryKyo Sorry for the delayed response - I was largely off-grid when you posted.

Evidently the contactor is producing a burst of RFI. Your chances of reducing it at source are probably limited as the RFI is probably being radiated by the wiring to and from the contactor. I can imagine that shielding that lot would be impractical. Changing the contactor may help, but I doubt it would fix the problem on its own: they are noisy devices. A solid state replacement might be an option. There may be options of using snubber devices. But unless you are a qualified electrical engineer I would avoid working on three-phase stuff on safety grounds.

If the source is unchanged your electronics must be shielded. You've gone some way towards this with optical isolation. The ideal would be to put the control electronics in an aluminium box with the box connected to earth, with the electronics gnd line connected by a short link to the box. All I/O would pass into the box via feedthrough capacitors. Obviously total shielding is impractical for a WiFi connected device as the antenna would be shielded from the signal: the antenna at least must be exposed.

My approach would be to use a device which can use an external antenna. One option is the Pyboard D, but maybe there are ESP32 devices so equipped. The external antenna would be fed from an SMA connector mounted on the case and connected to the board with a short coaxial adaptor lead.

This stuff can be difficult to get right. I don't think changing the device will help: all electronics is vulnerable to RFI and you need to provide an electrically quiet environment. Good luck.
Peter Hinch
Index to my micropython libraries.

GryKyo
Posts: 15
Joined: Sat Dec 15, 2018 12:43 am

Re: Stability of ESP32 vs ESP8266

Post by GryKyo » Mon May 06, 2019 2:50 pm

Thanks Peter and I reciprocate your apology, I haven't been on here in a week or two!

You put your finger on it I suspect, we are both saying the same thing. The RFI that is causing the ESP32 to restart and my IO to react erratically during restarts is probably not being received through the antenna path on the ESP32. I suspect the interference is finding a "sweet spot" somewhere, either tracks on the pcb or in the silicon where it resonates and amplifies (see my basic knowledge of the black art of radio there!). When the ESP32 restarts and the IO are not held low for example, the contactors click about for a second or two causing more bursts and so on. The whole event sort of decays as the chip stabilizes.

I am considering just mounting the control unit (with the ESP32) safely away from the panel and putting an earthed enclosure around the switch gear to see how this works. It will be a valuable piece of automation for security and convenience if I can get it deployed.

Thanks again for your help!

Garry

cgtan2020
Posts: 7
Joined: Thu May 28, 2020 7:53 am

Re: Stability of ESP32 vs ESP8266

Post by cgtan2020 » Sat May 30, 2020 1:13 pm

pythoncoder wrote:
Tue Nov 13, 2018 10:58 am
The ESP8266 can be reliable if you choose your board and power supply with care.

ESP32 running official firmware is reasonably stable but it has this problem which in my opinion is a complete deal-breaker.

I'm waiting for the Pyboard D series.
Hi Peter,

Any reasons PyBoard D Series is better than ESP32? more reliable wifi? Did you manage to test out the PyBoard D Series?
I am having some problem with ESP32 whereby the AP signal is strong, all parts are not moving but I am seeing some re-transmission of the TCP from my host to the ESP32's AP. 192.168.5.4 is my ESP32's AP, and 192.168.5.5 is my host.

568347 1718.662932 192.168.5.5 192.168.5.4 TCP 68 [TCP Retransmission] 62133 → 10086 [PSH, ACK] Seq=3778295 Ack=1377546 Win=16327 Len=14

My application write about less than 20 bytes but at very high frequency, it is continuous pulling of the sensors state at the ESP32 and reply to PC client.

Now because of the re-transmission, I need to close the socket and reopen to continue which will cause some delay and lost of some data.
So I am thinking of switching to more reliable hardware. :shock: :shock: :shock:

You mentioned power supply, what should be the good supply for a normal ESP32 board which act as AP. Now I am just getting the power from PC 5 volts thru USB. My board is NODEMCU-ESP32, with ESP-WROOM-32.

Thank you in advance.


CGTan

Post Reply