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.

CC2650: SPP client code issue

Part Number: CC2650


Having an issue with the SPP client code.

I am trying to get it to connect to my bluetooth on a linux setup which is discoverable, i have added a line of code in accordance with the advice of the presvious person to help me however it would only run if i put it on like this:

uint8_t peerAddr[6] = { 0xb8, 0x27, 0xeb, 0x8d, 0xbb, 0xb2 };

The mac address of linux bluetooth im trying to get the client to connect to is: B8:27:EB:8D:BB:B2

The code runs and when i run the debug and open a serial connection the termial shows the correct message of: Hello from SPP BLE Client! With Data Length Extension support! Auto connecting...

However it does not connect to anything.

Can anyone please help? I am uploading the code from the SPP_BLE_Client file below.

  • Hey Jake,

    Try changing the peerAddr as follows:

    uint8_t peerAddr[6] = { 0xb2, 0xbb, 0x8d, 0xeb, 0x27, 0xb8 };

    Additionally, in the future, please refrain from copying/pasting all of the code you're working with in the comments. Instead, you can use the insert file feature by clicking the "Insert Code, Attach Files and more..." button. This shortens the post and increases the readability so that others may also benefit from your post.

  • Thanks for the reply, apologies about the long code I'm new to the forum.

    I have tied what you put but it hasn't worked, I've tried it with another address too incase it was an issue with my Linux setup however I can't get it to auto connect to my phone, Windows 10 laptop or Linux desktop.

  • Hmm, have you tried setting CLIENT_AUTO_CONNECT to false and attempting a manual scan?
  • I set it to false but nothing happens, it just repeats the message of "spe client..." But not the "auto connecting" part, what should happen?
  • Hey Jake,

    I apologize for the confusion. Our out of box examples use SPP client as Central and SPP server as Peripheral. You mentioned wanted to connect to your linux bluetooth? You need to make sure that the device is in peripheral configuration.

    There is some more insight in the following posts:
    e2e.ti.com/.../576884
    e2e.ti.com/.../655702
  • Hi Ammar,

    Thanks for the reply, i dont think theres been any confusion, as im wanting to type a string into the TI board and have it sent to my laptop or linux server.

    So coms open on board and my server, type Hello for example into the TI board and have it appear in the server coms. By using the SPP Server installed in the TI board i can connect to it and send a string to it, but cant get anything from the board to the server. Should this be the case or am i using it wrong?

    Also what i want ideally is for it to create the hci0 connection, when a bluetooth device connects it should automatically create a folder in /sys/bus/usb/devices/usb i believe, but this doesn't appear to be doing.

    Thanks,
    Jake
  • Actually im starting to think this may be an issue with the connection to linux im trying to make.

    when i run the server app i can connect using my phone terminal app but i cant get it to connect to my laptop, i can get it to connect with the linux, however my issue is it should be coming up as hci0 or 1 i belive? im not finding any local files in my linux server to suggest its sending data when i type in the spp server app installed on the ti board.
  • Hey Jake,

    "By using the SPP Server installed in the TI board i can connect to it and send a string to it, but cant get anything from the board to the server. Should this be the case or am i using it wrong?"

    I was able to test the spp_ble_client and spp_ble_server using 2 CC2650s as described and was able to send a string bidirectionally.

    I apologize, but I am a little confused here.  The spp_ble_server should be connected to a COM port on your computer. This computer is connected to your linux server (or is it your linux server)? To take a step back, how many CC2650s are you implementing in your design?

    If you'd like to connect any device (perhaps your phone) to the CC2650 which is connected to the linux server, then you'll have to implement the serial port profile on your phone application.

  • Hi Ammar,

    I'm just wanting to implement a single TI board that will directly connect to a raspberry pi via Bluetooth. Is this possible or do I have to use two TI boards?

    Thanks,

    Jake

  • Well, the easiest way would be to use two launchpads. That being said, it is certainly possible.

    If you're connecting the single launchpad to the raspberry pi, then you'll need to develop an application (mobile, pc, etc.) to connect to the launchpad that's connected to the pi's COM port. The application will need to implement the serial port profile as configured in the example projects. The same goes the other way. If the TI Board is not connected to the raspberry pi, then you'll need to implement the serial port profile on the raspberry pi.

    Let me know if you have any follow up questions!