NimBLE Bluetooth SPP Client Example Problem

Linkpad
Posts: 7
Joined: Sat May 11, 2024 12:35 pm

NimBLE Bluetooth SPP Client Example Problem

Postby Linkpad » Sat Jun 01, 2024 4:37 pm

Hi,

I am trying to run through a bluetooth LE nimble example I have managed to get the SPP Server up and running but the SPP Client example header file asks for a #include "esp_central.h" which doesn't seem to exist anywhere? Has anyone had any luck with this? Thanks!

https://github.com/espressif/esp-idf/tr ... le/ble_spp

mgsecord62
Posts: 19
Joined: Thu Nov 02, 2017 12:40 am

Re: NimBLE Bluetooth SPP Client Example Problem

Postby mgsecord62 » Sat Jun 01, 2024 5:40 pm

The file can be found at examples/bluetooth/nimble/common/nimble_central_utils/esp_central.h

Linkpad
Posts: 7
Joined: Sat May 11, 2024 12:35 pm

Re: NimBLE Bluetooth SPP Client Example Problem

Postby Linkpad » Sun Jun 02, 2024 6:34 pm

Hi, Thanks! I have solved this problem trouble is I get a different compilation error now? If anyone can successfully compile the below example sketch let me know (Blueooth LE SPP Client):-

https://github.com/espressif/esp-idf/tr ... spp_client

My compile error messages:-

