Comments (12)
I think the issue here is that after the connection is broken by whatever means (disconnect, BT off, computer restart) the ESP32 isn't put back in advertising mode. I was tinkering around with things like bleKeyboard.end(); bleKeyboard.begin();, but .end() is actually an empty function that doesn't do anything.
I think ideally what we need is a method to start advertising after the device is disconnected. This doesn't need to be automatic, we can manually trigger it with bleKeyboard.isConnected().
I think if possible, an isAdvertising() function would help with some other house keeping.
I'll keep tinkering and see if I can figure out how to do this myself, but this nuts and bolts are a bit over my head.
from esp32-ble-keyboard.
I have not mentionned it, but I'm using a ttgo t display esp32 board , maybe the issue comes from the board.
from esp32-ble-keyboard.
I don't know what could be causing this. Does this only happen on one of your devices or can you reproduce this issue with any device? What kind of device did you test against btw? (Android, iOS, Windows, Mac OS, Linux, ... ?)
from esp32-ble-keyboard.
I had this issue with my computer (windows 10) and my android device (galaxy S10)
from esp32-ble-keyboard.
I've the same issue : when my phone is connected for the first time to the esp32 module with the BleKeyboard driver works fine. As soon as the phone is disconnected, I can no longer connect, I have to restart the ESP32 for it to work again. the blekeyboard driver don't advertise again.
from esp32-ble-keyboard.
I've the same issue
from esp32-ble-keyboard.
Same here.
Let's say we have phone1 and phone2.
It connects well for the first time on phone1. But if you then turn off phone1's bluetooth and turn it back on, the connection is not restablished.
Actually, the ESP32 bluetooth keyboard device is no longer visible to phone2 (other devices) right after phone1 made the connection. This makes me believe the issue happens once the device connects for the first time, not after the disconnection takes place.
As others have said, the Bluetooth connection is only restablished after ESP32 is rebooted.
This is terrible, as I'm powering the ESP32 directly from a headunit USB connection and my car shuts the electronics off while the car is igniting.
Android 11 phones.
from esp32-ble-keyboard.
Take a look at #53. The PR implements a startAdvertising
method. The reason I haven't merged it yet is that you have to manually call it, breaking backwards-compatibility. I hope someone comes up with a way to automate this eventually.
The end
method is empty indeed for now. I think I just included it because the USB keyboard library has an empty end
function as well.
from esp32-ble-keyboard.
I tested this and it works great, thanks!
I used Rousir's version Without changing anything in my program, I was able to connect to the ESP32 automatically from a previously paired device, and to find the freshly booted ESP32 from an unpaired device. I have a button to press to restart advertising, and that works well.
I think it would be safe to merge unless there is another use case that I'm missing.
Rousir closed the PR for some reason, if you aren't ready to merge, maybe you should re-open it so others are more aware of it. The example sketch he made doesn't seem quite right, but I haven't tested it. It seems to me it would never retrigger the advertising since the check is within the isConnected() loop.
from esp32-ble-keyboard.
The example sketch he made doesn't seem quite right, but I haven't tested it. It seems to me it would never retrigger the advertising since the check is within the isConnected() loop.
Well, after updating the two modified library files, I just tried the example sketch and it certainly doesn't autoreconnect, the ESP32 bluetooth device is not advertising.
And yes, the algorithm doesn't make sense. bleKeyboard.startAdvertising() is only executed if bleKeyboard.isConnected().
I wonder how others made it work...
Edit:
if(!bleKeybaord.isConnected())
Did the trick for me, lol
from esp32-ble-keyboard.
from esp32-ble-keyboard.
I hope this got fixed in #86 which is included in the new release (v0.2.3).
from esp32-ble-keyboard.
Related Issues (20)
- isConnected, but not paired
- Unable to press or execute any task HOT 1
- up to 10 Sec delays...
- Use unsupported media keys on USB
- Incompatibility with ESP32 2.x by Esspresif
- Adafruit QTPY ESP32-S3 - Constant reconnections and not sending keyboard messages. HOT 2
- BleKeyboard not communicate after reset HOT 3
- AZERTY issues
- XIAO ESP32-S3 BLE Reconnection Problems on Windows 11 HOT 1
- Getting Exit Status 1 every time I run a code with this library or even the example for that matter - PLZ HELP! HOT 6
- thx i love it
- ### Related area
- http://www.w3.org/TR/html4/strict.dtd
- Example program won't compile with Arduino ESP32 board software v3.x HOT 2
- compilation error HOT 1
- can`t pair esp32c6 to phone
- Getting Errors While Trying to run the code in Arduino IDE HOT 1
- Can not build ESP32-BLE-Keyboard of example in window 11 HOT 1
- EP32-C3, doesn't reconnect after rebood - Android
- NimBLE on arduino IDE
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from esp32-ble-keyboard.