Receiving SMS but sim800L not responding on AT commands

Hi,

I'm struggling with this problem for few days already, trying different troubleshooting approaches, but still not able to figure out what is the problem.

I'm working on small basic project with Arduino REV3 and sim800L evb module, trying to send and receive SMSs. Eventually I plan to control something upon SMS received, but there are still few steps before that.

Problem: what ever I do, sim800l is not responding on commands entered either by code or via Serial monitor. Anyhow, if I remove power supply (5V/3A) from sim800l, I'm able to capture response coming from sim800l, which are stating everything is ok.
But, when I want to send out some command from code or via Serial monitor, no response.

I'm aware my code needs improvements, but this is sketch until I have prototype working, so I would like next use cases to be working:
communication with sim800l using AT commands
sending SMS
receiving SMS

Here are Serial monitor outputs:

  1. startup
12:55:04.140 -> Initializing OLED module...
12:55:05.213 -> OLED module intialized
12:55:05.213 -> Initializing SIM module...
12:55:05.248 -> Sleep...
12:55:07.211 -> Sleep...
12:55:09.213 -> Sleep...
12:55:11.197 -> Sleep...
12:55:13.191 -> SIM module intialized
  1. unplug sim800l from power and plug it back
12:59:08.537 -> -------------------------------
12:59:09.536 -> 
12:59:09.582 -> simSerial end
12:59:12.362 -> -------------------------------
12:59:13.366 -> 
12:59:13.366 -> simSerial end
12:59:15.905 -> -------------------------------
12:59:16.921 -> 
12:59:16.921 -> RDY
12:59:16.921 -> 
12:59:16.967 -> +CFUN: 1
12:59:16.967 -> 
12:59:16.968 -> simSerial end
12:59:17.695 -> -------------------------------
12:59:18.710 -> 
12:59:18.710 -> +CPIN: READY
12:59:18.710 -> 
12:59:18.756 -> simSerial end
12:59:20.912 -> -------------------------------
12:59:22.626 -> 
12:59:22.626 -> Call Ready
12:59:22.659 -> 
12:59:22.659 -> SMS Ready
12:59:22.659 -> 

  1. try to send AT command in different way, no success
13:01:44.179 -> -------------------------------
13:01:44.212 -> Serial status: 1
13:01:45.213 -> AT
13:01:45.213 -> 
13:01:45.213 -> Serial end
13:01:52.387 -> -------------------------------
13:01:52.427 -> Serial status: 1
13:01:53.398 -> AT\r
13:01:53.398 -> 
13:01:53.398 -> Serial end

Also, I tried to send SMS from my phone to sim800l, it works fine, information printed out in Serial monitor as well:

12:01:40.616 -> -------------------------------
12:01:40.663 -> simSerial status: 1
12:01:41.633 -> 
12:01:41.633 -> +CMTI: "SM",6
12:01:41.633 -> 
12:01:41.675 -> simSerial end

Here is the wiring diagram:

Not sure is it wort to mention, but wiring part with resistors is done on breadboard.

Here is the code:

#include <AltSoftSerial.h>
#include <SPI.h>
#include <Wire.h>
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>

// arduinoRxPin = 8;
// arduinoTxPin = 9;
AltSoftSerial simSerial;

// OLED 0.91 display
Adafruit_SSD1306 display = Adafruit_SSD1306(128, 32, &Wire);

void getSim800LResponse() {
   
  while (simSerial.available()) {
    Serial.println("-------------------------------");

    String reponse = simSerial.readString();
    Serial.println(reponse);

    dispayMsg(reponse);

    Serial.println("simSerial end");
  }
}

void dispayMsg(String input) {
  display.clearDisplay();
  display.setCursor(0, 0);
  display.println(input);
  display.display();
}

