isssues in data transfer

Sreejith
Posts: 1
Joined: Tue Jun 01, 2021 6:18 am

isssues in data transfer

Postby Sreejith » Tue Jun 01, 2021 6:37 am

Iam new to esp32,I have a project in which i had to to receive large data through bluetooth and print the output in the serial terminal
iam posting my sample code below but iam facing data loss in the serial output.Can somebody please help on this


#include "BluetoothSerial.h"
#include<string.h>

#if !defined(CONFIG_BT_ENABLED) || !defined(CONFIG_BLUEDROID_ENABLED)
#error Bluetooth is not enabled! Please run `make menuconfig` to and enable it
#endif

BluetoothSerial SerialBT;
const int ilength=100;
int ilen=0;
char cbuffer[ilength];
void setup() {
Serial.begin(115200);
SerialBT.begin("ESP32test"); //Bluetooth device name
Serial.println("The device started, now you can pair it with bluetooth!");
}

void loop() {

if (SerialBT.available()>0)
{


Serial.write(SerialBT.read());




}



}

Who is online

Users browsing this forum: No registered users and 121 guests