7 years, 1 month ago.

AT Commands are not working (Nucleo L152RE)

Hi

I am trying to get details by using AT Commands (AT, AT+GMR, AT+CWLAP, and etc) but i am getting the same command which i am sending through Serial write.

Is there any Jumper to be set (ON / OFF) to get UART mode? We have observed that to Set ESP8266(Module model) into UART boot mode - Press and hold button until centred red LED indicator light on.

Example: If I send basic command as “AT\r\n”, I need to get response ”OK”. But i am getting response through call back event is "AT"./media/uploads/chsunil/board.png

Board Setup NUCLEO-L152RE with Lora SX1272MB2xAS shield and connect External Grove-Wifi Module to UART of Lora shield. So anyone can please help, how i can get response as excepted.

Thanks, Sunil

2 Answers

7 years, 1 month ago.

Sunil,

Are you using a library to send the AT commands? Or are you sending the commands over raw serial?

We have an AT parser library that runs within the mbed OS ecosystem. It can be found here: ATParser. A few connection libraries that use the NetworkSocketAPI, such as the ESP8266 library, use this AT parser library.

I would recommend using that library to send your AT commands. An example (more details found here) of sending commands using that library would be:

AT parser example

UARTSerial serial = UARTSerial(D1, D0);
ATCmdParser at = ATCmdParser(&serial, "\r\n");
int value;
char buffer[100];

at.send("AT") && at.recv("OK");
at.send("AT+CWMODE=%d", 3) && at.recv("OK");
at.send("AT+CWMODE?") && at.recv("+CWMODE:%d\r\nOK", &value);
at.recv("+IPD,%d:", &value);
at.read(buffer, value);
at.recv("OK");

7 years, 1 month ago.

Hey Sunil,

You won't have to worry about using the linked ATParser library. This library just comes inside mbed OS now! So, you can use Michael's example with no additional libraries if you are using Mbed OS and include mbed.h