Skip to content

Ping fluctuations #6664

@podaen

Description

@podaen

Board

DOIT ESP32 devkit v4

Device Description

N

Hardware Configuration

I2S audio output

Version

latest development Release Candidate (RC-X)

IDE Name

1.8.19

Operating System

windows10

Flash frequency

80MHz

PSRAM enabled

no

Upload speed

115200

Description

I am making a program that involves url audio streams and starting to notist that it starts fluctuating in filling the buffer.

By doing a ping test I see once the response start to be fluctuating above 200ms and it doesn't recover. And that is what I see in my stream too.

Can it not been made that the ping is not fluctuating so much?? I got this problem also in WiFiclient.h and WiFiClientSecure.h, but I think this is not where the issue is.

Sketch

/*ping test*/
#include "WiFi.h"
#include <esp_wifi.h>
#include <esp_bt_main.h>//power saving bluetooth
#include <esp_bt.h>//power saving bluetooth

const char* ssid = "SSID";
const char* password = "PASS";

void setup() {
    Serial.begin(115200);
    while (!Serial);
    WiFi.begin(ssid, password);

    while (WiFi.status() != WL_CONNECTED) {
        delay(1000);
        Serial.println("Connecting to WiFi..");
    }
    //esp_wifi_set_ps(WIFI_PS_NONE);
    WiFi.setSleep(false);

    esp_bluedroid_disable();
    esp_bluedroid_deinit();
    esp_bt_controller_disable();
    esp_bt_controller_deinit();

    Serial.println(WiFi.localIP());
    Serial.print("RSSI: ");
    Serial.println(WiFi.RSSI());//the closer to 0, the stronger the signal
}

// the loop function runs over and over again until power down or reset
void loop() {
  
}

/*speed test*/
//#include <HTTPClient.h>
//#include "WiFi.h"
//#include <esp_wifi.h>
//#include <esp_bt_main.h>//power saving bluetooth
//#include <esp_bt.h>//power saving bluetooth
//
//const char* ssid = "SSID";
//const char* password = "PASS";
//
//void setup() {
//    Serial.begin(115200);
//    WiFi.begin(ssid, password);
//
//    while (WiFi.status() != WL_CONNECTED) {
//        delay(1000);
//        Serial.println("Connecting to WiFi..");
//    }
//    esp_wifi_set_ps(WIFI_PS_NONE);
//    WiFi.setSleep(false);
//
//        esp_bluedroid_disable();
//    esp_bluedroid_deinit();
//    esp_bt_controller_disable();
//    esp_bt_controller_deinit();
//
//    Serial.println(WiFi.localIP());
//    Serial.print("RSSI: ");
//    Serial.println(WiFi.RSSI());//the closer to 0, the stronger the signal
//}
//
//long speedtest() {
//    unsigned long start;
//    long total = 0;
//    if ((WiFi.status() == WL_CONNECTED)) { //Check the current connection status
//
//        HTTPClient http;
//        //Serial.print("starting...");
//        //http.begin("https://proof.ovh.net/files/1Mb.dat", root_ca); //Specify the URL and certificate
//        http.begin("http://speedtest.tele2.net/1MB.zip"); //Specify the URL and certificate
//        int httpCode = http.GET();                                                  //Make the request
//
//        if (httpCode > 0) { //Check for the returning code
//            //Serial.print(httpCode); Serial.print("           ");
//            if (httpCode == HTTP_CODE_OK) {
//                // get length of document (is -1 when Server sends no Content-Length header)
//                total = http.getSize();
//
//                uint8_t buff[512] = { 0 };
//                int buf_size_actual = sizeof(buff);
//                Serial.print("Buff Size: "); Serial.print(buf_size_actual);
//                WiFiClient* stream = http.getStreamPtr();
//                http.setReuse(true);
//                start = millis();
//                size_t size = 1;
//                long remaining = total;
//                while (http.connected() && (remaining > 0 || remaining == -1)) {
//                    if (stream->available()) {
//                        remaining -= stream->readBytes(buff, 512);
//                    }
//                }
//            }
//        }
//        else {
//            Serial.println("Error on HTTP request");
//        }
//
//        http.end();
//        Serial.print("\tTime: "); Serial.print(millis() - start);
//        Serial.print("\tBytes: "); Serial.print(total);
//        Serial.print("\tThroughput :"); Serial.print("\t"); Serial.print(total / (millis() - start) * 8); Serial.print("\tkbps");
//        return total / (millis() - start) * 8;
//        Serial.println("");
//    }
//}
//
//void loop() {
//    Serial.println(speedtest());
//    delay(5000);
//}

Debug Message

This is a few tests I did, but it is not the worst case scenario. When it gets bad it get above 200ms, I see this once but I forgot the copy. 

