This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

CC3100MOD: File Download Reliability - HTTP Server

Part Number: CC3100MOD
Other Parts Discussed in Thread: CC3100

My application can connect to an HTTP Server and download a firmware update file that is around 3.5MB in size.  I have 3 endpoints and 2 different WIFI networks from which I can download the file from and get different results depending on which WIFI network my application is connected to and which endpoint it uses.

WIFI Network 1 (AMT) - Security = WEP, this is much older WIFI hardware

WIFI Network 2 (ENGR) - Security = WPA2, a NetGear WNR3500

Server 1 (Staging) - An HTTP server hosted on Heroku, downloads from this endpoint use SSL

Server 2 (Production) - An HTTP server for the final application, downloads from this endpoint use SSL

Server 3 (S3) - Another HTTP server, the first 2 servers provide endpoints that return a link to this server for file download, downloads from this endpoint are not using SSL

The application downloads successfully almost always from Server 1 using either WIFI Network.

When connected to WIFI Network 1 (AMT), I will get about 1 out of 5 successful attempts from Server 2 (Production) or Server 3 (S3) and at varying times can get a much higher success rate around 4 out of 5.

When connected to WIFI Network 2 (ENGR), I will get about 1 out of 20 successful downloads from Server 2 (Production) or Server 3 (S3).

The file I am downloading is a .hex file (text file basically).

What I typically see is at the start there is lots of data when calling sl_recv (reading in 10240 chunks), then the process gets to varying points in the download and the amount data read from sl_recv drops off dramatically and often SL_EAGAIN is returned and then when data is available it is typically a few 100's of bytes.  Once this starts it deteriorates to the point where calls to sl_recv always returns SL_EAGAIN.  Where the data available rate falls off is variable and not some time into the process.  Sometimes it occurs very early, within the first 100KB or it may get to 3.0MB+.  Seems pretty random at this point how far into the download it gets before this starts to occur.

It kind of seems like my application does not read data via sl_recv fast enough.  Didn't suspect this as TCP flow control should allow a slow client to receive data from a very fast server.

When downloading from Server 1 (Staging), there are periodic slow downs in the data available from sl_recv and SL_EAGAIN is returned periodically, not much different from the other Servers.  Watching debugger outputs there doesn't seem to be any significant or obvious difference in the download process.  Except the process completes successfully.

The application is attempting to read data from the TCP Stream and write it to a file on an SD card.

The application also can upload files to Server 1 and Server 2.  There is never a problem uploading to the endpoints.  The file it uploads can be 4.0MB+.

I don't know much or have any access to the how the servers are setup.  A third party development team.  The developers there have no idea of anything on the server side that might help and since the download works on other devices (PC's, tablets, phones) it becomes this apps problem.

Is it possible to not service the CC3100MOD receive buffer soon enough?  Is a buffer overflow possible?

Is changing the PHY Data rate applicable to this issue?

The application is using a non-blocking socket using a polling method by calling sl_select.  It looks like there are times where sl_select returns a read descriptor for the socket but when sl_recv is called the first time SL_EAGAIN is returned.  Didn't expect this since the idea for sl_select was that data is available for reading.  It seems that things start going bad, sl_recv returns SL_EAGAIN much more frequently.

Thanks for any help or ideas with this issue.

  • An update to my issue.

    I found that if I change the Mode setting on WIFI Network 2 (ENGR) that I was able to get successful downloads from the Servers. The Mode setting was "Up to 145Mbps" and when I changed this to "Up to 54Mbps", the download process works as excepted. I don't believe calls to sl_recv ever returned SL_EAGAIN during the download process.

    Is there something that can be done on the CC3100 so that when a customer puts our device on a WIFI network the data rate doesn't have to be limited to 54Mbps for all other devices using the WIFI?

    WIFI Network 2 is a Netgear WNR3500 Wireless Router.
  • Hi,

    I don't understand reason of your issue, but you can try one thing. You can set SL_POLICY_PM to SL_ALWAYS_ON_POLICY. This option increase performance as well increase power consumption. What ServicePack version do you have uploaded in device? What type of antenna design do you use?

    Jan

  • Jan,

    Thanks. The SL_ALWAYS_ON_POLICY setting for SL_POLICY_PM corrected the issue I was seeing as well as greatly improving overall performance. The application connects to an HTTPS site and I would occasionally have connection problems in addition to not being able to download large files (~3.5MB) from the site reliably.

    When using the SL_NORMAL_POLICY for SL_POLICY_PM it seemed that the CC3100MOD buffers were over running or filling up when the Wireless Access Point Mode was configured in Modes with data rates >54Mbps.

    Using the SL_ALWAYS_ON_POLICY for SL_POLICY_PM, the Wireless Access Point Mode could be set to "Up to 300Mbps" with no issues.

    This application is not battery operated so not much concern for any additional power usage. An application could change the SL_POLICY_PM when required to perform large data exchanges over the network.

    The device on my test bench is running service pack 1.2.0.2.

    The antenna is a 2.4GHz chip antenna.

    Thanks for the help in quickly resolving this.