Hi,
I have a FONA 3G (European) with a Vodafone SIM. I manage to connect to GPRS using the Fonatest sketch, as shown below, but I don't know how to open the connection and acquire an IP address.
Network is connected:
n
---> AT+CREG?
<--- +CREG: 0,1
Network status 1: Registered (home)
GPRS is enabled:
FONA> G
---> AT+CGATT=1
<--- OK
---> AT+CGSOCKCONT=1,"IP","connect"
<--- OK
---> AT+CGAUTH=1,1,"",""
<--- OK
---> AT+CIPMODE=1
<--- OK
---> AT+NETOPEN=,,1
<--- Network opened
Reading a website fails:
FONA> w
NOTE: in beta! Use small webpages to read!
URL to read (e.g. www.adafruit.com/testwifi/index.html):
http://www.adafruit.com/testwifi/index.html
****
---> AT+HTTPTERM
<--- ERROR
---> AT+HTTPINIT
<--- ERROR
Failed!
I noticed in another postthat after enabling GPRS an IP was requested and assigned:
---> AT+CGSOCKCONT=1,"IP","gprs.base.be"
<--- OK
---> AT+CGAUTH=1,1,"base","base"
<--- OK
---> AT+CIPMODE=1
<--- OK
---> AT+NETOPEN=,,1
<--- Network opened
---> AT+IPADDR
<--- +IPADDR: 10.26.29.248
What am I missing?
Thanks
Obtain IP Address
Moderators: adafruit_support_bill, adafruit
Please be positive and constructive with your questions and comments.
- KramDratta
- Posts: 16
- Joined: Wed Jan 17, 2018 2:17 pm
Re: Obtain IP Address
Progress:
Located Adafruit_FONA.cpp and inserted the following line into the enable GPRS section @ line 1270:
sendCheckReply(F("AT+IPADDR"), ok_reply); //return the ip-address
Output now reads:
G
---> AT+CGATT=1
<--- OK
---> AT+CGSOCKCONT=1,"IP","connect"
<--- OK
---> AT+CIPMODE=1
<--- OK
---> AT+NETOPEN=,,1
<--- Network opened
---> AT+IPADDR
<--- +IPADDR: 10.32.25.130
Located Adafruit_FONA.cpp and inserted the following line into the enable GPRS section @ line 1270:
sendCheckReply(F("AT+IPADDR"), ok_reply); //return the ip-address
Output now reads:
G
---> AT+CGATT=1
<--- OK
---> AT+CGSOCKCONT=1,"IP","connect"
<--- OK
---> AT+CIPMODE=1
<--- OK
---> AT+NETOPEN=,,1
<--- Network opened
---> AT+IPADDR
<--- +IPADDR: 10.32.25.130
Please be positive and constructive with your questions and comments.