This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

CC2541 HID keyboard Demo and MINI-DK Fob not showing up

Other Parts Discussed in Thread: CC2541, CC2540, MANDO, ASH

I have installed the IAR  version  8.20.1   and the BLE toolkit 1.3  and am tring to run the CC2541 HIDEmuKbd  project demo that comes with the BLE toolkit.  It

compiles just fine, downloads and seems to run.  When pressing a key on the fob, it starts transmitting (verified by spectrum analyzer) bursts in the low, mid, and high

range of bluetooth, but I see nothing on a bluetooth device scan on my IPhone 5, IPhone 4S or my MAC.  Any thoughts on whats going on?

  • Hello Breck,

    Have you downloaded any of the TI apps onto your device?  You Use the TI BLE MultiTool or TI BLE Sensor Tag.  There are also other Apps available that will connect with the device.  Depending on the iOS version you are running, you may not see the CC254x in the Settings -> General -> Bluetooth window.

    You have to have an App running on your Device in order to interact with any of the samples from the BLE v1.3.  Check out the BLEwiki for the Apps.

    Thanks,

  • It was my understanding that the HIDemukbd sample was the HID keyboard example that interfaces directly into IOS devices (with Bluetooth 4 or above) and shows up as a  hid compliant keyboard. ie No apps necessary.   Is this not true?

  • Your understanding is correct, you should be able to see HID keyboard in the Bluetooth settings...getting it to work is another story.

    When you figure it out, please let me know!  It was one of those examples that when I started with the CC2540 only led to frustration.

    I would highly recommend you leave this project until you get a better understanding of BLE.  Try all the other examples that connect to the BLE MultiTool, SENSORTAG or other free apps that work.  Once you start with HID, the first thing you will notice is that the buttons are for left and right arrows.  Well, there are no such arrows on iOS.

    You never know though, you could be the one to figure it all out!

    Take my advice, start with the Keyfob and a free App, BlueRadio is also a good one, and proceed from there.  There are a lot of smashed KeyFobs and Debuggers under plenty a programmers feet!

    Thanks,

  • Hi Breck,

    breck ricketts said:

    It was my understanding that the HIDemukbd sample was the HID keyboard example that interfaces directly into IOS devices (with Bluetooth 4 or above) and shows up as a  hid compliant keyboard. ie No apps necessary.   Is this not true?


    I'm afraid you got it wrong. There's (at least currently) no native support for HID over GATT in iOS. And there's (at least currently) no way to have an app insert keypresses as if it were the OS. I don't know why this is. But since multiple apps can share access to a BLE peripheral at the same time via CoreBluetooth, I can't see why Apple can't in the future let the OS also use a BLE HID keyboard as input device.

    Best regards,
    Aslak
  • Hi,

    iOS7 support HID over Gatt profile. So if I installed HIDEmuKbd hex to keyfob and using iPhone with iOS7 it should appear under Settings>Bluetooth with no app needed, right? Unfortunately iPhone doesn't discover keyfob:/...What is a problem?

  • According to our test, BLE 1.3 HIDEmuKbd is working with iOS-beta2, but not iOS-beta3. BLE 1.3.2 is not working with both iOS-beta2 and iOS-beta3. I tried to make the Mouse report, but it did not work. Still don't know where the problem is.

    Samson

  • Hello Samson,

    I got the same report from one of our iOS developers. He confirms that "there is something fishy with Beta3 when it comes to HID over GATT, it does not work unfortunately. Connection and pairing works as expected, but the keyboard functionality is not enabled, and the keyboard is still visible. This was not the case for beta 1 & beta 2."

    We have reported the bug to Apple to get clarification. Please let us know if you obtain any more information regarding this issue.

    Best Regards

    Joakim

  • I just tested HIDEmuKbd with iOS 7 beta 4 (on a 4S), and had the same results as with beta 3: it doesn't work

    After programming the keyfob, it will pair with the iPhone and shows as connected, but disconnects after a few seconds. If I then remove the pairing from the iPhone, the keyfob is discovered but will not pair.

    I tested the same firmware with Windows 8.1, and it works fine there.

    Did anyone else have the same result?

  • Same result with iOS 7 beta 5

  • I also tested with iOS7 beta 5. Still not working.

    By the way, we tested the same thing with Nexus4/Android4.3. Unfortunately, we cannot make it work neither. HID pairing request popped up only when the HID device was connected by another BLE APP. Even I can see the HID keyboard pair request on the notification bar, I never got the "touch to pair HID keyboard" work. On the Bluetooth setting, I can also see the HID keyboard on the available device list, but touch to enable its paring did not work.

  • I just tested the GM version of iOS7. Still no luck!!!
    Anyone every got the HIDoverGATT (1.3) worked on iOS7-GM?
    Samson
  • Quick update for whomever cares about this issue. We also tested CSR1011 (with uEnergy SDK-keyboard sample). It worked fine with iOS 7-GM. Not sure if TI is aware of that.

    (Sorry TI guys, we love you so we need you to know what your competitor is doing.)

  • Have you tried sniffing when doing a connection to see what is failing? I have had some problems before in Windows 8 between different chipsets/drivers with TI's HIDoverGATT examples. Somehow the firmware was filtering (white list) the address of the Intel chipset and not responding with the SCAN_RSP; when using the Broadcom chipset everything was OK. Removing the filter did the magic, but remember that the HIDoverGATT specification requires white listing.

  • Hi Samson,

    Any news on HID over GATT profile requirements for iOS? I have tested the keyboard demo on Android and it works fine with Android 4.4.2 (It was unstable in Android 4.4). Also it has been working OK in Windows 8 and 8.1 for a while.

    HOGP devices require some level of authentication and there's something that catch my eye in the Bluetooth Guidelines for Apple:

    "To incorporate authentication in an accessory design, the accessory should support the Authentication Specification of MFi program."

    I'm not part of the MFi program so I don't know if there are some special requirements for the connection of HOGP devices.

    Main Question to TI: Is there a way to connect CC2540/41 HOGP to an Apple product? (iOS 7 and Mavericks supposedly support HOGP) I have tried several different configurations of HID devices (kbd, mouse, etc.) with no luck.

    Thanks in advance 

  • I've had a bug open with Apple about this since the summer, they recently posted back that they believe they fixed the issue in iOS 7.1 beta 3.

    I did some quick testing and did not find any difference with beta 3, still shows the same behavior (device will pair and connect, but disconnects after a few seconds).

    Nordic Semiconductor's HID over GATT example project works fine with iOS, clearly this is a bug in the TI code somewhere.

  • For what it's worth, I just tried this with iOS 7.0.6, and it still has problems. Here are the particulars:

    1. I used the 2540 based key fob, and compiled the sample in BLE-CC254x-1.4.0\Projects\ble\HIDEmuKbd\CC2540DB\CC2540DK-MINI Keyfob Slave.

    2. I used an iPhone 5 model A1428 running iOS 7.0.6.

    3. After pairing with the key fob using the Settings App, I tried Apple's Notes program. The software keyboard came up when I tapped on the note, but talking one of the BLE buttons caused the keyboard to vanish. I was able to use the left/right key fob buttons to navigate in the file.

    So far, things looked good. I then removed the battery from the key fob and rebooted the iPhone. After doing this, the key fob would not connect. I tried "Forget This Device," followed by reconnecting. iOS could see the device, but would not connect.

    Has anyone else seen anything like this? Is there a way to get the key fob to reconnect to iOS 7.0.6?

  • Some additional information on the HIDEmuKbd sample from my last post:

    1. I installed iOS 7.1 beta 5, and it appears to work properly.

    2. The key fob had stopped working after a reboot (removing/replacing the battery). It started working properly again after reflashing the device. I am assuming removing the battery reset something on the device. I have been able to repeat this on both iOS 7.1 beta 5 and iOS 7.0.6, so I believe this is something on the TI Keyfob. This may not be a bug, though, but rather something I just don't know about the way the key fob resets itself after a power down.

    3. So, with #2 in mind, the HIDEmuKbd sample seems to work fine from both iOS 7.0.6 and iOS 7.1 beta 5.

    Please let me know if you can shed light on why removing the battery caused the app to stop working. It would be nice to know for future reference. :)

  • Hi Mike,

    I have not been able to test the HIDEmuKbd in the latest versions of iOS. However, I had similar problems (number 2 of your list) with the TI HID Profile and the early versions of Windows 8 and Android 4.4. 

    Look in your files for hiddev.c and try deleting (or commenting) the following lines:

    param = GAP_FILTER_POLICY_WHITE;
    VOID GAPRole_SetParameter( GAPROLE_ADV_FILTER_POLICY, sizeof( uint8 ), &param );

    It appears that the HID spec, after disconnection, requires to filter devices to only respond first to previously connected devices and ignore the rest. It can also be a problem with iOS though. 

    I hope you can resolve your problem and report this on the forums. Best regards.

    Edit: Forgot to mention. On Android 4.4.1 after disconnection, the Keyfob connects (and send the data) properly for about 1-2 seconds and disconnects, so it does not mantain the connection with the paired Android device, even though the timeout is set to 60 seconds. The problem is solved after entering to Android Bluetooth settings and "forgetting" the device. This problem is not exclusively for the HIDEmuKBD and it is documented in the forums, so maybe it is on the Android part. Windows 8.1 works properly.

  • Any news / update regarding this very interesting topic ?

    I really would like to use the HIDEmuKbd sample app to manage the native camera app..

  • Hi Mando,

    By commenting out the lines you mentioned in hiddev.c, it worked fine. Thanks a lot, saved me lot of time.

    Best regards

  • Dear Mr Zhang,

    I saw your post that you solved the issue while comment out the code in hiddev.c. I want to only control the volume up. In case of Android, no issue. In the case of iOS, its connected well but when I try to use volume up feature by pressing the key, It wont respond. Nothing happen in fact.

    I tried this, bit still I have problem with iOS. Its working well with Android.

    Please suggest some solution as its urgent.  Thanks a lot in advance.

    Thanks n Regards,

    /Ash