ESP32-ANCS-Notifications
ESP32-ANCS-Notifications copied to clipboard
Cannot connect to iPhone
I'm running the sample code with PlatformIO (Arduino framework on nodemcu-32s with espressif32, on a ESP-WROOM-32 devkit), using an iPhone 7 with iOS 13.0.
Trying to debug I have modified the ANCSBLEClient::setup method as follows:
void ANCSBLEClient::setup(const BLEAddress * address) {
ESP_LOGI(LOG_TAG, "!! Setup Begin !!");
BLEClient* pClient = BLEDevice::createClient();
BLEDevice::setEncryptionLevel(ESP_BLE_SEC_ENCRYPT);
BLEDevice::setSecurityCallbacks(new NotificationSecurityCallbacks()); // @todo memory leak?
BLESecurity *pSecurity = new BLESecurity();
pSecurity->setAuthenticationMode(ESP_LE_AUTH_REQ_SC_BOND);
pSecurity->setCapability(ESP_IO_CAP_IO);
pSecurity->setRespEncryptionKey(ESP_BLE_ENC_KEY_MASK | ESP_BLE_ID_KEY_MASK);
ESP_LOGI(LOG_TAG, "!! Setup Connect !!");
// Connect to the remove BLE Server.
pClient->connect(*address);
ESP_LOGI(LOG_TAG, "!! Setup Service !!");
However, looking at the logs, the Connect part of the code never returns: log.log
Eventually, usually when leaving Bluetooth settings, the firmware will then crash due to #21.
Does anybody have experience with such a problem? Thanks
Found a temp fix that works:
If using PlatformIO, change your platform line to platform = [email protected].
(anything newer than 3.5.0 will fail)
If using Arduino IDE, downgrade the ESP32 board to 1.0.6.
Exact reason is unclear but it works for me.
Found a temp fix that works:
If using PlatformIO, change your platform line to
platform = [email protected]. (anything newer than 3.5.0 will fail)If using Arduino IDE, downgrade the ESP32 board to 1.0.6.
Exact reason is unclear but it works for me.
I want to hug you! Thank you so much for sharing, I just spent hours troubleshooting various issues, roadblock after roadblock. This last one was the board version though, and now my notifications are working. Thanks!