ESP AT BLE can not enable notification or indication
Posted: Wed Mar 02, 2022 2:13 pm
Hello everybody,
I encountered the following problem using BLE AT. I got two modules. One as a BLE client (ESP32-WROOM-32) and one as a BLE server (ESP32-C3-WROOM). I am sending AT commands via UART. Everything works fine until i want to enable notification or indication. Therefore I want the client to wirte 0x0001 or 0x0002 to the corresponding discriptor. Like this: AT+BLEGATTCWR=0,4,1,1,2\r\n > '2''0' (note: these are integer not ascii values). However not matter how many bytes or which value I try to write I always receive +WRITE:0,2,1,1,2,'1''0'\r\n on the server side. I fllowed the example on https://docs.espressif.com/projects/esp ... e-services. If I use the nRF Connect App on my phone to enable notification or indication everything works properly. I can also write characteristic values without any problems. Only that one dosent seem to work.
Steps to repropduce
1. Step: init server and client
Server
--> AT+BLEINIT=2
--> AT+BLEADDR? --> +BLEADDR:"7c:df:a1:b2:a2:6e"
--> AT+BLEGATTSSRVCRE
--> AT+BLEGATTSSRVSTART
--> AT+BLEGATTSCHAR? --> +BLEGATTSCHAR:"char",1,1,0x2A2B,0x12
+BLEGATTSCHAR:"desc",1,1,1,0x2902
+BLEGATTSCHAR:"char",2,1,0x2700,0x3a
+BLEGATTSCHAR:"desc",2,1,1,0x2902
+BLEGATTSCHAR:"desc",2,1,2,0x2901
+BLEGATTSCHAR:"char",2,2,0x2700,0x02
+BLEGATTSCHAR:"desc",2,2,1,0x2901
--> AT+BLEADVPARAM=100,200,0,0,7
--> AT+BLEADVSTART
Client
--> AT+BLEINIT=1
--> AT+BLESCAN=1,3 --> +BLESCAN:"7c:df:a1:b2:a2:6e",-32,,,0
2. Step: Connect divices
Client
--> AT+BLECONN=0,"7c:df:a1:b2:a2:6e" --> +BLECONN:0,"7c:df:a1:b2:a2:6e"
3. Step: Write to CCCD
Client
--> AT+BLEGATTCPRIMSRV=0 --> +BLEGATTCPRIMSRV:0,1,0x1801,1
+BLEGATTCPRIMSRV:0,2,0x1800,1
+BLEGATTCPRIMSRV:0,3,0x1805,1
+BLEGATTCPRIMSRV:0,4,0x2D59D6C1C1CE4A1AAAACF59BD3F057DB,1
--> AT+BLEGATTCCHAR=0,4 --> +BLEGATTCCHAR:"char",0,4,1,0x2700,0x3a
+BLEGATTCCHAR:"desc",0,4,1,1,0x2902
+BLEGATTCCHAR:"desc",0,4,1,2,0x2901
+BLEGATTCCHAR:"char",0,4,2,0x2700,0x02
+BLEGATTCCHAR:"desc",0,4,2,1,0x2901
--> AT+BLEGATTCWR=0,4,1,1,2 --> '>'
-->'0''2' --> OK
Server
+WRITE:0,2,1,1,2,'1''0'
I encountered the following problem using BLE AT. I got two modules. One as a BLE client (ESP32-WROOM-32) and one as a BLE server (ESP32-C3-WROOM). I am sending AT commands via UART. Everything works fine until i want to enable notification or indication. Therefore I want the client to wirte 0x0001 or 0x0002 to the corresponding discriptor. Like this: AT+BLEGATTCWR=0,4,1,1,2\r\n > '2''0' (note: these are integer not ascii values). However not matter how many bytes or which value I try to write I always receive +WRITE:0,2,1,1,2,'1''0'\r\n on the server side. I fllowed the example on https://docs.espressif.com/projects/esp ... e-services. If I use the nRF Connect App on my phone to enable notification or indication everything works properly. I can also write characteristic values without any problems. Only that one dosent seem to work.
Steps to repropduce
1. Step: init server and client
Server
--> AT+BLEINIT=2
--> AT+BLEADDR? --> +BLEADDR:"7c:df:a1:b2:a2:6e"
--> AT+BLEGATTSSRVCRE
--> AT+BLEGATTSSRVSTART
--> AT+BLEGATTSCHAR? --> +BLEGATTSCHAR:"char",1,1,0x2A2B,0x12
+BLEGATTSCHAR:"desc",1,1,1,0x2902
+BLEGATTSCHAR:"char",2,1,0x2700,0x3a
+BLEGATTSCHAR:"desc",2,1,1,0x2902
+BLEGATTSCHAR:"desc",2,1,2,0x2901
+BLEGATTSCHAR:"char",2,2,0x2700,0x02
+BLEGATTSCHAR:"desc",2,2,1,0x2901
--> AT+BLEADVPARAM=100,200,0,0,7
--> AT+BLEADVSTART
Client
--> AT+BLEINIT=1
--> AT+BLESCAN=1,3 --> +BLESCAN:"7c:df:a1:b2:a2:6e",-32,,,0
2. Step: Connect divices
Client
--> AT+BLECONN=0,"7c:df:a1:b2:a2:6e" --> +BLECONN:0,"7c:df:a1:b2:a2:6e"
3. Step: Write to CCCD
Client
--> AT+BLEGATTCPRIMSRV=0 --> +BLEGATTCPRIMSRV:0,1,0x1801,1
+BLEGATTCPRIMSRV:0,2,0x1800,1
+BLEGATTCPRIMSRV:0,3,0x1805,1
+BLEGATTCPRIMSRV:0,4,0x2D59D6C1C1CE4A1AAAACF59BD3F057DB,1
--> AT+BLEGATTCCHAR=0,4 --> +BLEGATTCCHAR:"char",0,4,1,0x2700,0x3a
+BLEGATTCCHAR:"desc",0,4,1,1,0x2902
+BLEGATTCCHAR:"desc",0,4,1,2,0x2901
+BLEGATTCCHAR:"char",0,4,2,0x2700,0x02
+BLEGATTCCHAR:"desc",0,4,2,1,0x2901
--> AT+BLEGATTCWR=0,4,1,1,2 --> '>'
-->'0''2' --> OK
Server
+WRITE:0,2,1,1,2,'1''0'