0
votes

I want to use SIM800L V2.0 with Arduino Nano in order to send SMS.

I use a SIM card with pin code. I would like to execute these AT commands through serial interface of the Arduino IDE :

at+cpin="xxxx"
at+cmgf=1
AT+CMGS="+33xxxxxxxxx"
my message to sent through SMS<CTRL+Z>

I'm blocked at the last command. I don't know why.

I use this code to communicate with the sim800l :

#include <SoftwareSerial.h>

SoftwareSerial mySerial(10, 11); 

void setup() {
  Serial.begin(9600);
  mySerial.begin(9600);
}

void loop() {
  if (mySerial.available())
    Serial.write(mySerial.read());

  if (Serial.available()) {
    while(Serial.available())
      mySerial.write(Serial.read());

    mySerial.println();
  }
}

at+cmgf=1 and AT+CMGS="..." returns "ERROR"

So, I tried to get status of my network connection :

at+cops?
+COPS: 0

And, I tried to get a list of all network available :

at+cops=?
+COPS: (1,"Orange F","Orange","20801"),(1,"BOUYGUES TELECOM","BYTEL","20820"),(2,"SFR","SFR","20810"),,(0-4),(0-2)

So, have you any ideas to solve this pb ?

1
Make sure that the output buffer is flushed after sending AT+CMGS="+33xxxxxxxxx". Can you verify that you see the > prompt from the modem after sending this command? It's important to look at the OK and > prompt responses from the modem.drott

1 Answers

0
votes

I'll provide you some general tips.

1) Is the device registered? - Check it by issuing AT+CREG? command

AT+CREG?
+CREG: 0,N

OK

If N=1 your device is registered to the home network. If N=5 you are registered in roaming. Other values of N mean that the registration is ongoing or failed for some reason.

2) Is the Service Center Address set? It's mandatory for MO SMS transmissions. - Set it by issuing AT+CSCA=<number>[,<type>]? command

AT+CSCA="+"+33xxxxxxxxx",145
OK

<number> is the SC of your operator; <type> allow you to choose between national numbering scheme (129) and international numbering scheme (145).

3) In debugging phase, try to understand the ERROR cause by switching to verbose error mode through AT+CMEE=2? command. Then repeat the commands sequence

AT+CMEE=2

OK
AT+CMGS="+33xxxxxxxxx"
> Your text<CTRL+Z>

+CME ERROR: <verbose error>