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.

TiWi uB2 / CC256x <-> Android Smartphone setup/connection problem

Other Parts Discussed in Thread: CC2564

Hello everybody!

I am a German engineer (please excuse my english) and new to this forum. Currently I am working on a custom designed heating control with remote access via smartphone. The basic hardware consists of a TiWi uB2 bluetooth module and a STM32F1 controller. As the TI Bluetopia stack does not support the ST controller I have to build my own stack from scratch.

My goal is to establish a connection between the uB2 and an Android smartphone (no BLE) and transmit data packets with the SPP profile. The pairing process between the two devices should proceed in a secure manner with numeric comparison. The user should enter a key which will be displayed on the screen of the heating control.

After spending a lot of time and reading uncounted articles and posts in various forums I am at the point that my smartphone can find the module by its name and I am able to initiate a connection to it. The problem starts here. After starting the connection process I get a "Connection request" event from the uB2 which is responded by a "Accept connection request" command by the host. The "Command status" event immediately received after sending the "Accept connection request" command follows a "Connection complete" event after approximately five seconds. Although I made serveral trials with encryption, simple pairing etc. activated, I never get a prompt to enter a pin code.

A prompt from the smartphone to enter a pin code appears when I start the connection process but simple pairing is disabled! Now I can enter the pin code, however there is no reaction from the uB2 (no events) when I confirm the pin code with OK on the smartphone.

So I think there is something wrong with my configuration of the CC256x.

The device setup is done as following:

- HCI Reset

- Download Base Patch for CC256x

- enable supported features for Secure Simple Pairing, Secure Connections (Host + Controller)

- set event mask (all events active)

- set host buffer size

- write local name

- write device class

- write pin type (variable)

- write simple pairing mode (enable)

- write authentication (enable)

- write default link policy settings (enable sniff mode)

- write connection accept timeout (5sek)

- write scan enable (inquiry + page scan enable)

I would be grateful for any help! Thanks a lot!

Sebastian

  • Hi,

    What is the status for the "Connection complete" event you have received, Is it success? or some error (page timeout)?

    Do you have some sniffer logs that you can share, to see what actually is happening?
  • Sorry for my late reply.

    the status of the "Connection complete" event is 0x10 == "Connection accept timeout exceeded".

    Additional hint: After I spent some time investigating the connecting behaviour I got another event from the CC2564 controller. Disabling authentication (commenting out the authentication enable command) results in a "Disconnection complete event" (0x05) with status "Remote user terminated connection" (0x13). My Google phone confirms this with a message that pairing was not possible, because the entered PIN or key was wrong.

    Unfortunately I have no sniffer logs.

  • Hi,

    Disabling authentication? That is strange. could you please enable authentication, before initiating the connection and try.

    When a device is waiting for a connection procedure response and if it did not receive it in time then we get Connection accept timeout exceeded.

    It is hard to say what is the request that is not been answered, without the sniffer logs.
  • Hi Sundeep,

    enabling authentication does not lead to any success.

    I did some investigations on sniffing the bluetooth traffic, but as I am working on the CC256x with the TI uB2 it seems not possible to create any logs. Nevertheless I purchased another android device with the newest OS version (5.0), which allows logging of the HCI traffic. I analysed this traffic in Wireshark and it appears to be problem with the link manager.

    Unfortunately I found is no way to upload the .log file. So I have to explain what I worked out in recent days (Logging from Android Device):

    - ´Sent "Remote Name Request"

    - Rcvd "Remote Host Supported Features Notification" --> Looks strange, because all LMP features of the CC256x controller except the first on "3-slot packets" are disabled

    - Rcvd "Remote Name Req Complete"

    - Sent "Create Connection"

    - Rcvd "Connect Complete" after 30 seconds with "Connection Accept Timeout exceeded"

     

  • Hi,

    When you click on relay option, You should see the "Use rich formatting" option, click on it. and in the rich text format you will see "Insert/Edit Media" option, which can be used to attach the files.
  • Hi,

    I have kind of the same problem.

    I use an LPC1768 microcontroller to send the HCI commands to a CC2564 QFN test board.

    When I try to make an connection true HCI commands, I do the following things:

    Upload service pack: bluetooth_init_cc2564B_1.0_BT_Spec_4.1.bts
    Also do this with only an HCI_VS_DRPb_Enable_RF_Calibration: 0x01, 0x80, 0xfd, 0x06, 0x3c, 0xf0, 0x5f, 0x00, 0x00, 0x00
    This calibrate the RF channels and after a write scan enable(inquiry) the CC2564 QFN is visible.
    Now I try to connect with a Smartphone. On the logger tool from Texas Instruments I can see that there is a lot of data traffic.

    Also a create_connection_request.
    On this request I respond with Accept_Connection_request: 0x01 0x09 0x04 0x07 0x33 0xEA 0xCF 0x13 0x36 0xAC 0x01
    0x01 0x09 0x04 0x07 opcode and command length.
    0x33 0xEA 0xCF 0x13 0x36 0xAC Bluetooth addres of smartphone.
    0x01 for not allowing role switch.

    This is going well and the smartphone send a Pin_Request_Reply.
    my Pin_request_reply: 0x01, 0x0d, 0x04, 0x17, 0x33, 0xEA, 0xCF, 0x13, 0x36, 0xAC, 0x04, 0x30, 0x30, 0x30, 0x30
    0x01, 0x0d, 0x04, 0x17 command opcode + length
    0x33, 0xEA, 0xCF, 0x13, 0x36, 0xAC bluetooth addres
    pin code length 0x04
    pin code 0x30, 0x30, 0x30, 0x30 (ascii for 0,0,0,0)

    now the devices are succesful connected, but after a while they automatically disconnect.
    I can see with Wireshark that the smartphone sends a ACL data packet, with a L2CAP create connection.
    When I reply on this connection the TI logger tool says something like unknown point to point data.


    the smartphone sends:
    02 0c 20 0c 00 08 00 01 00 02 03 04 00 01 00 49 00
    02 acl data packet
    0c 20 command opcode
    0c 00 command length
    08 00 data packet length
    0x01 0x00 CID(channel identifier)
    02 connection request
    03 command identifier
    04 00 command lenght
    01 00 SDP
    49 00 source CID

    my reply is:
    02 0c 20 10 00 0c 00 01 00 03 03 08 00 49 00 49 00 00 00 00 00
    02 acl data packet
    0c 20 command opcode
    0c 00 command length
    10 00 data packet length
    01 00 CID(channel identifier)
    03 connection response
    03 command identifier
    08 00 command length
    49 00 destination CID
    49 00 source CID
    00 00 result(succesful)
    00 00 no further data available.


    Someone who now what I have to send?
  • Hi,

    Could you please the logger logs and sniffer logs as well if possible.
  • HI,

    Unfortunately I have no acces to my project for a while, but should the way I describe work?
    When do I have reached the point of a connection.

    After the L2CAP create connection, and configure connection?


    Thanks for help so far.

  • Hi,

    Yes it should work,
    either the smart phone will send a "pin code request"
    we need to respond with "pin code request replay", example Send_HCI_PIN_Code_Request_Reply "10:68:3F:59:E8:A1", 0x04, "0000"
    or vice versa should happen.