I'm having trouble connecting to a specific peripheral identified as '5bf5937b-c8f4-4a82-82cf-3442ec3890cb'. I can see it being scanned, but the connect() call is failing for some reason. See attached logs.
I can connect to this same peripheral using the LightBlue app on my iPhone, so I'm not sure what's going on.
Any help to debug this would be greatly appreciated. Thanks!
I doubt the proposed code compiles (no include for the BLE library and I can't see the printData() function)
Do yourself a favour and please read How to get the best out of this forum and modify your post accordingly (including code tags and necessary documentation of your ask).
Hey. Thanks for replying. Yeah I wasn't sure if I should include the entire project just because ppl won't have access to the thing I'm trying to connect to. But yeah I've posted it here: GitHub - nickbolton/arduino-test.
Here's the LightBlue and PeripheralExplorer output. PE does discover my service, but so does my code. My code fails to connect to it. It's failing right before that if (!peripheral.hasService(PERIPHERAL_UUID)) { line.
I do, but it never actually gets there because it's failing to connect in the section just above it. That's probably something else I'll have to debug when I can successfully connect.
if (!peripheral.connect()) {
Serial.println("Failed to connect");
return;
}
Yea I see the "Failed to connect" message. So what would you suggest to print out? I'm printing out a bunch of stuff above already. Sorry, I'm new to ArdunioBLE. It just seems like it can scan for and find my peripheral, but it's failing somewhere in BLEDevice::connect(). Is there some debugging internally that can be turned on?