Issue related to APN names

user1996525 picture user1996525 · Jun 19, 2013 · Viewed 10.5k times · Source

I am using simcom900 modem,I am successfully able to establish GPRS connection and send data from my module to server.I am using 2g Airtel SIM and I have given APN name as "airtelgprs.com".I have also tried by giving different APN names which are not related to airtel network then also I could establish connection and transfer data to server.

Please let me know how is this possible?

Answer

user1725145 picture user1725145 · Jun 20, 2013

With the SIM unlocked, try entering

AT+CGDCONT?

Now you should see all the stored contexts, something like this:
+CGDCONT: 1,”IP”,”airtelgprs.com”,”0.0.0.0″,0,0
+CGDCONT: 2,”IP”,”other apn”,”0.0.0.0″,0,0
+CGDCONT: 3,”IP”,”other apn2”,”0.0.0.0″,0,0

Now try to activate each context in turn

AT+CGACT=1,1 (first parameter activates the context, 2nd parameter defines which context is activated)
You should get "OK" if the activation was successful. Now deactivate context number 1 with

AT+CGACT=0,1 OK

Now, try to activate one of the wrong apns:
AT+CGACT=1,2 You should get something like:
+CME ERROR: no network service
(switch on error reporting with AT+CME)

Now delete the stored contexts with the correct APN, by setting them to empty:
AT+CGDCONT=1,"","","",0
OK
Check that they are gone:
AT+CGDCONT?
(get only contexts with wrong APNs)

Now try your AT command again, with a wrong APN:
AT+CSTT="some wrong apn" etc.

You should hopefully see that it doesn't connect. If it doesn't connect, maybe AT+CSTT always connects on the saved context number 1, even if you give it a different APN. It should be easy to test that theory by playing with AT+CGDCONT and the stored contexts.

AT+CGDCONT and AT+CGACT are standard AT commands, you can find the full reference in 3GPP TS 27.007.