Olimex Support Forum

Microcontrollers => ESP32 => Topic started by: MeisterQ on November 18, 2022, 01:22:37 PM

Title: ESP32-EVB Ethernet restarting and code not working
Post by: MeisterQ on November 18, 2022, 01:22:37 PM
Hello,

i got a problem with my ESP32 EVB Board.

Im using a Sketch to get Data over Softwareserial (GPIO13 and 16) and converting it, to transmit it via CAN.

On CAN im using GPIO5 and 35. So everything works fine untill im uploading the Code again to the Board.

After uploading it, the Ethernet LEDs keep going on and off within 5 or 10 seconds. Code is not working in this moment.

After pressing the reset Button afew times, it start working normally untill im uploading a new sketch (Im using OTA Upload).

Now i found out on wiring diagram, GPIO0 is connected to LAN8710A and Q50MHz.

By any chance, somebody know if OTA Upload, or LAN connection to this board, or any GPIO im Using influences the board by booting in any relation?

Im sure, it worked great, untill i addet all the Serial stuff which is using GPIO13 and 16.

But in wiring diagram, this 2 GPIOs only are connected to UEXT connector for SCL and SDA.

Im using REV I

Thanks alot.
Title: Re: ESP32-EVB Ethernet restarting and code not working
Post by: LubOlimex on November 18, 2022, 01:42:55 PM
Out of the 4 pins you mentioned (GPIO5, GPI35, GPIO13, GPIO16) only GPIO5 might affect anything since it is bootstrapping pin.

Try to put delay at the start. This might fix the issue. Like if you are using Arduino just right after

void setup(){

delay(1000);

On a side note, try our CAN library and example for ESP32-EVB from here:

https://github.com/OLIMEX/ESP32-EVB/tree/master/SOFTWARE/Arduino%20IDE%20examples/CAN_library_and_examples
Title: Re: ESP32-EVB Ethernet restarting and code not working
Post by: MeisterQ on November 18, 2022, 02:01:46 PM
Hello,

thank you for your reply.

Yes GPIO5 is connected to CAN, but CAN Transceiver does not get influenced by anything.

Ive put the delay on setup and i will try uploading code and will give a feedback if it worked.

Thank you
Title: Re: ESP32-EVB Ethernet restarting and code not working
Post by: MeisterQ on November 19, 2022, 02:55:17 PM
So ive uploadet the Code yesterday afew times and with this delay, the restarts are less, but still present.

What could i do?
Title: Re: ESP32-EVB Ethernet restarting and code not working
Post by: MeisterQ on December 09, 2022, 01:56:30 PM
Hello together.

I still having this trouble with the Ethernet-Restarting EVB Board.

Im using newst ESP32 JSON, im using newst Librarys. I dont know what to do anymore.

Please help
Title: Re: ESP32-EVB Ethernet restarting and code not working
Post by: LubOlimex on December 09, 2022, 03:04:02 PM
But did you try this library exactly:

https://github.com/OLIMEX/ESP32-EVB/tree/master/SOFTWARE/Arduino%20IDE%20examples/CAN_library_and_examples

There are some specifics on the CAN which is described there namely:

"The two examles ESP32-EVB_CAN and ESP32-EVB_CAN_Relay_Toggle were written for Olimex and there is description on the usage inside each example.

This library is patched version of the original: https://github.com/miwagner/ESP32-Arduino-CAN by Michael Wagner

The patch includes a fix suggested in this pull request: miwagner/ESP32-Arduino-CAN#33 to resolve the differences between modules caused by the ECO3 feature of Espressif on ESP32-WROOM-32E: https://www.esp32.com/viewtopic.php?t=15581

It also has 2 extra examples specifically for Olimex board ESP32-EVB rev.I.

Without this patch new and old ESP32-WROOM can't communicate through CAN with each other due to the halved speed of the new modules or you should double the CAN speed of the ESP32-WROOM-32E."
Title: Re: ESP32-EVB Ethernet restarting and code not working
Post by: MeisterQ on December 09, 2022, 03:12:33 PM
Hi,

thanks for your reply.

I think the main problem is caused by this: https://github.com/espressif/esp-idf/issues/5965 (https://github.com/espressif/esp-idf/issues/5965)

After a hard-reset, everything is working great. CAN Communication is established, devices are reachable over IP, but after uploading a new sketch via OTA, OR sending an "ESP.restart()" on software, the esp cant establish its network connection anymore.

The lights on the Ethernet-Port are going on for 2 seconds, then turning off, turning on, turning off, etc untill i press the reset button or do a powercycle.

I also addet the 1 second delay on void setup() already. Nothing helped.
Title: Re: ESP32-EVB Ethernet restarting and code not working
Post by: LubOlimex on December 12, 2022, 09:09:47 AM
Did you try with ESP.reset() instead?

I think it is this issue:

https://github.com/espressif/arduino-esp32/issues/6142
Title: Re: ESP32-EVB Ethernet restarting and code not working
Post by: MeisterQ on December 13, 2022, 02:11:59 PM
So, what do you think is the solution for this now?