ESP32 alternatives for industry project

Thread Starter

Gi_T

Joined May 19, 2022
2
Hey. I'm currently working on a mobile battery-driven system used to increase safety in tunnels. At the moment, the system uses an ESP32 to control a fan and brake (digital output) and read some sensors (digital input, I2C, and SPI).

The ESP32 is connected to a PC over USB. The system works well most of the time, but there are problems:
  • The ESP stops working sometimes and isn't resetting even though a watchdog timer is implemented.
  • The USB connection is unreliable at times (no connection to the device, cannot read data, etc.)

Such problems should not occur. That is why we are searching for a way to either improve the current system or replace it with something different (switching to another microcontroller or using a PLC). Here are some requirements for the system:
  • Can read and write digital and analog input/output
  • I2C and SPI support would be great
  • Works in a production environment under harsh conditions (temperature, device shaking while moving, etc.)
  • The system needs to either communicate to an industrial PC over USB or Ethernet or to be able to send and receive data directly over Websockets or some other protocol (it has an internet connection and is programmable)
  • Remote maintenance is also a big plus.

Any advice and help is greatly appreciated.
 

Irving

Joined Jan 30, 2016
2,666
The ESP32 is connected to a PC over USB. The system works well most of the time, but there are problems:
  • The ESP stops working sometimes and isn't resetting even though a watchdog timer is implemented.
  • The USB connection is unreliable at times (no connection to the device, cannot read data, etc.)
Are you using a VROOM module natively or one of the many copycat dev kits?

If you are using devices to implement a safety system you need to check the manufacturer's conditions of use - most exclude life support and safety systems unless specific permission is given.
 
I have not worked with the ESP32, but what I suspect is a communication issue. If it is a system watchdog like the ESP8266 then your program loop completes and returns to system. Since as far as I know the ESP32 doesn't have USB built in, but uses an FTDI type on board it may be a matter of it acting strange.

Several PICs have USB built in and lots of examples and application notes available.

If this is a one of a kind project ignore the safety disclaimers. They're just covering themselves in the event something goes wrong and people try to sue.
 

Ya’akov

Joined Jan 27, 2019
5,659
Welcome to AAC.

Before you jump ship from the extremely capable ESP32 it would serve you well to contact Espressif, the manufacturer, for advice about your application. There is nothing inherently problematic about the ESP32 which is applied in many products.
 

Thread Starter

Gi_T

Joined May 19, 2022
2
Are you using a VROOM module natively or one of the many copycat dev kits?

If you are using devices to implement a safety system you need to check the manufacturer's conditions of use - most exclude life support and safety systems unless specific permission is given.
Thanks for the information. I'm currently using a ESP32 Dev Kit V1, but switching to a different module isn't a problem if it brings some benefits.
 

Ya’akov

Joined Jan 27, 2019
5,659
Thanks for the information. I'm currently using a ESP32 Dev Kit V1, but switching to a different module isn't a problem if it brings some benefits.
Are you using any PCBs that you have designed? The ESP32 modules are the part on the DevKit boards in the silver can. They have castellated solder points on the edge so you can mount the module to your own board. There are also newer DevKit boards, but I think shielding and/or ingress of spikes through the wiring that might be your issue so a different MCU or board may have no effect in fixing it.

Do you have ferrites on the power and signal connections to the board?
 

Irving

Joined Jan 30, 2016
2,666
Thanks for the information. I'm currently using a ESP32 Dev Kit V1, but switching to a different module isn't a problem if it brings some benefits.
I've had a few bad experiences with various "devkits", the quality can be quite variable, whereas the dedicated boards I've designed to use the actual VROOM ESP32 module(s) have been rock-solid. I use an off-board galvanically-isolated USB serial adapter as my devices are usually battery driven (with variable grounding arrangements( so having it isolated removes any guesswork. However, once initially programmed my ESP32 report back, and are managed and updated, "over the air" by Wi-Fi or Bluetooth websockets. USB is only used for initial configuration and real-time debug.
 

MrSalts

Joined Apr 2, 2020
1,762
A common software issue with ESP32 is people using the millis() function and subtracting. The 32-bit clock rolls over ever 7-weeks (just over) and can leave some code hanging if you get a negative number when you subtract last millis() value from current millis() value. If that negative value is used for a while loop condition, you code becomes stuck in the lovely infinite loop.
There are other issues that can cause loop issues that you have to be careful with. I have a controller for my landscaping lights that calculate the on/off time based on my latitude/longitude and it has been running since the last power outage - August 2021. It restarts automatically but I can check a time stamp on wifi to see the time since last restart.
 
The ESP32 is connected to a PC over USB. The system works well most of the time, but there are problems:
  • The ESP stops working sometimes and isn't resetting even though a watchdog timer is implemented.
  • The USB connection is unreliable at times (no connection to the device, cannot read data, etc.)
After a bit more thought I started to wonder if it is possible the ESP appears to stop because for some reason because it is still waiting on data from the USB, or for some reason you have not read all of the data available from the ESP32. Maybe a byte or two left in buffers that gets transferred at the beginning ot the next read or write and throws everything off to the point it looks like things are not working, but technically it still is... just not like it should. I've done it a thousand times myself. Maybe add in a checksum to test and see if sooner or later things don't add up.
 
Top