Hi!
So, I've written an HTTP server for my Arduino and it works like a charm with every type of client software from PC/Chrome, FF, IE, Android/FF, to a goddamn smart TV, but for the love of God, it won't work with Chrome/Android.
I've made so that the client side of this project (written in JavaScript) sends only one HTTP request at a time to make sure the Ethernet Shield doesn't refuse the multiple connections.
After an Arduino reset, the first load from Android/Chrome is OK, the second one is sometimes OK, but after that it won't load again until an Arduino reset. In the meantime every other device/browser combination works well, even after dozens of page loads and hours of use.
The connections are most likely closed properly (the EthernetClient's disconnect function is called) after the response has been sent by the server, but I am still not sure if the problem is not with running out of sockets on the W5100. How do I check that?
I attached images of Chrome's networking debugger (or whatisitcalled), that shows how exactly the load fails and how it should look like, the delays between the requests are intentional.
I will probably attach Wireshark data too, but as making the Arduino connect to my home network via my laptop makes the latter go BSoD (because of the network interface bridging, thank you Windows 10), I might have to hack together a solution with OpenWRT and port mirroring on a SOHO router and that might take time, energy and most importantly, effort.
It is worth noted that at TCP level, the delays are caused by TCP reset from the Arduino, that much I could find out before my blood pressure became to high to continue with the systematic BSoDs.
Images: The goddamn Android/Chrome project - Album on Imgur
Hardware:
Server: Arduino Mega 2560 with an Ethernet Shield (W5100)
Client: As mentioned above
Software:
Server:
Arduino Ethernet library and Wiznet Ethernet library both tested, same results
ejeklint's websocket implementation (might be this?)
I will share a code snippet at some point, but it takes some time to strip down my server/client code (as it is long as frick) to a readable length that is still working, and I'm hoping that the problem is not with that.
As always, any help/remark/guess is appreciated!
Thank you for reading this far!
G.