how much the HTTP transfer rate can archive on esp32

nzh912
Posts: 22
Joined: Mon Mar 25, 2019 4:27 am

how much the HTTP transfer rate can archive on esp32

Postby nzh912 » Thu Sep 19, 2019 3:26 am

hi guys, i have a question here.
May i know the httpd transmission rate on WiFi transmission is how much, either TCP and UDP.

i'm using the FTP(file transfer protocol) on esp-idf. but the download file speed is extremely slow, below 1MB/s.
I need to transfer the chunk files in 5MB.

ESP_Sprite
Posts: 3474
Joined: Thu Nov 26, 2015 4:08 am

Re: how much the HTTP transfer rate can archive on esp32

Postby ESP_Sprite » Thu Sep 19, 2019 3:37 am

Suggest you check the iperf example in esp-idf; that at least can tell you the ideal speed you can get in your particular situation (AP, environment, etc).

bobo1974
Posts: 16
Joined: Fri Feb 08, 2019 2:14 pm

Re: how much the HTTP transfer rate can archive on esp32

Postby bobo1974 » Mon Jan 27, 2020 9:31 am

Hi both,

I've red the iperf part in details. My issue is that having this iperf code seem the only way to get decent throughput.
I am simply trying to get a file from the web from an http get. Currently I hardly reach 1mbps, which is really low.
I am not expecting 20 or 30 Mbps, but at least 5-10Mbps at a minimum.

I get:
-buffersize 1000 - delay (to fill in the buffer) 1ms Throughput : 984 kbps
-buffersize 1000 - delay (to fill in the buffer) 2ms Throughput : 480 kbps
-buffersize 2000 - delay (to fill in the buffer) 1ms Throughput : 688 kbps
-buffersize 2000 - delay (to fill in the buffer) 2ms Throughput : 384 kbps


nzh912: have you succeeded to improve your throughput?
ESP_SPRiTE: would you be able to suggest something?

I am using the below code (based on StreamHttpClient.ino) - I have played with many buffer size and delay values. I don't need the data (just trying to measure bandwidth) so I could just through it away...

Code: Select all

#include <WiFi.h>
#include <HTTPClient.h>

bool GOTIP;
const char* ssid     = "XXXXXXXX";
const char* password = "XXXXXXXX";

long speedtest(const int size) {
  HTTPClient http;

  const char* host = "http://ovh.net/files/10Mb.dat";

  size_t count = 0;
  unsigned long t_start;
  unsigned long t_end;

  Serial.print("connecting to "); Serial.print(host); Serial.print("\t");
  Serial.println(http.begin(host));
  int httpCode = http.GET();

  unsigned long timeout = millis();

  t_start = millis();
  if (httpCode == HTTP_CODE_OK) {
    int len = http.getSize();
    count = len;
    uint8_t buff[128] = { 0 };
    WiFiClient * stream = http.getStreamPtr();
    while (http.connected() && (len > 0 || len == -1)) {
      size_t size = stream->available();
      if (size) {
        int c = stream->readBytes(buff, ((size > sizeof(buff)) ? sizeof(buff) : size));
        //Serial.write(buff, c);
        if (len > 0) {
          len -= c;
        }
      }
      delay(5);
    }
    t_end = millis();
    Serial.print("\t\tThroughput :\t"); Serial.print(count / (t_end - t_start) * 8 ); Serial.print("\tkbps");
  }
}

void setup()
{
  Serial.begin(115200);
  Serial.print("Connecting to ");  Serial.println(ssid);
  WiFi.begin(ssid, password);
  while (WiFi.status() != WL_CONNECTED) {
    Serial.print("."); delay(200);
  }
  Serial.print("WiFi connected with IP:"); Serial.println(WiFi.localIP());

  speedtest(2000);
}

void loop() {}

ESP_Sprite
Posts: 3474
Joined: Thu Nov 26, 2015 4:08 am

Re: how much the HTTP transfer rate can archive on esp32

Postby ESP_Sprite » Mon Jan 27, 2020 10:37 am

Sorry, I'm not familiar enough with the Arduino webserver to comment on this... Also, moving this topic to the Arduino subforum, perhaps the people there know more.

bobo1974
Posts: 16
Joined: Fri Feb 08, 2019 2:14 pm

Re: how much the HTTP transfer rate can archive on esp32

Postby bobo1974 » Mon Jan 27, 2020 2:07 pm

Well, if you point me to a performing esp-idf based http download code I am happy to include it in arduino. :)

bobo1974
Posts: 16
Joined: Fri Feb 08, 2019 2:14 pm

Re: how much the HTTP transfer rate can archive on esp32

Postby bobo1974 » Fri Feb 07, 2020 12:52 pm

Can anyone tell me if he has achieved a decent throughput (say >10mbps) on the esp32, on a regular file download for instance (not iperf)? On arduino, or IDF, I can adapt.

Who is online

Users browsing this forum: lbernstone and 24 guests