0

Geofence Error
Moderators: adafruit_support_bill, adafruit

Forum rules
If you're posting code, please make sure your code does not include your Adafruit IO Active Key or WiFi network credentials.
Please be positive and constructive with your questions and comments.

Geofence Error

by crcibernetica on Wed Nov 25, 2015 1:48 pm

I can successfully use the FONA808 breakout to send GPS data to my own server, but when I try to connect to io.adafruit.com I get the following error. It appears we are being rejected by the server? Here is the output with DEBUG turned on:

Geofencing with Adafruit IO & FONA808
Initializing FONA....(may take 10 seconds)
---> AT
<--- OK
---> AT
<--- OK
---> AT
<--- OK
---> ATE0
<--- OK
---> ATE0
<--- OK
---> AT+CVHU=0
<--- OK
---> ATI
<--- SIM808 R13.08

OK

FONA is OK
Checking for network...
---> AT+CREG?
<--- +CREG: 0,1
---> AT+CGPSPWR?
<--- +CGPSPWR: 1
Disabling GPRS
---> AT+CIPSHUT
<--- SHUT OK
---> AT+SAPBR=0,1
<--- OK
---> AT+CGATT=0
<--- OK
Enabling GPRS
---> AT+CIPSHUT
<--- SHUT OK
---> AT+CGATT=1
<--- OK
---> AT+SAPBR=3,1,"CONTYPE","GPRS"
<--- OK
---> AT+SAPBR=3,1,"APN","kolbi3g"
<--- OK
---> AT+SAPBR=1,1
<--- OK
Connected to Cellular!
Connecting to TCP
---> AT+CIPSHUT
<--- SHUT OK
---> AT+CIPMUX=0
<--- OK
---> AT+CIPRXGET=1
<--- OK
AT+CIPSTART="TCP","io.adafruit.com","1883"
<--- OK
<--- STATE: PDP DEACT
Connection failed
MQTT connection failed, resetting...

crcibernetica
 
Posts: 35
Joined: Fri Apr 11, 2014 6:59 pm

Re: Geofence Error

by adafruit2 on Wed Nov 25, 2015 2:00 pm

does it retry and succeed? can you post what happens if you have it send to your own server?

adafruit2
Site Admin
 
Posts: 20064
Joined: Fri Mar 11, 2005 7:36 pm

Re: Geofence Error

by crcibernetica on Wed Nov 25, 2015 2:13 pm

The retries fail in the exact same way. Here is an example of a successful post:
Turning off Fona:
Turning on Fona:
---> AT
<--- AT
---> AT
<--- AT
---> AT
<--- AT
---> ATE0
<--- ATE0
---> ATE0
<--- OK
---> AT+CVHU=0
<--- OK
---> ATI
<--- SIM808 R13.08

OK

FONA is OK
---> AT+GSN
<--- 865067020431097
SIM card: 865067020431097
---> AT+CIPSHUT
<--- SHUT OK
---> AT+SAPBR=0,1
<--- ERROR
Failed to turn GPRS off
---> AT+CIPSHUT
<--- SHUT OK
---> AT+CGATT=1
<--- OK
---> AT+SAPBR=3,1,"CONTYPE","GPRS"
<--- OK
---> AT+SAPBR=3,1,"APN","kolbi3g"
<--- OK
---> AT+SAPBR=3,1,"USER",""
<--- OK
---> AT+SAPBR=3,1,"PWD",""
<--- OK
---> AT+SAPBR=1,1
<--- OK
GPRS ON

---> AT+CGPSPWR?
<--- +CGPSPWR: 0
---> AT+CGPSPWR=1
<--- OK
---> AT+CGPSSTATUS?
<--- +CGPSSTATUS: Location Not Fix
No fix
---> AT+CGPSSTATUS?
<--- +CGPSSTATUS: Location Not Fix
->15
0.00 -0.00 0.00
{1:13,2:534,3:654,4:234,5:654,6:344,7:65,8:0.00,9:-0.00,10:0.00}
166.78.62.254/input/post.json?node=3&apikey=d1699ac02ed979dd0c4af09b84a3c9f5&json={1:13,2:534,3:654,4:234,5:654,6:344,7:65,8:0.00,9:-0.00,10:0.00}
****
---> AT+HTTPTERM
<--- ERROR
---> AT+HTTPINIT
<--- OK
---> AT+HTTPPARA="CID"
<--- OK
---> AT+HTTPPARA="UA"
<--- OK
---> AT+HTTPPARA="URL"
<--- OK
---> AT+HTTPACTION=0
<--- OK
Status: 200
Len: 2
---> AT+HTTPREAD
<--- +HTTPoEAD: 2
GPRS send ok****
---> AT+HTTPTERM
<--- OK

crcibernetica
 
Posts: 35
Joined: Fri Apr 11, 2014 6:59 pm

Re: Geofence Error

by adafruit2 on Wed Nov 25, 2015 2:18 pm

HTTP works, but what about a TCP socket, that's what you need to test :)

adafruit2
Site Admin
 
Posts: 20064
Joined: Fri Mar 11, 2005 7:36 pm

Re: Geofence Error

by crcibernetica on Wed Nov 25, 2015 4:35 pm

We were able to connect with another carrier.

Thanks,

crcibernetica
 
Posts: 35
Joined: Fri Apr 11, 2014 6:59 pm

Re: Geofence Error

by adafruit2 on Wed Nov 25, 2015 5:15 pm

yep sounds like your carrier is blocking direct TCP access for your account

adafruit2
Site Admin
 
Posts: 20064
Joined: Fri Mar 11, 2005 7:36 pm

Please be positive and constructive with your questions and comments.