lasselukkari / aWOT

Arduino web server library.
MIT License
283 stars 41 forks source link

net::ERR_CONNECTION_REFUSED using ethernet #150

Closed infrafast closed 1 month ago

infrafast commented 1 month ago

Hello, thanks for your lib. I use it with ESP32-S3 and the ethernet server fix you provided

When using WiFi, all works good,

when using ethernet, I get net::ERR_CONNECTION_REFUSED on (random) file, for instance when the client try :

GET http://192.168.0.81/medium.gif net::ERR_CONNECTION_REFUSED

On the server side (ESP) I get no trace, that medium.gif has been requested.

Any help appreciated. BR

lasselukkari commented 1 month ago

The server code really doesn't know where the connection is coming from. Is it wifi or ethernet or what ever. It just uses the client interface that is common to all client classes. The error you are seeing indicates that the ethernet part refused the whole connection. If there is no connection there is nothing for the web server to process.

My suggestion is to verify that your ethernet connection is working in the first place using some sketch that does not use any external libraries. See the examples of your ethernet connection library.

infrafast commented 1 month ago

Thank you for having a look to that. I tested the ethernet connexion : working good. The issue is that it serves the pages and content until a certain point. Then, it stops. This is difficult to reproduce so I'll try to further investigate and providde more details,. This will take a while so we can keep the issue closed for the time being.

lasselukkari commented 1 month ago

Sounds like there is a memory leak or something similar somewhere if it works at first and then stops responding.

I would suggest removing ALL other code and included libraries and replacing the handler functions with print calls that just emulate your expected responses. Does it still give you the problems? If it does please provide a minimum example sketch that reproduces the problem.