C:/Users/Pee/.platformio/packages/toolchain-xtensa-esp-elf/bin/../lib/gcc/xtensa-esp-elf/13.2.0/../../../../xtensa-esp-elf/bin/ld.exe: .pio\build\denky32\src\main.c.o:(.literal.ble_spp_client_set_handle+0x8): undefined reference to `peer_chr_find_uuid'
C:/Users/Pee/.platformio/packages/toolchain-xtensa-esp-elf/bin/../lib/gcc/xtensa-esp-elf/13.2.0/../../../../xtensa-esp-elf/bin/ld.exe: .pio\build\denky32\src\main.c.o:(.literal.ble_spp_client_connect_if_interesting+0x8): undefined reference to `addr_str'C:/Users/Pee/.platformio/packages/toolchain-xtensa-esp-elf/bin/../lib/gcc/xtensa-esp-elf/13.2.0/../../../../xtensa-esp-elf/bin/ld.exe: .pio\build\denky32\src\main.c.o:(.literal.ble_spp_client_gap_event+0x34): undefined reference to `print_adv_fields'
C:/Users/Pee/.platformio/packages/toolchain-xtensa-esp-elf/bin/../lib/gcc/xtensa-esp-elf/13.2.0/../../../../xtensa-esp-elf/bin/ld.exe: .pio\build\denky32\src\main.c.o:(.literal.ble_spp_client_gap_event+0x3c): undefined reference to `print_conn_desc'
C:/Users/Pee/.platformio/packages/toolchain-xtensa-esp-elf/bin/../lib/gcc/xtensa-esp-elf/13.2.0/../../../../xtensa-esp-elf/bin/ld.exe: .pio\build\denky32\src\main.c.o:(.literal.ble_spp_client_gap_event+0x40): undefined reference to `peer_add'
C:/Users/Pee/.platformio/packages/toolchain-xtensa-esp-elf/bin/../lib/gcc/xtensa-esp-elf/13.2.0/../../../../xtensa-esp-elf/bin/ld.exe: .pio\build\denky32\src\main.c.o:(.literal.ble_spp_client_gap_event+0x44): undefined reference to `peer_disc_all'
C:/Users/Pee/.platformio/packages/toolchain-xtensa-esp-elf/bin/../lib/gcc/xtensa-esp-elf/13.2.0/../../../../xtensa-esp-elf/bin/ld.exe: .pio\build\denky32\src\main.c.o:(.literal.ble_spp_client_gap_event+0x48): undefined reference to `peer_delete'
C:/Users/Pee/.platformio/packages/toolchain-xtensa-esp-elf/bin/../lib/gcc/xtensa-esp-elf/13.2.0/../../../../xtensa-esp-elf/bin/ld.exe: .pio\build\denky32\src\main.c.o:(.literal.app_main+0x34): undefined reference to `peer_init'
C:/Users/Pee/.platformio/packages/toolchain-xtensa-esp-elf/bin/../lib/gcc/xtensa-esp-elf/13.2.0/../../../../xtensa-esp-elf/bin/ld.exe: .pio\build\denky32\src\main.c.o: in function `ble_spp_client_set_handle':
C:\Users\Pee\OneDrive\Documents\PlatformIO\Projects\Nimble_SPP_Client/src/main.c:35:(.text.ble_spp_client_set_handle+0x17): undefined reference to `peer_chr_find_uuid'
C:/Users/Pee/.platformio/packages/toolchain-xtensa-esp-elf/bin/../lib/gcc/xtensa-esp-elf/13.2.0/../../../../xtensa-esp-elf/bin/ld.exe: .pio\build\denky32\src\main.c.o: in function `ble_spp_client_connect_if_interesting':
C:\Users\Pee\OneDrive\Documents\PlatformIO\Projects\Nimble_SPP_Client/src/main.c:188:(.text.ble_spp_client_connect_if_interesting+0x56): undefined reference to `addr_str'
C:/Users/Pee/.platformio/packages/toolchain-xtensa-esp-elf/bin/../lib/gcc/xtensa-esp-elf/13.2.0/../../../../xtensa-esp-elf/bin/ld.exe: .pio\build\denky32\src\main.c.o: in function `ble_spp_client_gap_event':
C:\Users\Pee\OneDrive\Documents\PlatformIO\Projects\Nimble_SPP_Client/src/main.c:223:(.text.ble_spp_client_gap_event+0x42): undefined reference to `print_adv_fields'
C:/Users/Pee/.platformio/packages/toolchain-xtensa-esp-elf/bin/../lib/gcc/xtensa-esp-elf/13.2.0/../../../../xtensa-esp-elf/bin/ld.exe: C:\Users\Pee\OneDrive\Documents\PlatformIO\Projects\Nimble_SPP_Client/src/main.c:241:(.text.ble_spp_client_gap_event+0x9f): undefined reference to `print_conn_desc'
C:/Users/Pee/.platformio/packages/toolchain-xtensa-esp-elf/bin/../lib/gcc/xtensa-esp-elf/13.2.0/../../../../xtensa-esp-elf/bin/ld.exe: C:\Users\Pee\OneDrive\Documents\PlatformIO\Projects\Nimble_SPP_Client/src/main.c:244:(.text.ble_spp_client_gap_event+0xba): undefined reference to `peer_add'
C:/Users/Pee/.platformio/packages/toolchain-xtensa-esp-elf/bin/../lib/gcc/xtensa-esp-elf/13.2.0/../../../../xtensa-esp-elf/bin/ld.exe: C:\Users\Pee\OneDrive\Documents\PlatformIO\Projects\Nimble_SPP_Client/src/main.c:249:(.text.ble_spp_client_gap_event+0xe5): undefined reference to `peer_disc_all'
C:/Users/Pee/.platformio/packages/toolchain-xtensa-esp-elf/bin/../lib/gcc/xtensa-esp-elf/13.2.0/../../../../xtensa-esp-elf/bin/ld.exe: C:\Users\Pee\OneDrive\Documents\PlatformIO\Projects\Nimble_SPP_Client/src/main.c:262:(.text.ble_spp_client_gap_event+0x13d): undefined reference to `print_conn_desc'
C:/Users/Pee/.platformio/packages/toolchain-xtensa-esp-elf/bin/../lib/gcc/xtensa-esp-elf/13.2.0/../../../../xtensa-esp-elf/bin/ld.exe: C:\Users\Pee\OneDrive\Documents\PlatformIO\Projects\Nimble_SPP_Client/src/main.c:273:(.text.ble_spp_client_gap_event+0x17d): undefined reference to `peer_delete'
C:/Users/Pee/.platformio/packages/toolchain-xtensa-esp-elf/bin/../lib/gcc/xtensa-esp-elf/13.2.0/../../../../xtensa-esp-elf/bin/ld.exe: .pio\build\denky32\src\main.c.o: in function `app_main':
C:\Users\Pee\OneDrive\Documents\PlatformIO\Projects\Nimble_SPP_Client/src/main.c:430:(.text.app_main+0x86): undefined reference to `peer_init'
collect2.exe: error: ld returned 1 exit status
*** [.pio\build\denky32\firmware.elf] Error 1

irahul
Posts: 46
Joined: Fri Jun 18, 2021 10:07 am

Re: NimBLE Bluetooth SPP Client Example Problem

Postby irahul » Fri Jun 07, 2024 11:50 am

Files like examples/bluetooth/nimble/common/nimble_central_utils/misc.c and examples/bluetooth/nimble/common/nimble_central_utils/peer.c are also needed. Infact all files of the nimble_central_utils folder need to compiled. Guess you are missing them.

Who is online

Users browsing this forum: No registered users and 288 guests