espressif / esp-at

AT application for ESP32/ESP32-C2/ESP32-C3/ESP32-C6/ESP8266
Apache License 2.0
913 stars 831 forks source link

+BLECONN only reported once #749

Open mrx23dot opened 1 year ago

mrx23dot commented 1 year ago

Answers checklist

AT+GMR

AT version:3.2.0.0(s-ec2dec2 - ESP32 - Jul 28 2023 07:05:28) SDK version:v5.0.2-376-g24b9d38a24-dirty compile time(6118fc22):Jul 28 2023 10:14:50 Bin version:v3.2.0.0(PICO-D4)

ESP-AT Firmware Source

ESP32-PICO-D4-AT-V3.2.0.0.zip from website

Hardware Information

esp32-pico-mini-02

Power Supply used

USB

What is the expected behavior?

On second connect it should still report

+BLECONN:0
and
+BLEDISCONN:0

What is the actual behavior?

only reports first connection with

+BLECONN:0
and
+BLEDISCONN:0

Probability of recurrence

always

AT+SYSRAM?

D,ESPU:237,01-01-2017 00:00:04,tx:AT+SYSRAM? D,ESPU:209,01-01-2017 00:00:04,rx:+SYSRAM:104272,101652

Steps to reproduce


AT+BLEINIT=2
OK
AT+BLEGATTSSRVCRE
OK
AT+BLEGATTSSRVSTART
OK
AT+RFPOWER=84,0,0,0
OK
AT+BLEADDR=1,"d9:2c:b0:e1:26:19"
OK
AT+BLEADVPARAM=32,64,0,1,7,0,,
OK
AT+BLEADVSTART

connect with nRF app

+BLECONN:0,"61:c8:b3:ec:f2:6f" +BLECONNPARAM:0,0,0,6,0,500 +BLECONNPARAM:0,0,0,39,0,500

disconnect +BLEDISCONN:0,"61:c8:b3:ec:f2:6f"

connect with nRF app for second time.

It connects, but doesn't send more:

+BLECONN:0,"61:c8:b3:ec:f2:6f"
+BLEDISCONN:0,"61:c8:b3:ec:f2:6f"

AT command port output

see above

AT log port output

not needed to reproduce

More Information.

No response

mrx23dot commented 1 year ago

Looks like it stops advertising after disconnection,

what's the point of having connection id in +BLECONN:0 if this is the case?

mrx23dot commented 1 year ago

Also, first +BLECONN:0 doesn't seem to come if I reboot BLE server side (same code as above) with already connected client, and client auto reconnects.

Luxin812 commented 8 months ago

@mrx23dot

  1. Have you confirmed that the second connection to nrf app has created BLE successfully? The broadcast will be stopped after the connection establishment fails or succeeds. If you need to re-create the BLE connection, please re-execute AT+BLEADVSTART to turn on the BLE broadcast (this is a protocol requirement) image

  2. Because when the client establishes a BLE connection with the device as the BLE server, the reason why the BLE server executes the AT+BLECONN command to connect is just a false connection, and it only needs to be returned. image