Connecting peripheral_hids_mouse to Phone isn't working

I'm working with the peripheral_hids_mouse sample on nRF52840 DK.I'm using SDK 2.1.0, compiled on MacOS 12.6.
With the sample, I wasn’t able to pair to iPhone 14 or a Pixel 6. I was able to pair to an older Motorola Android phone, and also to a MacBook. The iPhone says that it was not able to pair and to make sure the device is active.
 
The logs from the app when connecting to iPhone:
*** Booting Zephyr OS build v3.1.99-ncs1  ***
Starting Bluetooth Peripheral HIDS mouse example
I: 8 Sectors of 4096 bytes
I: alloc wra: 0, c80
I: data wra: 0, 4e4
I: SoftDevice Controller build revision:
I: f2 e7 5f 6f 23 a2 f3 e8 |.._o#...
I: 10 2f c3 35 9e d7 1d fe |./.5....
I: 8f 80 42 f9             |..B.    
I: HW Platform: Nordic Semiconductor (0x0002)
I: HW Variant: nRF52x (0x0002)
I: Firmware: Standard Bluetooth controller (0x00) Version 242.24551 Build 4087489391
I: No ID address. App must call settings_load()
Bluetooth initialized
I: Identity: FB:BB:9F:4A:3D:94 (random)
I: HCI: version 5.3 (0x0c) revision 0x11a7, manufacturer 0x0059
I: LMP: version 5.3 (0x0c) subver 0x11a7
Direct advertising to F8:1F:32:0D:09:7D (public) started
Direct advertising to F8:1F:32:0D:09:7D (public) timed out
Regular advertising started
Connected 4A:9B:D7:B8:0D:72 (random)
Direct advertising to F8:1F:32:0D:09:7D (public) started
Disconnected from 4A:9B:D7:B8:0D:72 (random) (reason 8)
Directed advertising failed to start
Direct advertising to F8:1F:32:0D:09:7D (public) timed out
Regular advertising started
Connected 4A:9B:D7:B8:0D:72 (random)
Direct advertising to F8:1F:32:0D:09:7D (public) started
Disconnected from 4A:9B:D7:B8:0D:72 (random) (reason 8)
Directed advertising failed to start
Direct advertising to F8:1F:32:0D:09:7D (public) timed out
Regular advertising started
Connected 4A:9B:D7:B8:0D:72 (random)
Direct advertising to F8:1F:32:0D:09:7D (public) started
Disconnected from 4A:9B:D7:B8:0D:72 (random) (reason 8)
Directed advertising failed to start
Direct advertising to F8:1F:32:0D:09:7D (public) timed out
Regular advertising started
Log when connecting to Android:
*** Booting Zephyr OS build v3.1.99-ncs1  ***
Starting Bluetooth Peripheral HIDS mouse example
I: 8 Sectors of 4096 bytes
I: alloc wra: 0, d28
I: data wra: 0, 3d8
I: SoftDevice Controller build revision:
I: f2 e7 5f 6f 23 a2 f3 e8 |.._o#...
I: 10 2f c3 35 9e d7 1d fe |./.5....
I: 8f 80 42 f9             |..B.    
I: HW Platform: Nordic Semiconductor (0x0002)
I: HW Variant: nRF52x (0x0002)
I: Firmware: Standard Bluetooth controller (0x00) Version 242.24551 Build 4087489391
I: No ID address. App must call settings_load()
Bluetooth initialized
I: Identity: FB:BB:9F:4A:3D:94 (random)
I: HCI: version 5.3 (0x0c) revision 0x11a7, manufacturer 0x0059
I: LMP: version 5.3 (0x0c) subver 0x11a7
Direct advertising to F8:1F:32:0D:09:7D (public) started
Direct advertising to F8:1F:32:0D:09:7D (public) timed out
Direct advertising to BC:D0:74:3E:8B:B8 (public) started
Direct advertising to BC:D0:74:3E:8B:B8 (public) timed out
Regular advertising started
Connected 51:CC:9D:10:D2:18 (random)
Direct advertising to F8:1F:32:0D:09:7D (public) started
Direct advertising to F8:1F:32:0D:09:7D (public) timed out
Direct advertising to BC:D0:74:3E:8B:B8 (public) started
Direct advertising to BC:D0:74:3E:8B:B8 (public) timed out
Regular advertising started
Disconnected from 51:CC:9D:10:D2:18 (random) (reason 19)
Directed advertising failed to start
I didn’t get the auth code on the iPhone or on the logs. At this point I haven’t made any changes.
With the older Android phone I get the numeric key, press Button 1 on the dev kit and pair on the phone, and after that I see the mouse pointer on the home screen and can move it with the dev kit buttons. Though it doesn't seem super reliable, sometimes when I reconnect I don't get the pointer.
Can you think of something I'm doing wrong, or something in the logs that would point to a familiar issue?
Parents
  • Hello,

    Please note that iPhone doesn't support mouse applications. That being said, you should be able to connect to it. It just will not do anything once connected. On Android that is not the case, as far as I know. 

    I see from the log that it does a bit of directed advertising. The issue could be that the device is already bonded with the phone, but not vice versa, or the other way around, that the phone is bonded with the DK, but the DK is not bonded with the phone.

    NB: Pairing = encryption. Bonding = storing encryption keys for later connections. 

    To work around this, please try the following:

    using a command line window on your computer, use the command: "nrfjprog --eraseall" while the DK is connected via the USB cable. This will erase the entire flash (also Bluetooth bonding information). On the phone, please check in your settings app whether any of your previous applications that you tested on your DK may be stored. If so, try to "forget device", to delete the bonding data from the phone. If you have tested another device that has bonded with the phone, it may cause issues when you change the application runniing on the DK, until you "forget the device".

    If that doesn't work, please let me know.

    Best regards,

    Edvin

Reply
  • Hello,

    Please note that iPhone doesn't support mouse applications. That being said, you should be able to connect to it. It just will not do anything once connected. On Android that is not the case, as far as I know. 

    I see from the log that it does a bit of directed advertising. The issue could be that the device is already bonded with the phone, but not vice versa, or the other way around, that the phone is bonded with the DK, but the DK is not bonded with the phone.

    NB: Pairing = encryption. Bonding = storing encryption keys for later connections. 

    To work around this, please try the following:

    using a command line window on your computer, use the command: "nrfjprog --eraseall" while the DK is connected via the USB cable. This will erase the entire flash (also Bluetooth bonding information). On the phone, please check in your settings app whether any of your previous applications that you tested on your DK may be stored. If so, try to "forget device", to delete the bonding data from the phone. If you have tested another device that has bonded with the phone, it may cause issues when you change the application runniing on the DK, until you "forget the device".

    If that doesn't work, please let me know.

    Best regards,

    Edvin

Children
Related