im running a small webserver on the stm32f103 with an attached w5500. The Service is requesting values vomr an array and returning it as a json result. But unfortunatly after some time (maybe an hour), the webserver does not respond anymore. I was using Firefox.
Some Tests i did already:
– the system was running over night without any requests. but after a few requests in the morning, it stopped again.
– i changed the w5500 to a diffrent one
– until it stopped, im running a request every second.
Update:
– Tested with Microsoft Edge => Same Problem
– Set Firefox http.max-connection and websockets.max-connection both to 4 in FF. Now running test. Update: I was running the test for more than 3h. And all was fine ![]()
So it has somethign to do with requests. Its running hundreds of request, but than it suddenly stopped. Maybe i did something wring in the code – i dont know. Help wld be vy appreciated.
Thanks for looking into it and a great easter time,
Mike.
i found this ctime-fix from you while searching for that issue :p its hard to debug a failure, if it takes up to an hour to see it happen… Maybe its something different than https://github.com/arduino-libraries/Ethernet/issues/42 or not.. Hmm..
But i can say, that this also did not help. The thing which is working for hours without a problem is setting the http-max-connection and websockets to 4 or lower. this helped.. but with this connection config, its hard to browse other pages…
It seems its similar to the problem u discussed with roger some time ago.. but even harder… i dont know if the controller is hanging, or just client.connect returning 0. Is happening after 20min… or after 1h..
So greeting to munich from nuremberg – if u have time, we cld discuss this a little deeper. PM? And many thanks for answering ![]()
Mike.
I spent that time several hours to debug the sockets with no clear conclusion what could go wrong.
But now, having regard to that I implemented ESP-01 web sockets via AT commands, I realized that it is not that easy to handle multiple sockets in the same time. While you handle one socket, the other socket can receive data which should also be handled, otherwise you can block sockets.
I think I have to go deep in W5500 sockets again and monitor their behavior.
Btw, I also experience sometimes (once per week) that the chip is not accessible from extern. So I think there can still be an issue.
There are so many thing to do, just the time ingredient is missing…
yes. so we have to live with it or find a solution. but it’s not that easy to debug. I’m running about 500-3000 Ajax-requests, until it’s happening..
so the only workaround this to limit Firefox max connections for websockets and http to lower than 4. I’m using 2 right now. or create a proxy on a webserver so u can be sure, ur proxy handling the requests to ur w5500 – with only one connection…
maybe u will find the time to look into it. until than, webserver on a device using the Ethernet lib will be in danger of the problem..
yours, Mike.
You can buy an ST-Link debugger/programmer to see where your code stucks.
You can try my Ultra simple STM32 debugger software + Arduino IDE to do the debugging.
yes, i do have a st-link debugger. But how to start with it? Just start the program like in your example and then it will stopp working and u see where in the code?
Mike.
Run the debugger on the same Windows PC (I say Windows PC because you said “Microsoft edge”).
Go to settings and select the .elf file. To see where the .elf file was created, enable the <compile> option from Arduino IDE preferences.
On debuger click on <Connect> . When your sketch freeze, click on <pause>. You will see where your program execution is paused.
Before that, make some tests with some other sketch to see how (and if) the debuger works properly.
sorry, i had no time for debugging yet. I am using (almost) the same code just on different plattforms like uno with w5500 or mega with w5500. But never got those problems there. So it looks like it has something to do with the ethernet-library ?!
Mike.
but if the led stop blinking, it may mean the program ‘crashed’? e.g. a memory leak?