> Pingen naar 192.168.1.178 met 512 bytes aan gegevens:
> Antwoord van 192.168.1.178: bytes=512 tijd=935 ms TTL=255
> Antwoord van 192.168.1.178: bytes=512 tijd=8 ms TTL=255
> Antwoord van 192.168.1.178: bytes=512 tijd=4 ms TTL=255
> Antwoord van 192.168.1.178: bytes=512 tijd=6 ms TTL=255
> Antwoord van 192.168.1.178: bytes=512 tijd=6 ms TTL=255
> Antwoord van 192.168.1.178: bytes=512 tijd=10 ms TTL=255
> Antwoord van 192.168.1.178: bytes=512 tijd=7 ms TTL=255
> Antwoord van 192.168.1.178: bytes=512 tijd=6 ms TTL=255
> Antwoord van 192.168.1.178: bytes=512 tijd=6 ms TTL=255
> Antwoord van 192.168.1.178: bytes=512 tijd=8 ms TTL=255
> Antwoord van 192.168.1.178: bytes=512 tijd=8 ms TTL=255
> Antwoord van 192.168.1.178: bytes=512 tijd=4 ms TTL=255
> Antwoord van 192.168.1.178: bytes=512 tijd=11 ms TTL=255
> Antwoord van 192.168.1.178: bytes=512 tijd=5 ms TTL=255
> Antwoord van 192.168.1.178: bytes=512 tijd=10 ms TTL=255
> Antwoord van 192.168.1.178: bytes=512 tijd=7 ms TTL=255
> Antwoord van 192.168.1.178: bytes=512 tijd=12 ms TTL=255
> Antwoord van 192.168.1.178: bytes=512 tijd=6 ms TTL=255
> Antwoord van 192.168.1.178: bytes=512 tijd=8 ms TTL=255
> Antwoord van 192.168.1.178: bytes=512 tijd=8 ms TTL=255
> Antwoord van 192.168.1.178: bytes=512 tijd=9 ms TTL=255
> Antwoord van 192.168.1.178: bytes=512 tijd=6 ms TTL=255
> Antwoord van 192.168.1.178: bytes=512 tijd=6 ms TTL=255
4ms against 12ms +200%

> Antwoord van 192.168.1.178: bytes=512 tijd=16 ms TTL=255
> Antwoord van 192.168.1.178: bytes=512 tijd=8 ms TTL=255
> Antwoord van 192.168.1.178: bytes=512 tijd=7 ms TTL=255
> Antwoord van 192.168.1.178: bytes=512 tijd=5 ms TTL=255
> Antwoord van 192.168.1.178: bytes=512 tijd=6 ms TTL=255
> Antwoord van 192.168.1.178: bytes=512 tijd=7 ms TTL=255
> Antwoord van 192.168.1.178: bytes=512 tijd=10 ms TTL=255
> Antwoord van 192.168.1.178: bytes=512 tijd=9 ms TTL=255
> Antwoord van 192.168.1.178: bytes=512 tijd=11 ms TTL=255
> Antwoord van 192.168.1.178: bytes=512 tijd=9 ms TTL=255
> Antwoord van 192.168.1.178: bytes=512 tijd=6 ms TTL=255
> Antwoord van 192.168.1.178: bytes=512 tijd=8 ms TTL=255
> Antwoord van 192.168.1.178: bytes=512 tijd=6 ms TTL=255
> Antwoord van 192.168.1.178: bytes=512 tijd=7 ms TTL=255
> Antwoord van 192.168.1.178: bytes=512 tijd=5 ms TTL=255
> Antwoord van 192.168.1.178: bytes=512 tijd=6 ms TTL=255
> Antwoord van 192.168.1.178: bytes=512 tijd=6 ms TTL=255
> Antwoord van 192.168.1.178: bytes=512 tijd=10 ms TTL=255
> Antwoord van 192.168.1.178: bytes=512 tijd=8 ms TTL=255
> Antwoord van 192.168.1.178: bytes=512 tijd=9 ms TTL=255
> Antwoord van 192.168.1.178: bytes=512 tijd=7 ms TTL=255
> Antwoord van 192.168.1.178: bytes=512 tijd=6 ms TTL=255
> Antwoord van 192.168.1.178: bytes=512 tijd=6 ms TTL=255
5ms against 11ms +100%

> Antwoord van 192.168.1.178: bytes=512 tijd=41 ms TTL=255
> Antwoord van 192.168.1.178: bytes=512 tijd=6 ms TTL=255
> Antwoord van 192.168.1.178: bytes=512 tijd=8 ms TTL=255
> Antwoord van 192.168.1.178: bytes=512 tijd=4 ms TTL=255
> Antwoord van 192.168.1.178: bytes=512 tijd=5 ms TTL=255
> Antwoord van 192.168.1.178: bytes=512 tijd=10 ms TTL=255
> Antwoord van 192.168.1.178: bytes=512 tijd=10 ms TTL=255
> Antwoord van 192.168.1.178: bytes=512 tijd=8 ms TTL=255
> Antwoord van 192.168.1.178: bytes=512 tijd=4 ms TTL=255
> Antwoord van 192.168.1.178: bytes=512 tijd=8 ms TTL=255
> Antwoord van 192.168.1.178: bytes=512 tijd=8 ms TTL=255
> Antwoord van 192.168.1.178: bytes=512 tijd=8 ms TTL=255
> Antwoord van 192.168.1.178: bytes=512 tijd=6 ms TTL=255
> Antwoord van 192.168.1.178: bytes=512 tijd=9 ms TTL=255
> Antwoord van 192.168.1.178: bytes=512 tijd=24 ms TTL=255
> Antwoord van 192.168.1.178: bytes=512 tijd=6 ms TTL=255
> Antwoord van 192.168.1.178: bytes=512 tijd=9 ms TTL=255
> Antwoord van 192.168.1.178: bytes=512 tijd=10 ms TTL=255
> Antwoord van 192.168.1.178: bytes=512 tijd=6 ms TTL=255
> Antwoord van 192.168.1.178: bytes=512 tijd=6 ms TTL=255
> Antwoord van 192.168.1.178: bytes=512 tijd=7 ms TTL=255
> Antwoord van 192.168.1.178: bytes=512 tijd=8 ms TTL=255
> Antwoord van 192.168.1.178: bytes=512 tijd=8 ms TTL=255
4ms against 24ms 500%

