Esp32 at commands med BLE notification
Postat: 11 juni 2023, 22:26:56
Försöker få notification att funka men går inget bra.
Bristfällig dokumentation finns här:
https://docs.espressif.com/projects/esp ... le-clients
AT+BLEGATTCWR=0,3,6,1,2
>
// Write 0x01
OK
// Server: +WRITE:0,1,6,1,2,<0x01>,<0x00>
AT+BLEGATTCWR=0,3,7,1,2
>
// Write 0x02
OK
// Server: +WRITE:0,1,6,1,2,<0x02>,<0x00>
// Writing ccc is a prerequisite for the server to be able to send notify
Testat enligt:
HW_UART_PutString(BLE_UART, "AT+BLEGATTCWR=0,3,1,1,2\r\n"); // notification
HW_TIM_Delay(500);
HW_UART_PutChar(BLE_UART, 0x00);
HW_UART_PutChar(BLE_UART, 0x01);
Och även
HW_UART_PutString(BLE_UART, "AT+BLEGATTCWR=0,3,1,1,2\r\n");
HW_TIM_Delay(500);
HW_UART_PutChar(BLE_UART, 0x01);
HW_UART_PutChar(BLE_UART, 0x00);
Men får ERROR på båda
GATT ser ut så här:
AT+BLEGATTCCHAR=0,3
+BLEGATTCCHAR:"char",0,3,1,0x442F15718A009A28CBE1E1D4212D53EB,0x12 //read notify
+BLEGATTCCHAR:"desc",0,3,1,1,0x2902
+BLEGATTCCHAR:"char",0,3,2,0x442F15728A009A28CBE11D4212D53EB,0x1c // write
+BLEGATTCCHAR:"desc",0,3,2,1,0x2902
Jag tror det är descriptor 0x2902 för notificaiton på GATT characterstic 0x442F15718A009A28CBE1E1D4212D53EB.
Esp32 kör denna firmware:
AT+GMR
AT version:2.4.0.0(4c6eb5e - ESP32 - May 20 2022 03:11:58)
SDK version:qa-test-v4.3.3-20220423
compile time(5641e0a):May 20 2022 11:12:05
Bin version:2.4.0WROOM-32)
Någon som lyckats med detta?
Bristfällig dokumentation finns här:
https://docs.espressif.com/projects/esp ... le-clients
AT+BLEGATTCWR=0,3,6,1,2
>
// Write 0x01
OK
// Server: +WRITE:0,1,6,1,2,<0x01>,<0x00>
AT+BLEGATTCWR=0,3,7,1,2
>
// Write 0x02
OK
// Server: +WRITE:0,1,6,1,2,<0x02>,<0x00>
// Writing ccc is a prerequisite for the server to be able to send notify
Testat enligt:
HW_UART_PutString(BLE_UART, "AT+BLEGATTCWR=0,3,1,1,2\r\n"); // notification
HW_TIM_Delay(500);
HW_UART_PutChar(BLE_UART, 0x00);
HW_UART_PutChar(BLE_UART, 0x01);
Och även
HW_UART_PutString(BLE_UART, "AT+BLEGATTCWR=0,3,1,1,2\r\n");
HW_TIM_Delay(500);
HW_UART_PutChar(BLE_UART, 0x01);
HW_UART_PutChar(BLE_UART, 0x00);
Men får ERROR på båda
GATT ser ut så här:
AT+BLEGATTCCHAR=0,3
+BLEGATTCCHAR:"char",0,3,1,0x442F15718A009A28CBE1E1D4212D53EB,0x12 //read notify
+BLEGATTCCHAR:"desc",0,3,1,1,0x2902
+BLEGATTCCHAR:"char",0,3,2,0x442F15728A009A28CBE11D4212D53EB,0x1c // write
+BLEGATTCCHAR:"desc",0,3,2,1,0x2902
Jag tror det är descriptor 0x2902 för notificaiton på GATT characterstic 0x442F15718A009A28CBE1E1D4212D53EB.
Esp32 kör denna firmware:
AT+GMR
AT version:2.4.0.0(4c6eb5e - ESP32 - May 20 2022 03:11:58)
SDK version:qa-test-v4.3.3-20220423
compile time(5641e0a):May 20 2022 11:12:05
Bin version:2.4.0WROOM-32)
Någon som lyckats med detta?