Open nopnop2002 opened 7 months ago
Different from classic Bluetooth, there is no SPP protocol specified in the BLE standard protocol, so the BLE SPP in this example is based on the vendor implementation, please use the spp_client example to connect with this example.
@lisir233
Thanks for your comment. I confirmed that I was able to connect after running the spp_client example. But it's strange that my Android can't find spp_server.
As you can see from the logs, ESP32 has correctly established a connection with the phone, but because the phone's app doesn't have features like 0x2a00, it doesn't work properly, which is to be expected. Can you briefly describe the functionality you want to achieve with this routine?
Can you briefly describe the functionality you want to achieve with this routine?
Thank you for your comment.
I want to connect to SPP_SERVER using my Android.
I'm having the same issue with an esp32-c6-devkit-1n. I'm using the examples as is except for disabling the brownout detector. I'm running the client and server on two copies of the devices. I'm using esp-idf v5.2.1. I'm all out of ideas at this point so any help would be appreciated.
CLIENT
I (388) app_main: BLE client UART task started
I (388) blecm_nimble: BLE Connection Management: v0.1.1
I (388) BLE_INIT: Using main XTAL as clock source
I (398) BLE_INIT: ble controller commit:[217f1bf]
I (398) phy_init: phy_version 250,e14681b,Jan 24 2024,17:43:11
I (448) phy: libbtbb version: 939f79c, Jan 24 2024, 17:43:26
I (448) blecm_nimble: BLE Host Task Started
I (448) NimBLE: GAP procedure initiated: stop advertising.
I (448) NimBLE: GAP procedure initiated: discovery;
I (458) NimBLE: own_addr_type=0 filter_policy=0 passive=1 limited=0 filter_duplicates=1
I (468) NimBLE: duration=forever
I (468) NimBLE:
I (478) main_task: Returned from app_main()
SERVER
I (513) blecm_nimble: BLE Host Task Started
I (513) blecm_nimble: No characteristic(0x2a00) found
I (523) blecm_nimble: No characteristic(0x2a01) found
I (523) blecm_nimble: No characteristic(0x2a05) found
I (533) blecm_nimble: No characteristic(0x2b3a) found
I (533) blecm_nimble: No characteristic(0x2b29) found
I (543) app_main: Callback for read
I (553) NimBLE: GAP procedure initiated: stop advertising.
I (553) NimBLE: GAP procedure initiated: advertise;
I (553) NimBLE: disc_mode=2
I (563) NimBLE: adv_channel_map=0 own_addr_type=0 adv_filter_policy=0 adv_itvl_min=256 adv_itvl_max=256
I (573) NimBLE:
I (573) main_task: Returned from app_main()
After having the same issue with esp32-c3s I figured there must be something else going on and it turns out that if you do not provide enough power to the board, usb to pc alone isn't enough, that Bluetooth does not work. After connecting more power to the board via the second usb port everything is working. Posting this in case anyone else runs into the same issue.
Hi, @AlejandroHuerta ,Thank you for your message.,I'm trying to reproduce your question.I'm running the client and server on two copies of the devices,and I use esp-idf v5.2.1 as same,On my device it seems to work fine. From the logs you provided, it seems that the Server is connected to another device instead of the Client, please check if there are other devices, such as your cell phone, that are unintentionally connected to the Server.
Can you briefly describe the functionality you want to achieve with this routine?
Thank you for your comment.
I want to connect to SPP_SERVER using my Android.
Hi, @nopnop2002 This example is only for data exchange between two ESP32s using BLE, if you want to use the ESP32 to interact with your phone, you may need to build an additional Android APP to simulate the functionality of the ESP32 Client.
Hi, @AlejandroHuerta ,Thank you for your message.,I'm trying to reproduce your question.I'm running the client and server on two copies of the devices,and I use esp-idf v5.2.1 as same,On my device it seems to work fine. From the logs you provided, it seems that the Server is connected to another device instead of the Client, please check if there are other devices, such as your cell phone, that are unintentionally connected to the Server.
Like I mentioned in my second post. Everything is working now after I provided more power to the device. I was previously only using power from USB and I disabled the brownout detection. This was a mistake.
Answers checklist.
General issue report
I used this sample on esp32s3.
https://github.com/espressif/esp-iot-solution/tree/master/examples/bluetooth/ble_conn_mgr/ble_spp/spp_server
This is my environment:
This is my logging: It doesn't seem to be working properly.