Issue GPRS SIM 900
Hi,
I use a SIM 900 module (https://www.amazon.fr/Asiawill-SIM900-Système-Minimum-Module-Bleu/dp/B00K7ZGXFO/ref=sr_1_3?ie=UTF8&qid=1466861994&sr=8-3&keywords=sim900) and a propeller C3
I have a issue with the GPRS connection
My code is the following:
The AT commands ("AT+CGATT=1" and "AT+CREG=1") give me a error, I don't understand why.
If anyone has a hint, I would appreciate.
I use a SIM 900 module (https://www.amazon.fr/Asiawill-SIM900-Système-Minimum-Module-Bleu/dp/B00K7ZGXFO/ref=sr_1_3?ie=UTF8&qid=1466861994&sr=8-3&keywords=sim900) and a propeller C3
I have a issue with the GPRS connection
My code is the following:
CON
_clkmode = xtal1 + pll16x
_xinfreq = 5_000_000
GSM_Rx = 3
GSM_Tx = 4
GSM_Baud = 9600
GPS_power = 5
VAR
byte AT_Reponse[150], latitude[11], N_S[2], longitude[12], E_W[2], Date[6], UTCtime[10], altitude[10], vitesse[10], course[10], AmpI[10], AmpQ[10]
byte degre_lat[3], degre_minute_lat[3], degre_seconde_lat[7], resultat_latitude[15], degre_lon[3], degre_minute_lon[3], degre_seconde_lon[7], resultat_longitude[15]
byte date_jour[5], date_mois[5], date_annee[5], resultat_date[15], jour_local[5], date_local[15]
byte char, ptr, ptr1, ptr2
OBJ
pst : "Parallax Serial Terminal"
GSM : "FullDuplexSerial"
PUB main
pst.start(115200)
Math.Start
GSM.start(GSM_Rx, GSM_Tx, 0, GSM_Baud)
waitcnt(clkfreq*2+cnt)
' Start_Module
latitude[0] := "1"
latitude[1] := "2"
latitude[2] := "3"
latitude[3] := "4"
latitude[4] := "5"
latitude[5] := "9"
latitude[6] := 0
ptr := 0
repeat
gsm.str(string("AT",13))
Rx
pst.Str(String(13))
pst.str(String("La réponse à ta requete est la suivante 0: ",9))
pst.Str(@AT_Reponse)
pst.Str(String(13))
gsm.str(string("AT+CGATT=1",13))
Rx
pst.Str(String(13))
pst.str(String("La réponse à ta requete est la suivante 1: ",9))
pst.Str(@AT_Reponse)
pst.Str(String(13))
gsm.str(string("AT+CGDCONT=1,",34,"IP",34,",",34,"m2minternet",34,13))
Rx
pst.Str(String(13))
pst.str(String("La réponse à ta requete est la suivante 2: ",9))
pst.Str(@AT_Reponse)
pst.Str(String(13))
gsm.str(String("AT+SAPBR=3,1,",34,"Contype",34,",",34,"GPRS",34,13))
Rx
pst.Str(String(13))
pst.str(String("La réponse à ta requete est la suivante 3: ",9))
pst.Str(@AT_Reponse)
pst.Str(String(13))
gsm.str(String("AT+SAPBR=3,1,",34,"APN",34,",",34,"m2minternet",34,13))
Rx
pst.Str(String(13))
pst.str(String("La réponse à ta requete est la suivante 4: ",9))
pst.Str(@AT_Reponse)
pst.Str(String(13))
gsm.str(String("AT+SAPBR=3,1,",34,"USER",34,",",34,"SFR",34,13))
Rx
pst.Str(String(13))
pst.str(String("La réponse à ta requete est la suivante 5: ",9))
pst.Str(@AT_Reponse)
pst.Str(String(13))
gsm.str(String("AT+SAPBR=3,1,",34,"PWD",34,",",34,"SFR",34,13))
Rx
pst.Str(String(13))
pst.str(String("La réponse à ta requete est la suivante 6: ",9))
pst.Str(@AT_Reponse)
pst.Str(String(13))
gsm.str(String("AT+SAPBR=1,1",13))
Rx
pst.Str(String(13))
pst.str(String("La réponse à ta requete est la suivante 7: ",9))
pst.Str(@AT_Reponse)
pst.Str(String(13))
gsm.str(String("AT+CREG=1",13))
Rx
pst.Str(String(13))
pst.str(String("La réponse à ta requete est la suivante 8: ",9))
pst.Str(@AT_Reponse)
pst.Str(String(13))
gsm.Str(String("AT+HTTPINIT",13))
Rx
pst.Str(String(13))
pst.str(String("La réponse à ta requete est la suivante 9: ",9))
pst.Str(@AT_Reponse)
pst.Str(String(13))
gsm.Str(String("AT+HTTPPARA=",34,"CID",34,",1",13))
Rx
pst.Str(String(13))
pst.str(String("La réponse à ta requete est la suivante 10: ",9))
pst.Str(@AT_Reponse)
pst.Str(String(13))
gsm.Str(String("AT+HTTPPARA=",34,"URL",34,",",34,"http://www.smart-wine-cellar.com",34,13))
Rx
pst.Str(String(13))
pst.str(String("La réponse à ta requete est la suivante 11: ",9))
pst.Str(@AT_Reponse)
pst.Str(String(13))
gsm.str(string("AT+HTTPACTION=0",13))
Rx
pst.Str(String(13))
pst.str(String("La réponse à ta requete est la suivante 12: ",9))
pst.Str(@AT_Reponse)
pst.Str(String(13))
gsm.str(string("GET /index.php?latitude="))
gsm.str(@latitude)
gsm.str(string(" "))
gsm.str(string("HTTP/1.1",13,10))
gsm.str(String("Host: www.smart-wine-cellar.com",13,10,13,10,26))
' Rx
'
' pst.Str(String(13))
' pst.str(String("La réponse à ta requete est la suivante 13: ",9))
' pst.Str(@AT_Reponse)
' pst.Str(String(13))
gsm.str(string("AT+HTTPREAD",13))
Rx
pst.Str(String(13))
pst.str(String("La réponse à ta requete est la suivante 14: ",9))
pst.Str(@AT_Reponse)
pst.Str(String(13))
Rx
pst.Str(String(13))
pst.str(String("La réponse à ta requete est la suivante 15: ",9))
pst.Str(@AT_Reponse)
pst.Str(String(13))
Rx
pst.Str(String(13))
pst.str(String("La réponse à ta requete est la suivante 16: ",9))
pst.Str(@AT_Reponse)
pst.Str(String(13))
Rx
pst.Str(String(13))
pst.str(String("La réponse à ta requete est la suivante 17: ",9))
pst.Str(@AT_Reponse)
pst.Str(String(13))
Rx
pst.Str(String(13))
pst.str(String("La réponse à ta requete est la suivante 18: ",9))
pst.Str(@AT_Reponse)
pst.Str(String(13))
Rx
pst.Str(String(13))
pst.str(String("La réponse à ta requete est la suivante 19: ",9))
pst.Str(@AT_Reponse)
pst.Str(String(13))
Rx
pst.Str(String(13))
pst.str(String("La réponse à ta requete est la suivante 20: ",9))
pst.Str(@AT_Reponse)
pst.Str(String(13))
Rx
pst.Str(String(13))
pst.str(String("La réponse à ta requete est la suivante 21: ",9))
pst.Str(@AT_Reponse)
pst.Str(String(13))
Rx
pst.Str(String(13))
pst.str(String("La réponse à ta requete est la suivante 22: ",9))
pst.Str(@AT_Reponse)
pst.Str(String(13))
Rx
pst.Str(String(13))
pst.str(String("La réponse à ta requete est la suivante 23: ",9))
pst.Str(@AT_Reponse)
pst.Str(String(13))
Rx
pst.Str(String(13))
pst.str(String("La réponse à ta requete est la suivante 24: ",9))
pst.Str(@AT_Reponse)
pst.Str(String(13))
Rx
pst.Str(String(13))
pst.str(String("La réponse à ta requete est la suivante 25: ",9))
pst.Str(@AT_Reponse)
pst.Str(String(13))
The AT commands ("AT+CGATT=1" and "AT+CREG=1") give me a error, I don't understand why.
If anyone has a hint, I would appreciate.

Comments
It was a test project and it was supposed to be used abroad too, so GPRS was a problem nonetheless and I dropped it.
I settled to send SMS messages to another module attached to a spinneret. The spinneret module would then take care of sending the position to the server.
With SMS it was extremely reliable.
Massimo