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.

Interfacing CC2540 with Laptop

Other Parts Discussed in Thread: CC2541, CC2540

I cannot make application ‘HID Emulated Keyboard’
working. I want to use Keyfob with Laptop, Laptop has Bluetooth 4 in it
(Atheros AR312 Bluetooth 4.0)

I compiled ‘HID Emulated Keyboard’ in IAR, according to
instructions. Downloaded .hex file to Keyfob.

The Keyfob advertises after I press button

I see it on Packet Sniffer.

Laptop discovers Keyfob, says ‘Lower Energy device found’
(Laptop does not say ‘Keyboard found’. Is this ok?)

I press ‘Connect’ on Laptop and press Keyfob Button –
Lapop says ‘connected’.

After that I do not see any more packets at all.

I do not see any changes neither when I press Keyfob
buttons not when I press ‘Caps Lock’ on Laptop.

I suspect I got problems with
Pairing/Bonding/Authentication/Encryption.

Laptop does not ask me about any of that. First finds the
Keyfob and then connects it when I press the button.

Where is the problem? What should I look for?

  • Here is more info hoping it will help to resolve the problem.
    The problem is still with HIDEmuKbd – HID Emulated Keyboard
    application.
    I do not see any action when I press the keys.
    I tested/interrogated HIDEmuKbd.hex using BTool software.
    I can discover and connect to the Keyfob with HIDEmuKbd in it.
    When connected I can read and write to the Keyfob.
    But when I send Pairing request I get message ‘Authenticated Bond:
    False’.
    I suppose this is the problem because Application Guide tells me
    “secure connection must be established before key presses will be sent to
    the peer device.”
    This does not happen I suppose.
    Attached file shows screen of BTool when I get ‘bond: False” message.
    Please note: I compile the Code supplied by TI, no changes.
    I tested the IAR Compiler.
    When I compile SimpleBLEPeripheral application, the resulting file works
    exactly the same way as SimpleBLEPeripheral.hex file supplied by TI. This tells
    me compiler set correctly.
     
     
  • Yeah, I was noticing the same problem with the bonding. This particular application uses the "Just Works" security protocol, so it should just set up the connection with the proper security features without the user having to perform the steps laid out in the SimpleBLEPeripheral example. Not sure what we could be missing.

    As an aside, I disabled the timeout counter in the Keyboard demo and was able to do other functions, such as read the battery levels using the same method described in the KeyFobDemo, so there is definitely a connection being established.

  • Misael, how do you form the Link? The slave/server is Keyfob, What s the master? Do you use USB Dongle or internal BT Radio in the Laptop? 

    Did you actually make it work? Specifically the part when pressing the Caps Lock key turns LED On?

    Disabling timeout counter is good idea too. I increased the time it stays on but it is not enough. 

  • I compared the Keyfob properties to a real keyboard. There is apparently a lot more to being a keyboard than keyfob does. In the bluetooth tab keyfob shows up as 'Other'. The only service listed on keyfob is GATT.  Under hardware the real keyboard has a whole list, but only one for keyfob and it is not like any in the keyboard.

  • Thank you for the pictures from Laptop Screens.

    I can get to similar stage only with one .hex file: MiniDkDemoSlave.hex. When this file is loaded I can initiate Discovery, press Fob’s button and get icon as below:

    When double click on Low Energy Device, I get there:

     I press Connect button and Have to Press right button on Fob again (this step is unfortunate. In real device I do not need to press buttons on Remote; only Connect button on display.)

    Then the Bluetooth window changes as below:

    From here I can press Find Device button

    And KeyFob beeps and flashes LED’s.

    When I go back to Low Energy Device icon and Right Click on it, Properties Windows look s Below:

     File MiniDkDemoSlave.hex is the only file that does it for me. The rest of programs I tried: SimpleBLEPeripheral.hex - supplied; HIDemuKbd.hex – compiled here from their code; do not go to any useable stage. They both connect and make Low Energy Device icon but BlueTooth Window does not extend and button Find Device does not come out.

     What I got now is good enough for my demo prototype (I can start my hardware:-) but … did you try working with Nordic BLE solution? I wonder if they offer friendlier Development Environment?  TI CC2450 may have better characteristics but based on my experience playing with this dev. Kit so far development with TI can be tough …

     Did you try interfacing to KeyFob to  iPhone by any chance? 

  • Andrey5924 said:

    Misael, how do you form the Link? The slave/server is Keyfob, What s the master? Do you use USB Dongle or internal BT Radio in the Laptop? 

    I used the USB dongle loaded with the HostTestRelease to act as the master.

    Andrey5924 said:

    Did you actually make it work? Specifically the part when pressing the Caps Lock key turns LED On?

    Nope, I was never able to establish a successful security link between the devices. I never got any feedback on the push buttons nor did I ever see the LEDs turn on with the CAPS lock.

    Andrey5924 said:

    Disabling timeout counter is good idea too. I increased the time it stays on but it is not enough. 

    You can disable the counter completely by setting the timeout value to 0. If I find anything else, I'll let you know.

  • The file that worked for me as I discribed in previous EMail.

    (I tried to attach it but this forum does not allow to attach .hex files?)

    CC2540MiniDkDemoSlave.hex

    It is part of BLE-254x-1.2 installation, located in

    BLE-254x-1.2/Accessories/Hex files

    See if you can make this work. If you find out what compiles into this file it wil be good too.

  • I have the same results for both CC2540MiniDkDemoSlave.hex and CC2540DK-MINI Keyfob Slave built and loaded with IAR EW. I get to the Bluetooth Operations screen and there is no connect button. I am using BLE-CC254x-1.2.

    I have an iPod touch. It does not see the keyfob at all. It will connect to both the laptop and the keyboard.

    I have no experience with Nordic BLE.

  • Do you press the button on KeyFob? 

    Initially I prssed 'Add a device' on Laptop;

    Then inserted battery into Fob and pressed right button.

    Then Laptop found the Fob and created "Low Energy Device" icon.

    (did you get that far?)

    I selected the  "Low Energy Device" icon and pressed Next. Another window cameup asking about pairing.

    There are 3 options. I poicked up middle option - type in passcode.

    For passcode I typed 000000.

    Then it connects and I see more on the screen and Find Device button.

    Next to "find device" there is Level of alert selection. By defolt no alert selected, then there is no sound, no blinking. When I select Midium or HIgh level of alert it buzzes and blinks.

    2. I just went to Apple store tested if I can connect Fob to iPhone 4S - No, iPhone does not show any activity.

    3. Nordic's development kit seemingly comes with App for iPhone, according to:

    http://www.youtube.com/watch?v=IbLpVwnpAiU&feature=related 

  • I got it to work using that procedure. But my laptop still does not recognize it as a keyboard (brand new HP Win7). I think I have found the problem. From other posts: "Both CC2540 and CC2541 can be used for HID through the new (ratified just before New Year's) HID over GATT spec. This is not backwards compatible with the older "classic" Bluetooth HID profile." I need to be a classic keyboard. So I am now looking for other solutions. The company I am working with has had problems with Nordic, so we are trying to avoid them. Possibilities are Broadcom and CSR.

  • Hi,

     

    Did you ever get the keyfob to function as a keyboard?

  • No. I got the most of functionality with hex file MiniDkDemoSlave.hex as described in earlier posts.

    And for this file i did not find source code. 

  • Hi, 

    An year has gone pass, It still face this problem. I recently bought this kit and tried to run the emulated keyboard example with a bluetooth LE 4.0 , HID over GATT supported dongle from plugable on windows 7.  The problem is I don't see the HID Keyboard discovered on the host PC.  Is it some driver issue on the host side ? 

    I also tried to run it with USB dongle that came along with the kit using Btool. In this case it detects the one device. But when I tried to establish a connection, device request    a security code (which is by default 0). The passkey tab in the Btool is disabled permanently and I couldn't enter the passkey. After few seconds I got the terminate link event from host USB OSAL saying the peer has requested to shutdown down connection (may be the passkey entry has timeout).

    please tell me how can I verify the emulated keyboard example with PC or laptop. 

    I compiled this example using IAR workbench 8.20 (which has few issues as well). 

    Thanks

  • Hi Misael.

    Where is the define or the line to disable or longer the timeout for close connection?

    Bar.