Wio Terminal fails to download >=8k objects using HttpClient and WiFiClientSecure

I am trying to access data at api.weather.gov, and while I can get data for objects less than 8k bytes, it times out when trying to download objects larger than this. I have a test program here that demonstrates the problem:

This program accesses four URLs at api.weather.gov. The first two work, as they are < 8K in size, the second two fail, as they are larger than this. I have also seen the same problem with api.openweathermap.org (not included in the test program). Below is a wireshark capture of what is going on with the https://api.weather.gov//gridpoints/OHX/58,74/forecast URL (last one tested in the program):

In the capture, the IP of my Wio Terminal is 192.168.1.223. It seems that while the first 4-5 packets get through, after that the TCP window fills up and stays that way until the timeout occurs. No data is ever returned to the application.

I am running firmware 2.1.1. Any help would be appreciated!

Thank you,
Jim

Hi,
perhaps it might help to send an additional request header to get chunked transmission

https_client.addHeader( “Accept-Encoding”, “chunked”, true, true);

Hi @Jim_C,

We have recently updated the RTL8720 firmware and the Wi-Fi-related libraries:

Make sure the following are updated:

seeed-ambd-firmware - v2.1.2
Seeed_Arduino_rpcWiFi - v1.0.4
Seeed_Arduino_rpcUnified - v2.1.3
Seeed_Arduino_mbedtls - v3.0.1
Seeed_Arduino_FS - v2.0.3
Seeed_Arduino_SFUD - v2.0.1

Please try again with the updates.

Best Regards,
Lakshantha

I have upgraded to all the latest versions as suggested, but with no change in the behavior. The first two URLs work, the second two do not and time out.

With regards to chunked transmission, that is the default behavior of HttpClient, unless you call useHTTP10(true). I have tried it with and without this statement, and it fails either way. I think the problem is deeper than that.

Any suggestions? Have you been able to reproduce the problem using my code?

Thanks,
Jim

I didn’t try to reproduce the issue yet but I’m interested and will test on the weekend.

Hello @Jim_C , I can confirm your observations. Only the first two of your urls are downloaded.
When I set debug print statements in the function ‘int WiFiClientSecure::available()’ I can see that ‘int res = _rxBuffer->available();’ always returns 0, which shouldn’t happen.

I changed your example to work with an Enc28 Ethernet module on the Wio Terminal according to the following example
-https://github.com/RoSchmi/Wio_Terminal_Enc28_Ethernet_Https_Get
and all 4 urls are downloaded flawlessly.

Thank you for your confirmation and your successful test with the Ethernet module. That definitely suggests a problem inside the wifi drivers. Since my application requires wifi, I’ll have to wait for a fix.