Publicación en el servidor php usando SIM900 GPRS con comandos AT

Estoy usando un módulo SIMCOM SIM900 GSM/GPRS en una aplicación de hardware integrada. En lugar de enviar datos del dispositivo a un servidor por SMS (lo que he estado haciendo hasta ahora), quiero cambiar y comenzar a usar GPRS para enviar datos a un servidor con un script PHP que he escrito.

La literatura SIM900 ( pdf ) es abismal. La Sección 13 proporciona una secuencia de ejemplo para conectar GPRS, que he ensamblado con algunos otros bits, pero no puedo hacerlo funcionar:

*COMMAND*           *RESPONSE*  *COMMENT*
ATD*99#             CONNECT     Establish connection
AT+CGATT?           +CGATT:1    Check connection
AT+CGDCONT=1,"IP"   OK          Set context
AT+HTTPINIT         OK          Enable HTTP mode
AT+HTTPPARA="URL","www.google.com"
                    OK          Set the address
AT+HTTPDATA="data"  OK          Send some data

Obtengo las respuestas esperadas, pero no sucede nada después del último paso.

Incluso si responde a su propia pregunta de inmediato, esto es un mal ejemplo para que la gente asuma que somos la alternativa gratuita a Freelancer.com. Desafortunadamente, voy a estar de acuerdo con la votación cerrada, para protegerme en el futuro de muchas más preguntas que realmente pretenden tenernos como Google-Code-Monkeys. Espero que pueda reescribir/reagrupar su par de preguntas y respuestas para que se ajuste mejor a las reglas de preguntar.
@Asmyldof, con los comandos AT en el SIM900 hay una respuesta muy específica a esta pregunta. ¿Debería editar la pregunta para que quede más claro que realmente hay un conjunto muy limitado de posibles soluciones?
El punto de mi comentario, y unirme al cierre, es que su pregunta dice que aquí está mi problema, arréglelo. Incluso si, para los pocos elegidos que conocen el conjunto AT, ese no es el caso. Esto luego invita a otros que lo ven a hacer preguntas similares sobre problemas más amplios o más complejos y el mantenimiento de eso es un infierno para todos los que lo intentan aquí. Solo estamos evitando que la bola de nieve ruede más rápido de lo que podemos perseguirla. Si puede reducir la pregunta real para que se ajuste más a las reglas para preguntar (problema específico con una descripción de lo que se intentó, etc.), se puede reabrir y/o proteger.
@Asmyldof eso tiene sentido. Hice algunas ediciones, ¿cómo se ve ahora?
¡Mucho mejor! Considere este su primer voto de reapertura.

Respuestas (2)

Después de mucho buscar en Google y mezclar varias respuestas, lo hice funcionar.

Aquí está la secuencia de comandos AT. Puede probar esto de principio a fin, solo necesitará confirmar el APN del operador que está utilizando.

// My comments are here
Command to send is here             Expected responses are here

// See if the SIM900 is ready
AT                                  OK

// SIM card inserted and unlocked?
AT+CPIN?                            +CPIN: READY
                                    OK

// Is the SIM card registered?
AT+CREG?                            +CREG: 0,1
                                    OK

// Is GPRS attached?
AT+CGATT?                           +CGATT: 1
                                    OK

// Check signal strength - should be 9 or higher
AT+CSQ                              +CSQ: 14,0
                                    OK

// Set connection type to GPRS
AT+SAPBR=3,1,"Contype","GPRS"       OK

// Set the APN - this will depend on your network/service provider
AT+SAPBR=3,1,"APN","wholesale"      OK

// Enable GPRS - this will take a moment or two
AT+SAPBR=1,1                        OK

// Check to see if connection is correct and get your IP address
// (I hid mine here, but you'll get a real IP back)
AT+SAPBR=2,1                        +SAPBR: 1,3,"0.0.0.0"
                                    OK

// Enable HTTP mode
AT+HTTPINIT                         OK

// Set HTTP profile identifier
AT+HTTPPARA="CID",1                 OK

// Put in the URL of the PHP webpage where you will post - 
// the URL below is a test server so you can use it in testing
AT+HTTPPARA="URL","http://posttestserver.com/post.php"
                                    OK

// Tell the SIM900 how much data you'll send (18 bytes here) 
// and how long to wait for a time-out (10,000 ms here)
AT+HTTPDATA=18,10000                DOWNLOAD

// Key in the data you want to send after you get the "DOWNLOAD" prompt.
vdc=12&adc=3&rel=8                  OK

// Post the data - wait a second for the response
AT+HTTPACTION=1                     OK
                                    +HTTPACTION:1,200,142

// Read the response - www.posttestserver.com will give you a 
// URL where you can confirm that it's working
AT+HTTPREAD                         +HTTPREAD:142

"Successfully dumped 0 post variables. View it at 
http://www.posttestserver.com/data/2016/04/28/14.19.041655610622
Post body was 18 chars long."
                                    OK

// Close the HTTP connection
AT+HTTPTERM                         OK

// Disconnect the GPRS
AT+SAPBR=0,1                        OK

Editar para agregar: aquí están las fuentes que usé para juntar todo esto, junto con la ayuda de algunas personas a las que pregunté en mi laboratorio.

solo corre AT+HTTPPARA="CONTENT","application/x-www-form-urlencoded" antes AT+HTTPDATA=137,20000y es bueno para ir
AT

AT+CIPSHUT

AT+CGDCONT=1,"IP","www"

AT+CSTT="www","","" 

AT+CIICR

AT+CIFSR

AT+CIPSHUT

AT+CIPHEAD=1

AT+CIPSTART="tcp","52.66.122.8","8000" 

AT+CIPSEND

POST http://52.66.122.8 HTTP/1.1(ctrl+m)(ctrl+j)

Host: 52.66.122.8:8000(ctrl+m)(ctrl+j)

User-Agent:curl/7.47.0(ctrl+m)(ctrl+j)

Content-Length:11 (ctrl+m)(ctrl+j)

Content-Type:application/x-www-form-urlencoded(ctrl+m)(ctrl+j)(ctrl+j)

data=ramesh(ctrl+z)

Obtendrá una respuesta exitosa aquí.