I can't send AT commands
Board: STM32 NUCLEO F103RB (MB1136 C-01)
Wire cable with ESP8266: UART1_tx (PA9) -> RX_ESP8266 and UART1_rx (PA10) -> TX_ESP8266
Hi all,
I try to send AT command between board and ESP8266, without success.
I send the command but I don't see no reply.
The UART baud rate is: 115200 baud.
Below the code:
char data[] = "AT\r\n"; //I want send: AT
char rsp[6]; //I expect the response OK: \r\nOK\r\n, six character
HAL_UART_Transmit(&huart1, (uint8_t*)data, strlen(data) , 10000); \\Send command
HAL_UART_Transmit(&huart2, (uint8_t*)data, strlen(data) , 10000); \\Show the command sent on serial monitor
HAL_Delay(100);
HAL_UART_Receive(&huart1, (uint8_t*)rsp, strlen(rsp), 10000); \\In rsp, i expect the respons: OK
HAL_UART_Transmit(&huart2, (uint8_t*)rsp, strlen(data) , 10000); \\Show the response on serial monitor
Can you help me?
