SerialBT Sending Data Rate Stability

JhonyP
Posts: 1
Joined: Fri Apr 03, 2020 8:32 pm

SerialBT Sending Data Rate Stability

Postby JhonyP » Fri Apr 03, 2020 8:45 pm

Hi all,

I'm using ESP8266 with a built in BT module.
I'm trying to open a BT connection between the board and a phone app with sending data rate of ~1-3kHz.

I'm using
"BluetoothSerial.h" library.

Trying to test the stability data rate, I've opened the connection for 10 seconds using a while loop with an exit condition as follows:

startTime = micros();
while (micros() - startTime <= 10000000) {
readNumber = analogRead(ANALOG_PIN_0) * 3.3 / 4095;
counter++;
if (counter % 25 == 0) {
SerialBT.print(readNumber, 2);
SerialBT.flush();
counterBT++;
}
delay(X);
}

where X was tested with values of 1,5,10, and 50.

The log suggest different counter values no matter what X value is.
I'm also down sampled the reads and even though the phone (Samsung 10+) data rate sometimes is corrupted and I'm facing lagging.

And since the data is supposed to present live, any lagging or instability are crucial.

My goal is to get 2.5-3 kHz.

Any suggestion what I'm doing wrong?
Thanks ahead!

Who is online

Users browsing this forum: Baidu [Spider], Google [Bot] and 136 guests