void setup() {
  
  //Begin serial communication with Arduino and Arduino IDE (Serial Monitor)
  Serial.begin(9600);

  //Begin serial communication with Arduino and SIM800L
  simSerial.begin(9600);
  
  /*********************/
  /* OLED module setup */
  /*********************/

  // Address 0x3C for 128x32
  Serial.println("Initializing OLED module...");
  display.begin(SSD1306_SWITCHCAPVCC, 0x3C);

  display.display();
  delay(1000);

  // Clear the buffer.
  display.clearDisplay();
  display.display();

  // text display tests
  display.setTextSize(1);
  display.setTextColor(WHITE);

  Serial.println("OLED module intialized");
  /*************************/
  /* OLED module setup end */
  /*************************/

  /********************/
  /* SIM module setup */
  /********************/

  Serial.println("Initializing SIM module...");

  String command = "AT";

  //Once the handshake test is successful, it will back to OK
  simSerial.println(command);

  getSim800LResponse();

  Serial.println("Sleep...");
  delay(2000);

  //Signal quality test, value range is 0-31 , 31 is the best
  simSerial.println("AT+CSQ"); 
  getSim800LResponse();

  Serial.println("Sleep...");
  delay(2000);

  //Read SIM information to confirm whether the SIM is plugged
  simSerial.println("AT+CCID");
  getSim800LResponse();

  Serial.println("Sleep...");
  delay(2000);

  //Check whether it has registered in the network
  simSerial.println("AT+CREG?");
  getSim800LResponse();

  Serial.println("Sleep...");
  delay(2000);

  Serial.println("SIM module intialized");
  /************************/
  /* SIM module setup end */
  /************************/
}

void loop() {

  if (Serial.available()) {
    Serial.println("-------------------------------");
    Serial.print("Serial status: ");
    Serial.println(Serial.available());

    String command = Serial.readString();
    Serial.println(command);
    simSerial.println(command);

    Serial.println("Serial end");
  }

  getSim800LResponse();
}

Any hint/comment/ help will be appreciated.
If there is something missing in description, don't hesitate to ask.

Cheers!

it is possible that the display interrupts are upsetting the AltSoftSerial transmit timing
try commenting out calls to display functions and see if transmit then works
I would tend to move the application to a Mega and use hardware serial ports

I added display just to make sure something is coming in/out Arduino.
Situation is same with or without display code and module connected or not.

Since response from sim800l is present on module power on, it looks like path sim800l Tx --> Arduino Rx is working fine.
I tried to change wire for Arduino Tx --> sim800l Rx, but problem is still there.

I've looked into code many times, wiring also, couldn't find anything strange.

Would it be good to check Arduino Tx --> RX, for troubleshooting purpose?

running this version of your code (increased Serial baudrate to 115200 and removed display calls

#include <AltSoftSerial.h>
#include <SPI.h>
#include <Wire.h>
//#include <Adafruit_GFX.h>
//#include <Adafruit_SSD1306.h>

// arduinoRxPin = 8;
// arduinoTxPin = 9;
AltSoftSerial simSerial;

// OLED 0.91 display
//Adafruit_SSD1306 display = Adafruit_SSD1306(128, 32, &Wire);

void getSim800LResponse() {
   
  while (simSerial.available()) {
    Serial.println("-------------------------------");

    String reponse = simSerial.readString();
    Serial.println(reponse);

 //   dispayMsg(reponse);

    Serial.println("simSerial end");
  }
}

//void dispayMsg(String input) {
//  display.clearDisplay();
//  display.setCursor(0, 0);
//  display.println(input);
//  display.display();
//}

void setup() {
  
  //Begin serial communication with Arduino and Arduino IDE (Serial Monitor)
  Serial.begin(115200);

  //Begin serial communication with Arduino and SIM800L
  simSerial.begin(9600);
  
  /*********************/
  /* OLED module setup */
  /*********************/

  // Address 0x3C for 128x32
  Serial.println("Initializing OLED module...");
 // display.begin(SSD1306_SWITCHCAPVCC, 0x3C);

//  display.display();
  delay(1000);

  // Clear the buffer.
  //display.clearDisplay();
 // display.display();

  // text display tests
//  display.setTextSize(1);
//  display.setTextColor(WHITE);

  Serial.println("OLED module intialized");
  /*************************/
  /* OLED module setup end */
  /*************************/

  /********************/
  /* SIM module setup */
  /********************/

  Serial.println("Initializing SIM module...");

  String command = "AT";

  //Once the handshake test is successful, it will back to OK
  simSerial.println(command);

  getSim800LResponse();

  Serial.println("Sleep...");
  delay(2000);

  //Signal quality test, value range is 0-31 , 31 is the best
  simSerial.println("AT+CSQ"); 
  getSim800LResponse();

  Serial.println("Sleep...");
  delay(2000);

  //Read SIM information to confirm whether the SIM is plugged
  simSerial.println("AT+CCID");
  getSim800LResponse();

  Serial.println("Sleep...");
  delay(2000);

  //Check whether it has registered in the network
  simSerial.println("AT+CREG?");
  getSim800LResponse();

  Serial.println("Sleep...");
  delay(2000);

  Serial.println("SIM module intialized");
  /************************/
  /* SIM module setup end */
  /************************/
}

void loop() {

  if (Serial.available()) {
    Serial.println("-------------------------------");
    Serial.print("Serial status: ");
    Serial.println(Serial.available());

    String command = Serial.readString();
    Serial.println(command);
    simSerial.println(command);

    Serial.println("Serial end");
  }

  getSim800LResponse();
}

connected to a SIM900 gives

15:04:34.241 -> Initializing OLED module...
15:04:35.239 -> OLED module intialized
15:04:35.239 -> Initializing SIM module...
15:04:35.272 -> Sleep...
15:04:37.263 -> -------------------------------
15:04:38.413 -> AT
15:04:38.413 -> 
15:04:38.413 -> OK
15:04:38.413 -> AT+CSQ
15:04:38.413 -> 
15:04:38.413 -> +CSQ: 0,0
15:04:38.413 -> 
15:04:38.413 -> OK
15:04:38.413 -> 
15:04:38.413 -> simSerial end
15:04:38.413 -> Sleep...
15:04:40.405 -> Sleep...
15:04:42.399 -> -------------------------------
15:04:43.546 -> AT+CCID
15:04:43.546 -> 
15:04:43.546 -> +CME ERROR: SIM not inserted
15:04:43.546 -> AT+CREG?
15:04:43.546 -> 
15:04:43.546 -> +CREG: 0,0
15:04:43.546 -> 
15:04:43.546 -> OK
15:04:43.546 -> 
15:04:43.546 -> simSerial end
15:04:43.546 -> Sleep...
15:04:45.559 -> SIM module intialized
15:04:51.295 -> -------------------------------
15:04:51.295 -> Serial status: 4
15:04:52.313 -> AT
15:04:52.313 -> 
15:04:52.313 -> Serial end
15:04:52.416 -> -------------------------------
15:04:53.424 -> AT
15:04:53.424 -> 
15:04:53.424 -> 
15:04:53.424 -> OK
15:04:53.424 -> 
15:04:53.424 -> simSerial end
15:05:10.017 -> -------------------------------
15:05:10.017 -> Serial status: 5
15:05:11.040 -> AT+CGMI
15:05:11.040 -> 
15:05:11.040 -> Serial end
15:05:11.141 -> -------------------------------
15:05:12.168 -> AT+CGMI
15:05:12.168 -> 
15:05:12.168 -> 
15:05:12.168 -> SIMCOM_Ltd
15:05:12.168 -> 
15:05:12.168 -> OK
15:05:12.168 -> 
15:05:12.168 -> simSerial end
15:06:28.442 -> -------------------------------
15:06:28.442 -> Serial status: 5
15:06:29.461 -> AT+CGMM
15:06:29.461 -> 
15:06:29.461 -> Serial end
15:06:29.563 -> -------------------------------
15:06:30.586 -> AT+CGMM
15:06:30.586 -> 
15:06:30.586 -> 
15:06:30.586 -> SIMCOM_SIM900
15:06:30.586 -> 
15:06:30.586 -> OK
15:06:30.586 -> 
15:06:30.586 -> simSerial end

I can type AT commands and see the response
looking for my SIM800

The power supply should be connected. The module cannot be powered up by the arduino board.

my SIM900 is also powered from a bench supply 5V
what speed is your Serial - I have mine set to

  Serial.begin(115200);

I tried the same code, c/p from your post, just to be sure I'm not missing something. Changed baud rate in Serial monitor as well.
Still problem is present on my side.

Any suggestion how to test Arduino Tx --> sim800l Rx path?

Correct, power supply is connected always to sim800l. Removing sim800l from external supply was only to test that Arduino Rx is receiving startup indications from sim800l.

It is set to 9600, I tried all other speeds but problem is same.
I tried also 115200 as you did with your rest, makes no difference.

I would run the Serial monitor at 115200
and the SIM800 serial at 9600 - the fact that you do receive text such as +CPIN: READY indicates it is correct
have you an oscilloscope to look at the Tx and Rx lines?

Have you tried different values for the voltage divider? Say 1k & 2k.

Ok, will set Serial monitor to 115200 and leave sim800l serial on 9600.
Tried that now, nothing changed.

Unfortunately I don't have an oscilloscope :frowning: .

One thing that is interesting, when I play around with wires, changing GND, I see some "stuff" printed in Serial monitor, but only some strange characters.

I'm I making some mistake with common GND between Arduino and sim800?

Thank you for suggestion, I did try this, this exact combination, but not helping.
I mentioned in reply to horace that maybe I'm messing up something with common GND, but I don't see anything wrong.

Small update, I tried same code on another "wanna be Arduino Uno 3" board, same behavior.

Today I did rewiring again, just to make sure something is not missed.
Also, I read manual for sim800l evb again and decided to use wiring diagram that other did when this module is used.

Since sim800l v2 should be able to handle 5V signal coming from Arduino Tx, voltage divider should not be there, is it not necessary. This was my first approach, but since it was not working, at some moment I decided to try with voltage divider and then I managed to get something on Arduino Rx, so I left it there. Now I'm back to initial wiring (without divider).

Well, now nothing is working :smiling_face_with_tear: :smiling_face_with_tear: no response from sim800l, no message detected in Serial monitor when I power off/on module, nothing. sim800l is there, connected, blinking slowly so it is registered to network and ready to be used.

Also, I double checked mandatory pin setup for AltSoftSerial library, this should be ok:

Board Transmit Pin Receive Pin Unusable PWM
Teensy 3.5 / 3.6 21 20 22
Teensy 3.0 / 3.1 / 3.2 21 20 22
Teensy 2.0 9 10 (none)
Teensy++ 2.0 25 4 26, 27
Arduino Uno, Duemilanove, LilyPad, Mini (& other ATMEGA328) 9 8 10
Arduino Leonardo, Yun, Micro 5 13 (none)
Arduino Mega 46 48 44, 45
Wiring-S 5 6 4
Sanguino 13 14 12

I'm getting really confused now and running out of options :sob: :sob:.

I would like to stick to this wiring, since this module should be able to handle direct connection between Rx/Tx and Arduino Uno side.
5v Power interface Power the module
CONNECT TO DC5v
GND
VDD TTL UART interface The TTL UART serial interface, you can connect the MCU like 51MCU or ARM or MSP430 directly. The pin of VDD is used to match voltage of the TTL.
SIM_TXD
SIM_RXD
GND if this pin is unused, keep open
RST RST the module, if this pin is unused, keep open

According to this, sim800l should handle signals without any voltage divider, since TTL should match with Arduino side.

Since same code work fine when @horace tried it with sim900, then it looks like something is missing/wrong in wiring scheme, and I'm not able to find it.

Am I messing something with common ground?

one thing I did notice was you powered SIM800 VCC from the Arduino 5V - I always used an external bench supply

well, that's not completely correct.

I'm connecting sim800l to external power supply, 5V/3A, to 5V and GND pin.
But I'm also connecting sim800l VDD pin to Arduino 5V pin, due to this:

  • VDD TTL UART interface The TTL UART serial interface, you can connect the MCU like 51MCU or ARM or MSP430 directly. The pin of VDD is used to match voltage of the TTL.

Result is same with or without this connection, makes no difference.

update: it was my bad with last message, I saw I wrote "sim800l Vcc" on wiring picture, it should be "sim800l Vdd", not it is updated.

After some more digging around I saw many other are complaining about this same module, dealing with same, similar or completely different issues.
So at the end I decided to drop this one and try with another type of module, this one I sent back.

Thank you all for support.
For now we I think there will be no solution for case I was dealing with, hopefully situation will be better with new module.

Get a good one!

looking for another device I found mu SIM800l - it is this version
image

following discussion on sim800l-sim800l-evb-v2-0-variations-and-wiring I connected it to an Arduino Mega so
//SIM800L 5V POWER to Mega 5V
//SIM800L GND POWER to Mega GND
//SIM800L VDD to Mega 5V
//SIM800L TXD to Mega RX1 pin 19
//SIM800L RXD to Mega TX1 pin 18
//SIM800L UART TTL GND and RST not connected

ran test program

// SIM800L EVB board GSM modem test for Arduino Due and Mega    - working 7/12/22

// serial monitor line ending should be Carriage Return
// for loopback test connect Mega/Due pins 18 and 19

// connections https://forum.arduino.cc/t/sim800l-sim800l-evb-v2-0-variations-and-wiring/505185/4

// Arduino Mega connections
//SIM800L 5V  POWER to Mega 5V
//SIM800L GND POWER to Mega GND
//SIM800L VDD to Mega 5V
//SIM800L TXD to Mega RX1 pin 19
//SIM800L RXD to Mega TX1 pin 18
//SIM800L UART TTL GND and RST not connected

// Arduino DUE similar to above except
//SIM800L VDD to Due 3.3V

// AT tests
// AT+CGMI  returns the manufacturer's name
// AT+CGMM returns the MODEM model number
// AT+CGMR returns details of the software and model revision level
// AT+CGSN returns the MODEM's serial number

#define mySerial Serial1  

void setup() {
  // Open serial communications and wait for port to open:
  Serial.begin(115200);
  while (!Serial) {  }
  Serial.println("Mega SIM800 test!");
  // set the data rate for the Serial port
  mySerial.begin(9600);//115200);//115200);
}

void loop() { // run over and over
  if (mySerial.available()) {
    Serial.write(mySerial.read());
  }
  while (Serial.available()) {
    char ch;
    mySerial.write(ch=toupper(Serial.read()));
    //Serial.write(ch);
  }
}

worked OK - Serial Monitor output

09:25:15.959 -> Mega SIM800 test!
09:25:21.654 -> AT
09:25:21.654 -> OK
09:25:29.340 -> AT+CGMI
09:25:29.340 -> SIMCOM_Ltd
09:25:29.340 -> 
09:25:29.340 -> OK
09:25:38.095 -> AT+CGMM
09:25:38.095 -> SIMCOM_SIM800L
09:25:38.095 -> 
09:25:38.095 -> OK
09:25:45.932 -> AT+CGMR
09:25:45.966 -> Revision:1418B05SIM800L24
09:25:45.966 -> 
09:25:45.966 -> OK

running the AltSoftSerial code of Post #4 on a UNO connections

//SIM800L 5V POWER to Uno 5V
//SIM800L GND POWER to Uno GND
//SIM800L VDD to Uno 5V
//SIM800L TXD to UNO RX pin 8
//SIM800L RXD to UNO TX pin 9
//SIM800L UART TTL GND and RST not connected

serial Monitor output

10:23:18.409 -> Initializing OLED module...
10:23:19.418 -> OLED module intialized
10:23:19.418 -> Initializing SIM module...
10:23:19.418 -> Sleep...
10:23:21.421 -> -------------------------------
10:23:22.468 -> AT

10:23:22.468 -> OK
10:23:22.468 -> AT+CSQ

10:23:22.468 -> +CSQ: 0,0
10:23:22.468 -> 
10:23:22.468 -> OK
10:23:22.468 -> 
10:23:22.468 -> simSerial end
10:23:22.468 -> Sleep...
10:23:24.465 -> Sleep...
10:23:26.502 -> -------------------------------
10:23:27.550 -> AT+CCID

10:23:27.550 -> ERROR
10:23:27.550 -> AT+CREG?

10:23:27.550 -> +CREG: 0,4
10:23:27.550 -> 
10:23:27.550 -> OK
10:23:27.550 -> 
10:23:27.550 -> simSerial end
10:23:27.550 -> Sleep...
10:23:29.541 -> SIM module intialized
10:23:45.164 -> -------------------------------
10:23:45.164 -> Serial status: 5
10:23:46.154 -> AT+CGMI
10:23:46.154 -> 
10:23:46.154 -> Serial end
10:23:46.187 -> -------------------------------
10:23:47.208 -> AT+CGMI


10:23:47.208 -> SIMCOM_Ltd
10:23:47.208 -> 
10:23:47.208 -> OK
10:23:47.208 -> 
10:23:47.208 -> simSerial end
10:23:57.189 -> -------------------------------
10:23:57.189 -> Serial status: 5
10:23:58.175 -> AT+CGMM
10:23:58.175 -> 
10:23:58.175 -> Serial end
10:23:58.209 -> -------------------------------
10:23:59.261 -> AT+CGMM


10:23:59.261 -> SIMCOM_SIM800L
10:23:59.261 -> 
10:23:59.261 -> OK
10:23:59.261 -> 
10:23:59.261 -> simSerial end