• Thank you for your replies!

    @Sebastian: I am also not very versed in Bluetooth devices, but before buying a BangleJS I used a cheap Bluetooth keyboard to achieve what I am trying to do now (i.e. remote control of media playback on PC). That keyboard never gave me these kind of problems, except a reasonable delay on the first keystroke after a reconnection. This is why I found the behaviour of BangleJS quite unexpected.

    @Gordon: I am using a slightly modified version of hidkbd app, where I only changed the keys sent with ble_hid_keyboard module and added a reconnection routine which calls NRF.wake() when NRF.getSecurityStatus().connected is false. I implemented this routine some time ago because I thought that the repeated keystrokes could have been a sort of "buffering" effect on the commands sent when the device is disconnected, but actually it did not fix the problem at all.
    The issue is reproducible with the hidkbd app too, so I do not think that the problem lies with the changes I made.

    I do not know if the problem is only limited to Linux: I am not using native Windows anymore on my PC, but when I did I often experienced some issues when I tried to reconnect, which could only be solved by removing the BangleJS from the trusted devices list and rediscovering it again. Never seen repeated keystrokes, though.

    As you suggested, I just tried to add a try {...} catch block around the call to kb.tap(). An exception is indeed caught on the next keypress after a repeated one and it says: Error: BLE HID already sending.
    It seems that some sort of communication issue is actually happening...

About

Avatar for Franzo @Franzo started