Wednesday 27 April 2011

Socket and GPRS

Frugando nel mio disordine ho trovato 4 batterie da 1.2V 9000mAh l'una e collegandole in serie sono riuscito a far funzionare il GPRS senza che si spegnesse.

Ho eseguito la registrazine alla rete, attivato il GPRS e mi sono fatto restituire l'ip pubblico, esulto di gioia :D!

>> AT+CGATT=1    - Attach to GPRS Service
<< OK

>> AT+CGDCONT=1,"IP","internet"    - Define PDP Context (cid, PDP type, APN)
<< OK

>> AT+CDNSCFG="208.67.222.222","208.67.220.220" - Configure Domain Name Server (primary DNS, secondary DNS)
<< OK

>> AT+CSTT="internet","","" - Start Task & set APN, User ID, and password
<< OK

>> AT+CIICR     - Bring up wireless connection with GPRS - THIS MAY TAKE A WHILE
<< OK

>> AT+CIFSR        - Get Local IP address
<< 10.190.245.172    - returns IP address assigned to your module
<< OK

>> AT+CIPSTATUS        - Get Connection Status
<< OK
<< STATE: IP STATUS    - returns status of connection, needs to be 'IP STATUS' before you can connect to a server
Ma prima di tutto ciò ho sviluppato in Python il Socket server che mi permetterà di communicare tramite la pagina PHP e il Fez Domino.
Ho preso una base di un Socket server che serviva a fare da chat e l'ho rifatto con la gestione dei comandi.
Inoltre ho completato la pagina PHP che si occuperà nella richiesta delle informazioni.

Socket server:
  • Library Socket
PHP Client:
  • fsockopen
Fez Domino:
  • Library Socket

Rummaging into the my disorder I found 4 batteries of 1.2V 9000mAh each and then connecting these in series I successful to work the GPRS Modulo without problems.


I done the operator registration, activated the GPRS and then I got the public IP, I was very happy!

But before that I developed the Socket server by Python that I will communicate through the PHP page and Fez Domino.
I took the base of Chat server and I rewrite that with the main functions.

Also I done the PHP page that it will get the information and print on screen.


No comments: