-
Notifications
You must be signed in to change notification settings - Fork 408
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
bluetooth connecting trouble with Mac #7
Comments
Does your Mac support Bluetooth LE? https://help.kano.me/hc/en-us/articles/360002246660-Checking-Bluetooth-Low-Energy-Support-on-Your-Device |
thanks for your quick reply. |
do you have any other idea what the problem could be? |
Unfortunately I don't know. Could be a bug in the underlying BLE library that I'm using or maybe a bug in OS X. It's really hard to say for me, especially because I don't own any Apple devices. Maybe it's an authentication issue. |
ooh, I think I maybe got it. |
Il try it on another Mac or PC, then I can be for certain 👍 |
I got it. My mac does not support Bluetooth 4.2, only 4.1 and the esp uses 4.2. |
maby if I use an esp that uses Bluetooth 4.0 ? do you know if the library works with Bluetooth 4.0? |
The version itself shouldn't matter. It all comes down to Bluetooth Low Energy support. If your device uses a Bluetooth 4.x implementation that doesn't support BLE, then it won't work. Otherwise it should work fine, even if it was Bluetooth 5.x. |
Since you're able to connect your ESP with your iPhone, I highly doubt there is anything wrong with your ESP. It's probably a software issue. Maybe it's because you're using the OS X Beta. Or maybe it's incorrectly reporting that BLE is supported. Perhaps it would work with a USB Bluetooth dongle, but I don't know if that would help or which ones work on OS X in the first place. |
ok, that sounds plausible. I'm going to try it with a dongle. |
hello, it is me again :) |
Do you use OS X Catalina? Before the upgrade it worked, but after the upgrade I can’t even connect. |
Excellent discussion! I faced reconnection problem on my MacBook Pro with macOS Catalina. Suggested authentication issue seems to be the cause and ossvr's workaround worked for me. I raised PR. |
Although this resolves the connection issue for me as well on Catalina (10.5.5), it seems to cause some noticeable lag in typing response and also lag in another bluetooth connected mouse. Do you experience the same? |
so, first of all, I really enjoyed working with the library, it makes everything very clear end easy. but I have a problem when I try to connect to my MacBook Pro (Retina 13 inch, early 2015).
it just keeps on loading and then after a few seconds just stops.
Somehow it got it to connect once ore twice but only those times.
But when I try to connect it to my iPhone (iPhone 7 ) it works like a charm.
I am using this board:
https://www.joy-it.net/de/products/SBC-NodeMCU-ESP32
her is the code I wrote:
`#include <BleKeyboard.h>
BleKeyboard bleKeyboard("esp 32 Macro", "lolo", 100);
const int buttonPin0 = 2;
const int buttonPin1 = 4;
const int buttonPin2 = 18;
const int buttonPin3 = 19;
const int buttonPin4 = 21;
int buttonState0 = 0;
int buttonState1 = 0;
int buttonState2 = 0;
int buttonState3 = 0;
int buttonState4 = 0;
int lastButtonState0 = LOW;
int lastButtonState1 = LOW;
int lastButtonState2 = LOW;
int lastButtonState3 = LOW;
int lastButtonState4 = LOW;
unsigned long lastDebounceTime0 = 0;
unsigned long debounceDelay0 = 50;
unsigned long lastDebounceTime1 = 0;
unsigned long debounceDelay1 = 50;
unsigned long lastDebounceTime2 = 0;
unsigned long debounceDelay2 = 50;
unsigned long lastDebounceTime3 = 0;
unsigned long debounceDelay3 = 50;
unsigned long lastDebounceTime4 = 0;
unsigned long debounceDelay4 = 50;
void setup() {
Serial.begin(115200);
Serial.println("Starting BLE work!");
bleKeyboard.begin();
pinMode(buttonPin0, INPUT);
pinMode(buttonPin1, INPUT);
pinMode(buttonPin2, INPUT);
pinMode(buttonPin3, INPUT);
pinMode(buttonPin4, INPUT);
}
void loop() {
int reading0 = digitalRead(buttonPin0);
int reading1 = digitalRead(buttonPin1);
int reading2 = digitalRead(buttonPin2);
int reading3 = digitalRead(buttonPin3);
int reading4 = digitalRead(buttonPin4);
if(bleKeyboard.isConnected()) {
if (reading0 != lastButtonState0) {
}
if (reading1 != lastButtonState1) {
}
if (reading2 != lastButtonState2) {
}
if (reading3 != lastButtonState3) {
}
if (reading4 != lastButtonState4) {
}
if ((millis() - lastDebounceTime0) > debounceDelay0) {
}
if ((millis() - lastDebounceTime1) > debounceDelay1) {
}
if ((millis() - lastDebounceTime2) > debounceDelay2) {
}
if ((millis() - lastDebounceTime3) > debounceDelay3) {
}
if ((millis() - lastDebounceTime4) > debounceDelay4) {
}
lastButtonState0 = reading0;
lastButtonState1 = reading1;
lastButtonState2 = reading2;
lastButtonState3 = reading3;
lastButtonState4 = reading4;
}
}`
maby someone can help me. I would realy appreciate it
best reguards Lorenz
The text was updated successfully, but these errors were encountered: