-
Notifications
You must be signed in to change notification settings - Fork 142
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
BLE won't reconnect after bluetooth is stopped and restarted. #39
Comments
the bleMouse.end() is an empty func; i have same problem and resolved it by soft restart the dev board ;detail in #37 |
I noticed that too and updated the bleMouse.end() function to kill the task created by bleMouse.begin(), but that didn't fix the problem either. I'd like to avoid a soft restart if possible. From BleMouse.cpp:
From BleMouse.h:
|
I used the solution from above and added the following |
I tired the solution above, but it nonstop doing bleMouse.begin() after I cycle the iPhone Bluetooth on/off. Therefore I add isConnect() while loop to wait for connection after bleMouse.begin() but it never get out of the isConnected loop. Although Bluetooth connection indicate connected on iPhone after switch off, this solution still unable to reconnect properly. Anyone can help? |
Board: ESP32-C3
If I use the code template below I am unable to reconnect to the board with my PC. The board auto-connects fine with the first instance of bleMouse.begin() but does not reconnect after bluetooth is stopped and restarted. If I use deep sleep or reset the board it will reconnect without issues. The mouse commands are still sent and bleMouse.isConnected returns true after bluetooth is restarted, but there is no connection shown on my PC and it does not receive the mouse commands. I also receive the error message shown below after bluetooth is restarted.
Code template:
Error message:
E (80831) BT_HCI: command_timed_out hci layer timeout waiting for response to a command. opcode: 0x2008
The text was updated successfully, but these errors were encountered: