Home › Forums › M2M Support Forum › How to Validate Operator APN
This topic contains 13 replies, has 2 voices, and was last updated by Admin 6 years, 10 months ago.
-
AuthorPosts
-
?HebaDear Sir,
Kindly please be informed that i’m using Cinterion-BG2-E. and I need to connect to GPRS then to Connect to server using TCP/IP connection
First I fill the data of Network, “APN”,”Password” and “Username” as shown below
AT+CPIN?
+CPIN: READYOAT^SICS=0,CONTYPE,GPRS0
OK
AT^SICS=0,ALPHABET,1OK
AT^SICS=0,”INACTTO”,”65535″OK
AT^SICS=0,APN,”internet.vodafone.net”OK
AT^SICS=0,USER,”internet”OK
AT^SICS=0,PASSWD,”internet”OK
AT^SISS=0,SRVTYPE,TRANSPARENTOK
AT^SISS=0,ALPHABET,1
////////////////////////////////////////
Then to Connect to server
///////////////////////////////////////
AT^SISC=0OK
AT^SISS=0,ADDRESS,”4.0.0.2:80″OK
AT^SISO=0OK
^SISW: 0, 1
AT^SIST=0
CONNECT
//////////////////////////////
Now I need to now how to validate if device is connected to GPRS successfully first before trying to connect to server.Also how to validate if the inserted APN,Username and password of operator is correct?
Thank you
First you can use the generic AT commands to check if getting a successful IP address after activating the PDP profile.
AT+CREG? +CREG: 0,5 OK Device is registered and is roaming. Checking if device is already connected... AT+CGACT? +CGACT: 1,0 +CGACT: 2,0 +CGACT: 3,0 OK AT+CMEE=1 OK Attaching to network... AT+CGATT=1 OK Connecting... AT+CGACT=1, 1 OK Connection is successful AT+CGACT? +CGACT: 1,1 +CGACT: 2,0 +CGACT: 3,0 OK Device is connected. AT+CGPADDR= 1 +CGPADDR: 1,"10.102.162.113" OK IP Address of the connected profile is "10.102.162.113" In your example, you can check the service state of the service profile 0. If the connection is successful, you should see that IP address has been assigned to service profile 0. At^SISO? ^SISO:0,"Transparent","4","2","0","16","10.10.0.200:1024","10.10.0.108:65532" OK
?HebaDear,
AT+CREG?
+CREG: 0,1Ok
AT+CGACT?
OKOAT+CGATT=1
OK
AT+CGACT=1, 0
+CME ERROR: 21Kindly please assist
?HebaDear,
Thank you for your kind reply but command
AT+CGACT?
is always returning “OK” only. Although I can’t see where you set the value of APNThank you
On the AT Command Tester tool, in the ‘Data Call’ tab, you can add a PDP profile which will store the APN information. First do a ‘Get PDP Comtexts’ to read the PDP profiles stored in the device. Then you can either edit an existing one or add a new profile.
//AT Command to add a PDP profile AT+CGDCONT= 2,"IP","internet.vodafone.net","0.0.0.0",0,0 OK PDP Context list updated sucessfully AT+CGDCONT? +CGDCONT: 1,"IP","bluevia.movistar.es","0.0.0.0",0,0 +CGDCONT: 2,"IP","internet.vodafone.net","0.0.0.0",0,0 +CGDCONT: 3,"IP","","0.0.0.0",0,0 OK Following connection profiles are available, CID-> 1 PDP Type->IP APN->bluevia.movistar.es PDP Address->0.0.0.0 Data Compression->0 Header Compression->0 CID-> 2 PDP Type->IP APN->internet.vodafone.net PDP Address->0.0.0.0 Data Compression->0 Header Compression->0 CID-> 3 PDP Type->IP APN-> PDP Address->0.0.0.0 Data Compression->0 Header Compression->0 Checking registration status... AT+CREG? +CREG: 0,5 OK Device is registered and is roaming. Checking if device is already connected... AT+CGACT? +CGACT: 1,0 +CGACT: 2,0 +CGACT: 3,0 OK AT+CMEE=1 OK Attaching to network... AT+CGATT=1 OK Connecting... //Note activating the profile is failing for me because the APN doesn't match my network. But you should this should return successful AT+CGACT=1, 2 +CME ERROR: 133 Connect Failure - 133
hebaDear,
Thank you again for your help.
I figured out the reason behind +CME ERROR: 21 is that i’m trying with CID
“AT+CGDCONT= 0,”IP”,”internet.vodafone.net”,”0.0.0.0″,0,0″ but when i changed it to
AT+CGDCONT= 1,”IP”,”internet.vodafone.net”,”0.0.0.0″,0,0 it works fine till last step but
AT+CGACT=1,1
+CME ERROR: 133And i’m sure that APN is matched with SIM card
ATE1
OKAT+CFUN=1
OKAT+CMEE=1
OKAT+CPIN?
+CPIN: READYOAT+CGDCONT= 1,”IP”,”internet.vodafone.net”,”0.0.0.0″,0,0
OKAT+CREG?
+CREG: 0,1OAT+CGACT?
+CGACT: 1,0OK
AT+CGATT=1
OKAT+CGACT=1,1
+CME ERROR: 133Thank you
Hi,
CME Error 133 – “requested service option not subscribed“. This means that the SIM is not provisioned for the service you’re requesting..
What you can do,
– You can confirm with your network operator whether your SIM has been activated for data service
– Try another SIM card that you think is active
hebaDear,
Kindly please be informed that the commands mention the original topic works and GPRS is connected and i can connect to server successfully with the same SIM cardDid i miss something?
Thank you
hebaDear Admin,
Kindly please i need to know how to validate APN after writing below Code
AT+CPIN?
+CPIN: READYOAT^SICS=0,CONTYPE,GPRS0
OK
AT^SICS=0,ALPHABET,1OK
AT^SICS=0,”INACTTO”,”65535?OK
AT^SICS=0,APN,”internet.vodafone.net”OK
AT^SICS=0,USER,”internet”OK
AT^SICS=0,PASSWD,”internet”OK
AT^SISS=0,SRVTYPE,TRANSPARENTOK
AT^SISS=0,ALPHABET,1Thank you
You can use the AT^SISO? command to query the status of the service
Here is the response format. .^SISO: <srvprofileid>, <srvparmtag>value "srvType" [, <srvstate>, <socketstate>, <rxcount>, <txcount>, <locaddr>, <remaddr>] [^SISO: ...] OK
At^SISO? ^SISO:0,"Transparent","4","2","0","16","10.10.0.200:1024","10.10.0.108:65532" OK
- This reply was modified 6 years, 12 months ago by Admin.
hebaDear,
Thank you. But at this point i don’t know of the required server is down or Operator parameters “APN,Password and UserName” are invalid,Right?
What response are you getting for AT^SISO? If the connection to the remote server is not successful, you would not have IP assignment in the AT^SISO response.
What is the response for AT+CGACT?
You could then check if any of the profile if active and query the IP address as shown below. This only validates that APN is correct. IP assignments for remote server in the AT^SISO validates remote server connection.
AT+CGACT? +CGACT: 1,1 +CGACT: 2,0 +CGACT: 3,0 OK Device is connected. AT+CGPADDR= 1 +CGPADDR: 1,"10.102.162.113" OK
BurakDear all,
I’ve recently started working on this issue. I’m looking for a solution to the problem below. This would be most grateful if you could help me with. Thank you in advance.Checking registration status…
AT+CREG?
+CREG: 0,1
OK
The device is registered in home network.
Checking if device is already connected…
AT+CGACT?
+CGACT: 1,0
+CGACT: 2,0
OK
AT+CMEE=1
OK
Attaching to network…
AT+CGATT=1OK
Connecting…
AT+CGACT=1, 1
OK
Connection is successful
AT+CGACT?+CGACT: 1,1
+CGACT: 2,0
OK
Device is connected.
AT+CGPADDR= 1+CGPADDR: 1,”10.89.51.239″
OK
IP Address of the connected profile is “10.89.51.239”
AT+CGPADDR= 1
+CGPADDR: 1,”10.89.51.239″
OK
AT+CGDCONT?
+CGDCONT: 1,”IP”,”internet”,”0.0.0.0″,0,0
+CGDCONT: 2,”IP”,”epc.tmobile.com”,”0.0.0.0″,0,0
OK
AT+CREG?
+CREG: 0,1
OK
AT+CGACT?
+CGACT: 1,1
+CGACT: 2,0
OK
Hi Burak,
Based on your logs, it looks like device is successfully connected to the network. What is our question? -
AuthorPosts