This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

The Bluetooth keyboard sample does not work in an IOS 14.3 environment.

The Bluetooth keyboard sample does not work in an ipad(IOS 14.3)

The development board I used was nrf52840dk_nrf52840 (PCA10056).

I built nRF Connect SDK v1.4.2 through SEGGER Embedded Studio in desktop.


The sources are as follows:
( github.com/.../main.c)
Pairing works well in window10 (Desktop) android (galaxy20) environments, and "hello" messages are sent well when the switch button is pressed.
However, the pairing was successful in the ipad (IOS) environment, but the data failed to transmit.
And if the device is disconnected, pairing on other devices is not possible.

Why doesn't it work normally in IOS?

What else should I do?

I'd really appreciate it if you could answer.

Parents
  • Hello!

    Can you try to add the following to your prj.conf: 

    CONFIG_BT_GATT_HIDS_DEFAULT_PERM_RW_ENCRYPT=y

    This is a known issue in NCS. You can read more about it in this thread.

    Best regards,
    Carl Richard

  • CONFIG_BT_GATT_HIDS_DEFAULT_PERM_RW_ENCRYPT=y

    (changed to CONFIG_BT_HIDS_DEFAULT_PERM_ENCRYPT) is already set.
    I read the article you sent me, but there is still a problem with data transmission.
    Connection between devices is not a problem, but there seems to be a problem with data transfer.
    I tested it with ipad (4th generation) and iphone 11pro, but both devices had problems.

  • No need to apologize. I hope you're doing okay! There is no rush.

    Best regards,
    Carl Richard

  • I tested it on the nrf52840dk_nrf52840 board.
    We replaced OUTPUT_REPORT_MAX_LEN.

    Clicking the button to send a "hello" message does not cause errors in the bt_hids_inf_rep_send() function, but does not send data to the ipad.

    ipad information :

    connect :

    Send to Notepad :

    Galaxy s20, Galaxy Tab, desktop window10, and window7 all work well.
    However, in IOS, when OUTPUT_REPORT_MAX_LEN = 1, the key_report_con_send() function is executed only once by pressing the Send Message button.
    Pressing the button again does not execute the key_report_con_send() function.
    When modified to OUTPUT_REPORT_MAX_LEN = 2, pressing the Send Message button does not cause errors but does not send data.

  • Hi!

    Found the issue! Set the defines INPUT_REP_KEYS_REF_ID and OUTPUT_REP_KEYS_REF_ID to 0 (they are set to 1 in the original sample). This should enable the application to work well with iOS device.

    You can remove the change I purposed earlier. It is erroneous.

    Edit: note that this fix will not work for other HID devices like mouse or custom reports.

    Best regards,
    Carl Richard

  • When I changed INPUT_REP_KEYS_REF_ID and OUTPUT_REP_KEYS_REF_ID to 0, I found that iPhone 11pro works well!
    I don't have an ipad right now, so I'll check the operation next week.
    Thank you!

  • I have one more question.
    After the first connection with the nrf52840dk_nrf52840 and other devices, we checked the behavior of the "hello" character transfer.

    1. First-time connection :

    2. Verify Desktop Connection

    3. Verify desktop (window10) behavior

    4. Resetting power to the board will confirm the paired status

    5. The paired device is connected by pressing the start advertising button (button4)

    6. Press the "hello" message send button(button1), but it is not sent to Notepad and the following error message occurs:

    Once the advertising button is pressed, the paired device is automatically connected, but there is no change in the value of the battery and does not send a "hello" message.
    Disconnecting and reconnecting from desktop works well.
    In conclusion, once the board is reset, the paired device is automatically connected, but it does not work properly.
    I must manually reconnect the board whenever it is powered off and on.
    What should I do to solve this...?

Reply
  • I have one more question.
    After the first connection with the nrf52840dk_nrf52840 and other devices, we checked the behavior of the "hello" character transfer.

    1. First-time connection :

    2. Verify Desktop Connection

    3. Verify desktop (window10) behavior

    4. Resetting power to the board will confirm the paired status

    5. The paired device is connected by pressing the start advertising button (button4)

    6. Press the "hello" message send button(button1), but it is not sent to Notepad and the following error message occurs:

    Once the advertising button is pressed, the paired device is automatically connected, but there is no change in the value of the battery and does not send a "hello" message.
    Disconnecting and reconnecting from desktop works well.
    In conclusion, once the board is reset, the paired device is automatically connected, but it does not work properly.
    I must manually reconnect the board whenever it is powered off and on.
    What should I do to solve this...?

Children
  • Hi again!

    Add CONFIG_BT_SETTINGS_CCC_STORE_ON_WRITE=y to your prj.conf, and then it should work.

    Explanation:

    When devices are bonded the CCCD descriptor value must be stored in the flash as it won't be written to persistent storage if reset while connected. When reconnecting to a Windows/Android device it assumes that the notifications are enabled CCCD isn't written again. The config above ensures that CCCD values are always written to persistent storage.

    Best regards,
    Carl Richard
  • As you said, we tested it by setting it to CONFIG_BT_SETTINGS_CCC_STORE_ON_WRITE=y.
    Once the board has been reset, the connection with the paired device is successful.
    However, the problem is not solved.
    There is still no change in the value of the battery and there is an error in the transmission of keyboard data...

  • Hi again!

    We just tested with successful results on a Windows computer. Are you sure that the configuration is set correctly? When changing your configuration in Segger Embedded Studio it may be necessary to reload the project or reopen it with a clean build folder.

    I've attached a .hex file with the correct configuration that you may try to confirm whether this is a configuration issue or not.

    8322.zephyr.hex


    Best regards,
    Carl Richard

  • Thank you for always answering.
    It worked when I opened a new project and built it!!
    Thank you!
    This time, we tested the CONFIG_BT_SETTINGS_CCC_STORE_ON_WRITE=y option in zephyr using zephyr-sdk on Linux.
    Setting CONFIG_BT_SETTINGS_CCC_STORE_ON_WRITE=y when built using nrfconnect source and Segger Embedded Studio will result in changes in the value of the battery or successful transfer of keyboard data when the board is reset.

    However, when you build zephyr-sdk on Linux, the option CONFIG_BT_SETTINGS_CCC_STORE_ON_WRITE=y does not seem to work well.

    This is what I asked Zephyr mainline:
    zephyr mainline

    (It is a source that was tested simply by changing the value of the battery.)

    I tested it up to zephyr-sdk-0.11.4.
    Is there a reason why the option CONFIG_BT_SETTINGS_CCC_STORE_ON_WRITE=y is normal only on the nrfconnect source?
    What did I miss? Is it a bug from a zephyr mainline source?

    The test was performed on the nrf52840dk_nrf52840dk board.

  • Hi again!

    Good to hear that it works for the nRF Connect SDK. As for your issues on Zephyr I'm not sure what's going on. I would recommend using a clean build folder or building with the "-pristine" flag. If that doesn't work I suggest that you press the issue further with the Zephyr developers.

    Best regards,
    Carl Richard

Related