How to check Internet connectivity in BGS2-W?? | Telit Cinterion IoT Developer Community
September 11, 2018 - 11:42am, 2816 views
How to get IP address of GSM modem once it is registered and how to check availability of internet connectivity BGS2-w GSM/GPRS module?
Hi
Can you say more details?
While you are connected to server you can check your IP by "AT^SICI?"
When you are using PDP contex you can check by: "AT+CGPADDR=[cid]". But to activate cid you have to set up "AT+CGDCONT" and activate it by "AT+CGACT".
To check your internet connectivity you can ping some server, for example:
at^sics=0,"conType","GPRS0"
AT^SICS=0,apn,"internet" //check your setup of your network provider
AT^SISX="Ping",0,8.8.8.8,4,2000 //8.8.8.8 is google dns
Regards
Krzysztof
while firing this commands, I am getting this response but it is not showing Ip address of my board ;
AT+CGDCONT= 1,"IP","airtelgprs.com","0.0.0.0",0,0
OK
AT+CGPADDR=1
+CGPADDR: 1,"0.0.0.0"
And but while pinging, I am able to ping but to test the HTTPs I not able to connect with Http
AT^SISX="Ping",0,www.google.com,4,2000
^SISX: "Ping",1,0,"172.217.31.100",249
^SISX: "Ping",1,0,"172.217.31.100",272
^SISX: "Ping",1,0,"172.217.31.100",230
^SISX: "Ping",1,0,"172.217.31.100",276
^SISX: "Ping",2,0,4,4,0,0
^SISX: "Ping",3,0,230,276,256
OK
AT^SISX="Ping",0,www.google.com,4,2000
^SISX: "Ping",1,0,"172.217.31.100",-1
^SISX: "Ping",1,0,"172.217.31.100",-1
^SISX: "Ping",1,0,"172.217.31.100",-1
^SISX: "Ping",1,0,"172.217.31.100",-1
^SISX: "Ping",2,0,4,0,4,100
AT^SICS=0,CONTYPE,GPRS0
OK
AT^SICS=0,ALPHABET,0
OK
AT^SICS=0,INACTTO,65
OK
For connecting HTTP server we following below mention step but I am not able to connect !!
AT^SICS=0,APN,airtelgprs.com
OK
AT^SICS=0,USER,internet ""
OK
AT^SICS=0,PASSWD,internet ""
OK
AT^SISS=0,SRVTYPE,HTTP
OK
AT^SISS=0,ALPHABET,0
OK
AT^SISS=0,conId,0
OK
AT^SISS=0,hcMethod,1
OK
AT^SISC=0
OK
AT^SISS=0,address,"https://0d39905b-d47f-40fc-b4e9-4d27bbd37d53.mock.pstmn.io/mototest"
OK
AT^SISS=0,hcContLen,150
OK
AT^SISO=0,1
^SISO: 0,"Http",2,0,0,0,"0.0.0.0:0","0.0.0.0:0"
OK
AT^SISW= 0,10
+CME ERROR: operation not allowed
AT^SISW=1,19,1
ERROR
Hi
I think that I have passed with your understanding of the subject.
PDP context setting by CGDCONT is in that way:
AT+CGDCONT= 1,"IP","airtelgprs.com"
AT+CGACT=1,1
AT+CGPADDR=1 -> It will give your IP.
But i see your case is other than just "checking internet connetion". What is your test case so I will can reproduce your issue?
I've chceck and if I set "hcMethod" to 0 and then check your server it works.
I reccommend you to test with this site: http://httpbin.org
http://httpbin.org/get -> you can check GET parameters
http://httpbin.org/post -> for POSTs
My step by step logs:
AT^SICS=0,CONTYPE,GPRS0
AT^SICS=0,ALPHABET,0
AT^SICS=0,INACTTO,65
AT^SICS=0,APN,internet (my operator)
AT^SISS=0,SRVTYPE,HTTP
AT^SISS=0,ALPHABET,0
AT^SISS=0,conId,0
AT^SISS=0,address,"https://0d39905b-d47f-40fc-b4e9-4d27bbd37d53.mock.pstmn.io/mototest"
at^siss=0,"secOpt","-1"
(or you can set at^siss=0,"secOpt","" but then you will able to test only with normal HTTP without 's')
and here check that: "secOpt" parameters for using TLS. { secOpt = "" (default) - do not use secure connection (TLS) / secOpt = "-1" - use secure connection (TLS) without check certificates }
For working with your server:
AT^SISS=0,"hcContLen","10" - for sending POST data in 10 length size.
AT^SISS=0,hcMethod,1 - for POST method
AT^SISC=0 -> To be sure all was closed before
AT^SISO=0
(LOGS:
at^siso=0
OK
-> Wait for 10s
^SISW: 0,1
at^sisw=0,10
^SISW: 0,10,0 -> HERE WRITE 10 bytes of data, like: "1234567890"
OK
^SISW: 0,2
^SIS: 0,0,2201,"HTTP/1.1 404 Not Found" -> i think it's okay because i don't know what POST data are you expect
^SIS: 0,0,201,"HTTP/1.1 404 Not Found"
at^sisc=0
OK
)
Next check with GET: AT^SISS=0,hcMethod,0
AT^SISO=0
OK
-> wait for 10s
^SIS: 0,0,2201,"HTTP/1.1 200 OK"
^SISR: 0,1
AT^SISR=0,20
^SISR: 0,14
OK FROM SERVER
OK
^SISR: 0,2
AT^SISC=0
OK
I think you can check it by this way. I see are you able to ping google so you have internet connection.
Regards
Krzysztof