T-vK / ESP32-BLE-Keyboard

Bluetooth LE Keyboard library for the ESP32 (Arduino IDE compatible)
2.28k stars 379 forks source link

Bluetooth connection stop UART2 receiving data #222

Open sgiba opened 1 year ago

sgiba commented 1 year ago

Hello,

When I use UART2 it only works when Bluetooth is not active. When BT is activated, no more data comes via UART2. Communication runs normally via UART0. I used Serial. and Serial2. I need to realize the following:

I also tried the following to swap the two UART functions:

include

if IRDA_NR == 0

HardwareSerial CONSOLE(2); HardwareSerial IRDA(0);

endif

if IRDA_NR == 2

HardwareSerial CONSOLE(0); HardwareSerial IRDA(2);

endif

void setup() { CONSOLE.begin(115200,SERIAL_8N1,RXD0,TXD0); IRDA.begin(115200,SERIAL_8N1,RXD2,TXD2); .... This works in principle, but as soon as BT is activated, IRDA no longer runs, regardless of whether IRDA_NR == 0 or IRDA_NR == 2 is set. What is wrong? Is there a better suggestion? :?

The following thoughts: Only data from the ESP is output via the CONSOLE. IRDA has sending and receiving. It may also be independent of the UART no. and only the reception is disturbed by BT. Is it possibly an improper (double) use of interrupts for both functions?

sgiba commented 1 year ago

I tested today a connection to an iPhone14 and a Samsung S10+ and works without problems. But if I connect to Windows10, I have the problem as described.