SIM800L sends back the same AT command String that was sent to it from ESP32
Ask QuestionAsked yesterdayActive yesterdayViewed 37 times0
My objective is to send the command AT to the SIM800L board and receive an OK. The problem is the data being received through the serial is exactly the same that was sent to the SIM800L module: the received String in my case is exactly AT. This is the code:
#include <HardwareSerial.h>
HardwareSerial sim800l(1); //UART 1
void setup() {
Serial.begin(115200);
sim800l.begin(9600, SERIAL_8N1, 12, 13); //rx=pin12, tx=pin13
delay(500);
}
void loop() {
sim800l.print("AT"); //send a command
delay(100);
while (sim800l.available()) { //receive the answer
Serial.println(sim800l.readString());
}
delay(5000);
}
Some more information:
- The SIM800L is being powered directly with a LiPo battery that provides 3.9V.
- The SIM800L module’s onboard LED is blinking once every second: it doesn’t seem to be reseting as many people report when the module is underpowered. I’m not even trying to connect to a network or send a message.
- The module used is TTGO LoRa32-OLED v1. I’ve also tried with an Arduino UNO and ESP32 Devkit and the results were the same.
- Avoided using the serial monitor (UART0) and displayed the data on the OLED screen instead, but the results were the same.
- Tried multiple combinations of pin connections and they do not work either.
- I couldn’t find anything about this issue.
EDIT: tried adding sim800l.print("ATE0");
and sim800l.print("AT&W")
in the setup section (with 10 seconds delays in beetwen) to turn the module’s echo off but it didn’t work. It sends back both command strings plus the “AT” command from the loop.arduinoserialesp32at-commandssim800ShareCiteEditFollowFlagedited yesterdayasked yesterdayelpegot111 bronze badge New contributor
- 3Wild guess, echo is on? – Tyler yesterday
- 1What if it just has local echo on, so it is not a bug but a feature that it sends you back what you sent to it before sending OK back? – Justme yesterday
- 1Is there an echo in the room? – Andy aka yesterday
- 1Added
sim800l.print("ATE0");
andsim800l.print("AT&W")
in the setup section (with 10 seconds delays in beetwen) to get rid of the local echo and does’t work. It sends back the 3 command strings. – elpegot yesterday - I have been setting up, testing, and troubleshooting SIM800s. 900s. 7600s for a couple of years. I never used any software/code to do the job. My trick is to use PuTTY or similar utility to (1) test local echo, by hard wire connecting TxD to RxD, (2) send AT to SIMx and listen to any thing back. – tlfong01 yesterday
- Only after local echo and terminal emulator test OK, then I will test my code. The code is of course very simple, Below is a fully debugged test/demo program with Rpi4B Thonny Python with SIM7600 (Arduino/C++ SIM800/SIM900 code is very similar. You can find/search more than a couple of my SIMx answers in Rpi SE). Ref: Rpi3B+ Python Controlling Multiple SIM800 / SIM900 / SIM7600 Modules Asked 1 year, 1 month ago Active 7 months ago Viewed 460 times raspberrypi.stackexchange.com/questions/113992/…. – tlfong01 yesterday
- One more thing. SIM800 software has some “slight” bugs. For example, its “AutoBaud” feature seems not working at all. So do not use “autobaud” when testing as default. The GPS component is also not very reliable. I avoid using it, or only after I verify things on SIMx using external GPS devices such as NEO6/7/8/9. Comparing to NEO, SIM800 GPS is not that impressive. Of course things are improved on more updated software versions of SIM900/7600. One more thing: dot not use the highest UART speed available. Usually I start testing with puTTY 9600bd8N1. – tlfong01 just now Edit
Categories: Uncategorized