Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect TCP packets when using W5500 with ESP32 #106

Open
jozala opened this issue Jul 15, 2019 · 13 comments
Open

Incorrect TCP packets when using W5500 with ESP32 #106

jozala opened this issue Jul 15, 2019 · 13 comments

Comments

@jozala
Copy link

jozala commented Jul 15, 2019

While using ESP32 with W5500 it sometimes sends malformed packet. Time periods between malformed packets differs significantly - from few seconds to couple of hours.
I've found this problem when using PubSubClient for MQTT where it caused client to be disconnected from MQTT broker.

To isolate the problem I've prepared very simple TCP server and I've been sending TCP messages to it with ESP32+W5500 in a single connection, continuously. It usually starts failing after few hours, then it breaks from time to time (sometimes within seconds, sometimes works for hours). I do not have this problem with ESP32 WiFi connection.

I've tried with another ESP32 and another W5500 with the same effect.

Please find Wireshark file with section of captured packages attached (packet number 15 is the problematic one).
raw_TCP_incorrect_incoming_packet.zip

Libraries with versions

Hardware used:

DOIT Esp32 DevKit v1
Wiznet W5500

Wiring between ESP32 and W5500

GPIO23 <--> MOSI
GPIO19 <--> MISO
GPIO18 <--> SCLK
GPIO5 <--> SCS
GPIO13 <--> RESET

Additional information

TCP server is set up in local network.
Simple implementation used to reproduce problem: https://github.com/maniekq/ESP32_W5500_TCP/blob/master/src/main.cpp#L73
Simple TCP server implementation: https://github.com/maniekq/servertcp-esp32

@jozala
Copy link
Author

jozala commented Jul 25, 2019

Is there any additional information I could add to make it more clear?
It would help me if someone could check if this is reproducible.

@Rotzbua
Copy link
Contributor

Rotzbua commented Jul 26, 2019

It would help me if someone could check if this is reproducible.

I can not help you because I do not own the hardware, but if it should be "reproducible" you have to describe your wiring and build environment (versions).

@jozala
Copy link
Author

jozala commented Jul 27, 2019

Thanks @Rotzbua. I've added now missing information.

@jcmertz
Copy link

jcmertz commented Nov 7, 2019

I have been having this same issue repeatedly I believe, but hadn't gotten to this level of diagnosis! Have you had any luck finding a solution?

@jozala
Copy link
Author

jozala commented Nov 7, 2019

Unfortunately, I haven't found any solution yet. I've spent a lot of time trying to figure it out, but without good results. It happens quite rarely and
occurs with random frequency which makes it really hard to track down. I am using WiFi connection for now, but I would like go back to this at some point.

@SjefFransen1
Copy link

Unfortunately, I run in the same problem, and not yet found a solution for it? Somebody else with this problem?

@MathieuDeprez
Copy link

MathieuDeprez commented Apr 10, 2020

Hi,
I think that I had the same problem and I kind of find a solution. here is the link to my answer :
aetas/RoomHub#9 (comment)

@JAndrassy
Copy link
Contributor

Hi,
I think that I had the same problem and I kind of find a solution. here is the link to my answer :
aetas/RoomHub#9 (comment)

so powering. if the module can be powered with 5 V from USB, it works. if it is powered with the ESP32 from 3.3 V regulator, it has brown-outs

@MathieuDeprez
Copy link

MathieuDeprez commented Apr 10, 2020

Hi,
I think that I had the same problem and I kind of find a solution. here is the link to my answer :
aetas/RoomHub#9 (comment)

so powering. if the module can be powered with 5 V from USB, it works. if it is powered with the ESP32 from 3.3 V regulator, it has brown-outs

Actually, I am powering both of the modules with a 5V regulator which give enough power. So the ESP32 don't directly power the module. So I don't think this is a powering problem.

@JAndrassy
Copy link
Contributor

JAndrassy commented Apr 10, 2020

Hi,
I think that I had the same problem and I kind of find a solution. here is the link to my answer :
aetas/RoomHub#9 (comment)

so powering. if the module can be powered with 5 V from USB, it works. if it is powered with the ESP32 from 3.3 V regulator, it has brown-outs

Actually, I am powering both of the modules with a 5V regulator which give enough power. So the ESP32 don't directly power the module. So I don't think this is a powering problem.

you power the small wiz850io pinout compatible module with 5 V?!

@MathieuDeprez
Copy link

Hi,
I think that I had the same problem and I kind of find a solution. here is the link to my answer :
aetas/RoomHub#9 (comment)

so powering. if the module can be powered with 5 V from USB, it works. if it is powered with the ESP32 from 3.3 V regulator, it has brown-outs

Actually, I am powering both of the modules with a 5V regulator which give enough power. So the ESP32 don't directly power the module. So I don't think this is a powering problem.

you power the small wiz850io pinout compatible module with 5 V?!

I have no words ........ ^^" Yes, I was powering the small w5500 with 5V and he seemed to survived because now, since I am powering it with 3.3V, I don't have any deconnexion .. ^^"
So forget about all I said, I haven't found any solution but in my case, the mqtt connexion seems to be very stable so maybe, some libraries were updated since the beginning of that topic.

@ale-trevizoli
Copy link

Hi all.
Someone have tested it before using another 3.3v supplier and connecting gnd of esp32 and other supplier together?
Anyone can test it?

@MathieuDeprez
Copy link

Hi @ale-trevizoli, If you are using a external supplier, you don't has other choice but to connect the GNDs together (All GNDs of an installation should be connected together). This is what I have done and it works perfectly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants