Reciving a "BOX" instead of an incoming SMS with SIM800L

Hello, I wanted to ask if anyone could help me with this problem. I'm trying to receive an SMS with the SIM800L With ESP32 Wrover B. However, I always get a "box" as output as soon as I send a message to the ESP32, which is then repeatedly entered.
I got my AT commands from this website: GSM-spezifische AT-Kommandos.
The ESP32 is connected via USB-C.

Picture from ESP32:
image

CODE:

#define SIM800L_RX     27
#define SIM800L_TX     26
#define SIM800L_PWRKEY 4
#define SIM800L_RST    5
#define SIM800L_POWER  23

void setup()
{
  pinMode(SIM800L_POWER, OUTPUT);
  digitalWrite(SIM800L_POWER, HIGH);

  Serial.begin(115200);
  Serial.println("ESP32+SIM800L AT CMD Test");
  Serial2.begin(9600, SERIAL_8N1, SIM800L_TX, SIM800L_RX);
  Serial.println("Initializing...");
  delay(10000);
  
  Serial2.println("AT"); 
  updateSerial();
  Serial2.println("AT+CMGF=1"); 
  updateSerial();
  Serial2.println("AT+CNMI=1,2,0,0,0");
  updateSerial();

}


void loop() {
updateSerial();
}
void updateSerial()
{
	delay(500);
	while (Serial.available()) {
		// Forward what Serial received to Software Serial Port
		Serial2.write(Serial.read());
	}
	while(Serial2.available()) {
		// Forward what Software Serial received to Serial Port
		Serial.write(Serial2.read());
	}
}

OUTPUT:
image

Copy each box. Paste into a search engine. It will show the underlying hex value. You show a picture, so I can not copy/paste it.

I can't copy the box.
This is what i can copy:

AT

OK

AT+CMGF=1

OK

AT+CNMI=1,2,0,0,0

OK

Serial.write(Serial2.read());

What do you see if you print the value received instead of writing it ?

IT doesnt work i just gives me a bunch of numbersand it doesnt respond when i sent something.

rst:0x8 (TG1WDT_SYS_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:1
load:0x3fff0030,len:1344
load:0x40078000,len:13964
load:0x40080400,len:3600
entry 0x400805f0
ESP32+SIM800L AT CMD Test
Initializing...
65
84
13
13
10
79
75
13
10
65
84
43
67
77
71
70
61
49
13
13
10
79
75
13
10
65
84
43
67
78
77
73
61
49
44
50
44
48
44
48
44
48
13
13
10
79
75
13
10

Yes, it does work.

See e.g. https://www.asciitable.com/.

You are seeing the ASCII codes for what is being printed

65  A
84  T
13  Carriage Return
13  Carriage Return
10  Linefeed
79  O
75  K
13  Carriage Return
10  Linefeed
65  A
84  T
43  +
67  C
77  M
71  G
70  F
61  =
49  1
13  Carriage Return
13  Carriage Return
10  Linefeed
79  O
75  K
13  Carriage Return
10  Linefeed
and so on

There is no sign of the output that is causing the "boxes", which is what I was hoping to see

what should i do now?

i now printet and wrote th output and it seems that the box = -1 wich i don't understand
image

Please show the code that resulted in the image.

-1 usually indicates that you're trying to read while there is no data.

#define SIM800L_RX     27
#define SIM800L_TX     26
#define SIM800L_PWRKEY 4
#define SIM800L_RST    5
#define SIM800L_POWER  23

void setup()
{
  pinMode(SIM800L_POWER, OUTPUT);
  digitalWrite(SIM800L_POWER, HIGH);

  Serial.begin(115200);
  Serial.println("ESP32+SIM800L AT CMD Test");
  Serial2.begin(9600, SERIAL_8N1, SIM800L_TX, SIM800L_RX);
  Serial.println("Initializing...");
  delay(3000);
  
  Serial2.println("AT"); 
  updateSerial();
  Serial2.println("AT+CMGF=1"); 
  updateSerial();
  Serial2.println("AT+CNMI=1,2,0,0,0");
  updateSerial();

}


void loop() {
updateSerial();
}
void updateSerial()
{
	delay(500);
	while (Serial.available()) {
		// Forward what Serial received to Software Serial Port
		Serial2.write(Serial.read());
	}
	while(Serial2.available()) {
		// Forward what Software Serial received to Serial Port
		Serial.write(Serial2.read());
    Serial.println(Serial2.read());
	}
}

While controlling a SIM800 via serial commands directly is not that hard, I would recommend looking into one of the pre-written libraries that support this module. Here's one:

The AT command documentation you're relying on is pretty dated -- for example it talks about Nokia 6110 FBus commands. I think you would do well to refer to the documentation specific to the SIMCom SIM800 module. I found this:

SIM800_Series_AT_Command_Manual_V1.09.pdf

There's a newer version on SIMCom's website, but it's defying my cursory attempts to link it.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.