without setSleep(false) and ble disable
Antwoord van 192.168.1.178: bytes=512 tijd=115 ms TTL=255
Antwoord van 192.168.1.178: bytes=512 tijd=129 ms TTL=255
Antwoord van 192.168.1.178: bytes=512 tijd=55 ms TTL=255
Antwoord van 192.168.1.178: bytes=512 tijd=73 ms TTL=255
Antwoord van 192.168.1.178: bytes=512 tijd=5 ms TTL=255
Antwoord van 192.168.1.178: bytes=512 tijd=110 ms TTL=255
Antwoord van 192.168.1.178: bytes=512 tijd=121 ms TTL=255
Antwoord van 192.168.1.178: bytes=512 tijd=28 ms TTL=255
Antwoord van 192.168.1.178: bytes=512 tijd=64 ms TTL=255
Antwoord van 192.168.1.178: bytes=512 tijd=99 ms TTL=255
Time-out bij opdracht.
Antwoord van 192.168.1.178: bytes=512 tijd=54 ms TTL=255
Antwoord van 192.168.1.178: bytes=512 tijd=78 ms TTL=255
Antwoord van 192.168.1.178: bytes=512 tijd=94 ms TTL=255
Antwoord van 192.168.1.178: bytes=512 tijd=106 ms TTL=255
Antwoord van 192.168.1.178: bytes=512 tijd=42 ms TTL=255
Antwoord van 192.168.1.178: bytes=512 tijd=62 ms TTL=255
Antwoord van 192.168.1.178: bytes=512 tijd=85 ms TTL=255
Antwoord van 192.168.1.178: bytes=512 tijd=113 ms TTL=255
Antwoord van 192.168.1.178: bytes=512 tijd=27 ms TTL=255
5ms against 106ms 2000%

connection speed (with an rssi -62 (with antenna) -> +-1300kbs???)
Buff Size: 512 Time: 7142 Bytes: 1048576 Throughput : 1168 kbps1168
Buff Size: 512 Time: 8244 Bytes: 1048576 Throughput : 1016 kbps1016
Buff Size: 512 Time: 6870 Bytes: 1048576 Throughput : 1216 kbps1216
Buff Size: 512 Time: 6739 Bytes: 1048576 Throughput : 1240 kbps1240
Buff Size: 512 Time: 6360 Bytes: 1048576 Throughput : 1312 kbps1312
Buff Size: 512 Time: 6800 Bytes: 1048576 Throughput : 1232 kbps1232
Buff Size: 512 Time: 6645 Bytes: 1048576 Throughput : 1256 kbps1256
Buff Size: 512 Time: 7924 Bytes: 1048576 Throughput : 1056 kbps1056
Buff Size: 512 Time: 6241 Bytes: 1048576 Throughput : 1344 kbps1344
Buff Size: 512 Time: 6324 Bytes: 1048576 Throughput : 1320 kbps1320
Buff Size: 512 Time: 7214 Bytes: 1048576 Throughput : 1160 kbps1160
Buff Size: 512 Time: 7879 Bytes: 1048576 Throughput : 1064 kbps1064
Buff Size: 512 Time: 6289 Bytes: 1048576 Throughput : 1328 kbps1328
Buff Size: 512 Time: 6145 Bytes: 1048576 Throughput : 1360 kbps1360
Buff Size: 512 Time: 6253 Bytes: 1048576 Throughput : 1336 kbps1336
Buff Size: 512 Time: 6421 Bytes: 1048576 Throughput : 1304 kbps1304
Buff Size: 512 Time: 6192 Bytes: 1048576 Throughput : 1352 kbps1352
Buff Size: 512 Time: 6119 Bytes: 1048576 Throughput : 1368 kbps1368
Buff Size: 512 Time: 6440 Bytes: 1048576 Throughput : 1296 kbps1296

Other Steps to Reproduce

See also
pschatzmann/arduino-audio-tools#180

I have checked existing issues, online documentation and the Troubleshooting Guide

  • I confirm I have checked existing issues, online documentation and Troubleshooting guide.

Metadata

Metadata

Assignees

Labels

Area: BT&WifiBT & Wifi related issuesStatus: SolvedThe issue has been resolved and requires no further action.Type: QuestionOnly question

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions