I am trying to setup a Bluetooth mouse for chin control for my handicapped dad.
Basically everything works great, re-used your examples. Thank you for them!
I only have one problem. Once the mouse is successfully paired and I reboot the ESP32, it does reconnect, but disconnect immediately. Via btmon on the RaspBerry I found following issues during reconnecting:
Code: Select all
> HCI Event: Encryption Change (0x08) plen 4 #439 [hci0] 513.583695
Status: PIN or Key Missing (0x06)
Handle: 64
Encryption: Disabled (0x00)
< HCI Command: Disconnect (0x01|0x0006) plen 3 #440 [hci0] 513.583765
Handle: 64
Reason: Authentication Failure (0x05)
> HCI Event: Command Status (0x0f) plen 4 #441 [hci0] 513.584229
Disconnect (0x01|0x0006) ncmd 1
Status: Success (0x00)
> HCI Event: Disconnect Complete (0x05) plen 4 #442 [hci0] 513.632950
Status: Success (0x00)
Handle: 64
Reason: Connection Terminated By Local Host (0x16)
Code: Select all
print('- enabling BLE security')
try:
ble.config(le_secure=True)
except Exception as e:
print('*** could not enable security')
print('*** Error:', str(e))
print('- enabling BLE bonding')
try:
ble.config(bond=True)
except Exception as e:
print('*** could not enable bonding')
print('*** Error:', str(e))
I would appreciate any hint you can give me.
Maybe this is unavailable on the ESP32 and I need to switch to the pyboard?
Regards
Michael