Skip to content

BluetoothSerial stops to respond after ESP_SPP_CLOSE_EVT event finished #4974

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
ELazarMosk opened this issue Mar 25, 2021 · 6 comments
Closed
Labels
Area: BT&Wifi BT & Wifi related issues Resolution: Duplicate Issue is a duplicate of another issue Status: Stale Issue is stale stage (outdated/stuck)

Comments

@ELazarMosk
Copy link

The basic ESP32 Arduino Bluetooth Serial example pairs and connects as expected, BUT once I disconnect the Bluetooth terminal it stops responding to any new events at all, and I can not reconnect anymore.

once I reset the esp32, it starts working again with the same problem. (it doesn't matter if it keeps being paired or not)

I have tested it with the windows Bluetooth terminal and with the Bluetooth Any terminal. (from the windows store)

I have downloaded the latest esp32-Arduino library from GitHub and I still get the same problem.

I have tested it with several esp32 modules, and they all respond with the same problem.

So it looks like a bug in the library code.

See the simple Arduino example code below:

#include "BluetoothSerial.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;

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 (Serial.available()) {
SerialBT.write(Serial.read());
}
if (SerialBT.available()) {
Serial.write(SerialBT.read());
}
delay(20);
}

@lbernstone
Copy link
Contributor

Likely dupe #4915

@ELazarMosk
Copy link
Author

This should also be fixed when installing the ESP32 boards from the Arduino IDE

@ELazarMosk
Copy link
Author

However,

I still have issues with installing it with the instruction in:
https://github.com/espressif/arduino-esp32/blob/master/docs/arduino-ide/windows.md

I did everything in the tutorial and I get this err in the Arduino IDE

Arduino: 1.8.13 (Windows Store 1.8.42.0) (Windows 10), Board: "ESP32 Dev Module, Disabled, Default 4MB with spiffs (1.2MB APP/1.5MB SPIFFS), 240MHz (WiFi/BT), QIO, 80MHz, 4MB (32Mb), 921600, None"

Warning: Board breadboard:avr:atmega328bb doesn't define a 'build.board' preference. Auto-set to: AVR_ATMEGA328BB

exec: "C:\Users\elaza\Documents\Arduino\hardware\espressif\esp32/tools/xtensa-esp32-elf/bin/xtensa-esp32-elf-g++": file does not exist

Error compiling for board ESP32 Dev Module.

Invalid library found in C:\Users\elaza\Documents\Arduino\libraries\AzureIoT: no headers files (.h) found in C:\Users\elaza\Documents\Arduino\libraries\AzureIoT

@lbernstone
Copy link
Contributor

#4915 (comment)

@VojtechBartoska VojtechBartoska added Area: BT&Wifi BT & Wifi related issues Resolution: Duplicate Issue is a duplicate of another issue labels Mar 25, 2021
@stale
Copy link

stale bot commented Jun 18, 2021

[STALE_SET] This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 14 days if no further activity occurs. Thank you for your contributions.

@stale stale bot added the Status: Stale Issue is stale stage (outdated/stuck) label Jun 18, 2021
@stale
Copy link

stale bot commented Jul 11, 2021

[STALE_DEL] This stale issue has been automatically closed. Thank you for your contributions.

@stale stale bot closed this as completed Jul 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: BT&Wifi BT & Wifi related issues Resolution: Duplicate Issue is a duplicate of another issue Status: Stale Issue is stale stage (outdated/stuck)
Projects
None yet
Development

No branches or pull requests

3 participants