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.

Linux/CC2650: SPP Client and Server Issue

Part Number: CC2650


Tool/software: Linux

I am wanting to connect my CC2650 board to my raspberry pi (running raspbian), using either the SPP Client or Server example.

I can connect a serial connection terminal on my phone to the Server example, i can also connect it to the Raspberry Pi. I cannot connect the Raspberry Pi to the Server however.

When i run SPP Client from it it wont connect at all, even when i enter a custom bd_address into the autoconnect function (i put in the raspberry pi bluetooth mac address, i have also tried it with my phone), i have set it to manual mode too however it doesnt find any devices in the area which is impossible as i tried this in a univeristy building and my own phone discovered hundreds of devices.

On my Pi i run rfcomms and listen on hci0, when the phone connects it detects it and i can oopen a serial connection, but this doesnt happen when i connect the SPP Server app, i can connect it via bluetoothctl in the same way i do the phone (it even pairs) however then nothing happens.

I can see using hcitool that the cc2650 is coming up as a master device, could this be the issue? i have tried switching the role using ""hcitool sr 05:04:03:02:01:00 slave"" however it doesnt allow it. could i change this to slave in the code?

All i want is a serial connection over bluetooth from the cc2650 to the Pi.

  • What i have been doing

    I start by look for SPP, mine was on channel 1 with RFCOMM.

    -sudo sdptool browse local

    I have also tried: -sdptool add SP, just in case

    Then i connect to the device

    -bluetoothctl

    -power on

    -agent on

    -default-agent

    -scan on

    -scan off

    -pair 05:04:03:02:01:00

    -enter passkey

    -trust 05:04:03:02:01:00

    Then i bind to rfcomms

    Sudo rfcomm bind 0 05:04:03:02:01:00 1

    Rfcomm #i check that its made and it is there

    At this point Rfcomm listen on channel 1 just keeps waiting for connection and i cant connect a terminal (putty, screen or picocom) to /dev/rfcomm0.

    Can anyone help please? is this an issue with the code i used for the board, should i use some other example?

  • Hi Jake,

    I am not sure exactly what version of the SPP example you are using, but most of the versions filter scanning results. Can you check the source code ( spp_ble_client.c ) whether scan results are filtered? E.g., this code snippet is from the CC26x2 2.10 SDK version of the project:

        case SBC_EVT_ADV_REPORT:
        {
          GapScan_Evt_AdvRpt_t* pAdvRpt = (GapScan_Evt_AdvRpt_t*) (pMsg->pData);
    
    #if (DEFAULT_DEV_DISC_BY_SVC_UUID == TRUE)
          if (SPPBLEClient_findSvcUuid(SERIALPORTSERVICE_SERV_UUID,
                                        pAdvRpt->pData, pAdvRpt->dataLen))
          {
            SPPBLEClient_addScanInfo(pAdvRpt->addr, pAdvRpt->addrType);
            Display_printf(dispHandle, SBC_ROW_NON_CONN, 0, "Discovered: %s",
                           Util_convertBdAddr2Str(pAdvRpt->addr));
          }
    #else // !DEFAULT_DEV_DISC_BY_SVC_UUID
          Display_printf(dispHandle, SBC_ROW_NON_CONN, 0, "Discovered: %s",
                         Util_convertBdAddr2Str(pAdvRpt->addr));
    #endif // DEFAULT_DEV_DISC_BY_SVC_UUID
    
          if (pAdvRpt->pData != NULL)
          {
            ICall_free(pAdvRpt->pData);
          }
          ICall_free(pAdvRpt);
    
          break;
        }

    What you see is that if the DEFAULT_DEV_DISC_BY_SVC_UUID define is set (which it is by default), all advertisement packets are filtered to see if they contain the SERIALPORTSERVICE_SERV_UUID as part of the advertisement data. If this UUID is not found, the device is not added to the scanResults list.