# SIM900 Error on AT Command AT+SAPBR=1,1

I intend to send some information through GET method to a php page using the SIM900 module.

I tried the following sequence of commands with success.

AT+CSQ
AT+CGATT?
AT+SAPBR=3,1,"CONTYPE","GPRS"
AT+SAPBR=3,1,"APN","internet"
AT+SAPBR=1,1
AT+HTTPINIT
AT+HTTPPARA="URL","www.my_URL.com/stuff.php?variable=TEST"
AT+HTTPACTION=0
AT+HTTPREA


Note that my service provider doesn't require username & password for accessing, also "internet" is the name of the APN.

Afterwards, I wrote a program on the mbed, that sends this code to the module, then wait for a pre-determined amount of time, read the response and proceed.

I started getting an error specifically on the AT+SAPBR=1,1 command. I tried the commands manually and now I always get the error on this command. This is the comand that opens the bearer.

What I have tried: On the AT+SAPBR=? command, the second parameter is the bearer ID, so I tried using, for instance, 2 instead. And it works.

I find this very strange and I'm trying to figure out why '1' as ID keeps getting me stuck?

• This question appears to be off-topic because it has nothing to do with electronic design. – Leon Heller Oct 7 '14 at 9:02
• How come it's not? I'm using a GPRS module on my design, which is giving me trouble. If this isn't the place where people would know about AT commands and GSM modules, I'm really lost. SIM900 is being one of the most used gsm/gprs modules around electonics and nowadays, in my opinion, electronics is really much more than diodes and transistors. So let's just skip all those arduino questions, because arduino is rather a toy, not a microcontroller. Or just skip al microcontroller questions, because microcontrollers are programmable. Not electronic. – Sergio Oct 7 '14 at 9:20
• Do either AT+CMEE or AT+CEER give you any more useful error info? – brhans Oct 8 '14 at 1:05
• @Sergio, not sure if this is just a typo in your question, but for AT+SAPBR=? and all other AT+SAPBR variants the first parameter looks like the command type, the second is the bearer ID, does that explain the results you're getting? – PeterJ Oct 8 '14 at 10:32
• Their (SimCom) documentation is so gawd damn awful (and on a pretty slow server) that their chips really don't deserve to be bought. It made me remember what Alan Cox once said about a different hardware company... something about their brains not speaking English. I can see similar questions about this SAPBR command on the net... and nobody knows much. I would bug the company with this problem, if I had any pull with them. Good luck. – Fizz Jan 6 '15 at 17:07

## 3 Answers

I'm actually also working on a SIM900 and had the same problem.

One possible cause of the problem is that the SIM900 already has made a connection. Try re-starting the sim900 before issuing the commands.

Also I set the APN settings with the AT+CSTT= command

Below the in/output of my serial connection:

For testing purposes use this. Be sure to have the right APN settings, this will differ for other countries and ISPs.

StopSim900;
[SIM] Stopping
[SIM] Module disabled.
StartSim900;
[SIM] Starting...
[SIM] Module started
-----------DEBUG-----------//Pressed button 1 here. Initiates the HTTP get
AT+CSTT="internet","tmobile","tmobile"
AT Issued, response:
OK

AT+SAPBR=1,1
AT Issued, response:
OK

AT+HTTPINIT
AT Issued, response:
OK

AT+HTTPPARA="CID",1
AT Issued, response:
OK

AT+HTTPPARA="URL","http://www.minimalsites.com/"
AT Issued, response:
OK

AT+HTTPACTION=0
AT Issued, response:
OK

-----------DEBUG-----------//Pressed button 2 here, reads the http message
AT+HTTPREAD=20,10
AT Issued, response:
+HTTPREAD:10
>Minimal S
OK

AT+HTTPTERM
AT Issued, response:
OK


I have left my answer here for further reference.

i think there is a small misconception with that command ...just power down and on and execute the above sequence commands it works damn sure..actually when once AT+SAPBR=1,1 is executed it automatically connected so again when executed this command it automatically replies error pls check this ..

• Thanks for the reply, but I'm not sure I follow. You mean the device must be power cycled every time? Could you please clarify what do you mean by "actually when once AT+SAPBR=1,1 is executed it automatically connected so again when executed this command it automatically replies error"? Thanks! – Sergio Feb 20 '15 at 14:44
• On error, I suceed to close the bearer first AT+SAPBR=0,1 and then open it again AT+SAPBR=1,1. – user68781 Feb 27 '15 at 14:20
• I think it gives error only in the case of already being connected,and again we are attempting to connect,once power it down and on and execute the above commands sequentially,surely this works.. – Ayla kumar Mar 4 '15 at 11:23

Close the bearer first

AT+SAPBR=0,1

and then open it again

AT+SAPBR=1,1