Hello everyone,
I’m currently working with a program that counts objects and logs the results to a webserver (ASMX) after a minute of inactivity. However, after a recent network/firewall update, I’ve noticed that the expected response from my webservice is not being received in most cases (only about 4% of all requests receive a response).
This issue is consistent across different hardware and libraries, including the Arduino UNO using Ethernet2.h, as well as the new OPTA light using PortentaEthernet.h and Ethernet.h. Interestingly, this issue does not occur in my regular network or at home in a test environment.
Here’s a simplified version of the code I’m using to send data:
if (client.connect(server, 80)) {
// Send data
client.print(…..) // Data is always correctly sent and stored
// Wait for a response
while (client.connected() && !client.available() && mt < 7000) {
delay(5);
mt++;
**// Connection is lost here in most cases**
}
// Read incoming data
while (client.available() > 0 && mt < 3000) {
int i = client.read();
}
// Clean up
client.flush();
client.stop();
}
In most cases, the loop runs about 15 times before the connection is lost. However, this is not always the case.
When debugging, I usually get the following output:
Available:0
Connected:1
Available:317
Connected:1
HTTP/1.1 200 OK
Cache-Control: private, max-age=0
Content-Type: text/xml; charset=utf-8
Server: Microsoft-IIS/10.0
X-AspNet-Version: 4.0.30319
...
But more often than not, I get:
Connected:1
Available:0
Connected:1
Available:0
Connected:0 // Disconnected with no reply
I’m unsure of what could be causing this issue. Any insights would be greatly appreciated.