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.


Thursday 21 April 2011

Gprs Module

Oggi ho provato a inviare un sms e chiamare tramite i comandi AT.
Ho riscontrato un problema riguardante all'alimentazione, non riuscivo a tenere attivo il modulo ad ogni registrazione alla rete poichè fà un picco di 2A e la batteria non riusciva darglielo.
Ora sono in attesa che il produttore mi confermi quale pezzo comprare.


Eccovi qua alcuni esempi di comandi:

Registrazione alla rete

AT+CFUN=1 //Set ME o full functionality.
AT+CMGF=1 //Set text mode
AT+CPIN=1234  //Set up sim pin
AT+CREG=1 //Report registration
AT+COPS=0 //Ask for automatic registration


Chiama

ATD<num> //Call the <num>

Invio sms

AT+CMGS=<num> //Send text to <num>
//Write text
<Ctrl+Z> //Send



Today I tried to send a sms and call through AT commands.
I discovered a problem about the power, I couldn't take on the module to each registration to the network because it takes sometimes 2A and the battery couldn't give that.
Now  I'm waiting that the producer give me an answer about which item I need to buy.

There are some example how to use AT commands ( see above ) .



Tuesday 19 April 2011

Finally it works!

Finalmente ora funziona, errore mio dove usavo un alimentazione esterna e non la passavo tramite il Fez Domino.


Ora continuerò il mio progetto, qua un esempio di codice con video:

Servo s = new Servo((Cpu.Pin)FEZ_Pin.PWM.Di10, (Cpu.Pin)FEZ_Pin.PWM.Di9);
            s.Center();
            for (int i = 0; i < 30; i++)
            {

                Thread.Sleep(100);
                s.Left();
            }
            for (int i = 0; i < 30; i++)
            {

                Thread.Sleep(100);
                s.Right();
            }


Il servo si muove da 0 a -30 gradi e poi da -30 a 0  gradi.
Attualmente sto lavorando nella organizzazione del codice e dei thread che dovranno girare al momento della messa in funzione.

Finally works now, It was my error about the power where I had connected directly to servo and not through the Fez Domino.

Now I'm working to make the next step of my project ( up you can see a little part of code ).



The servo moves between 0 and -30 degrade and  then between -30 and 0 degrade.
Actualy I'm working to organize the code and the threads that will be executed when the project will be finished.

Thursday 14 April 2011

Schematics Socket

Oggi mi sono imbattuto nel problema della communciazione dei dati tra FEZ Domino e l'interfaccia Web, avevo alcuni dubbi siccome non potevo fare una connessione diretta poichè l'ip del gprs non lo permette.

Il brainstorming era quello di trovare una soluzione semplice ed efficace.
Alla fine ho optato nel creare un server in python dove le due parti si scambiano le informazioni  ( come una chat IRC ).

Inoltre adoperando questa opzione è possibile diminuire le operazioni fatte dal Fez Domino ed eseguire solo lo stretto necessario.




Today I stumbled into a trouble about communication between FEZ Domino and the web interface, I had some doubts because I couldn't do a direct connection because the ip gprs won't allow it.

The brainstorming was that to find a simply and perfomance solution.
In the end I chose to make a server with python where both sides will exchange information

Also striving this option is possible to decrease the operation of Fez domino and to execute only the important operation.

 

Wednesday 13 April 2011

Fez Domino

Oggi è arrivato la parte principale, il FEz Domino, ho provato a creare i primi programmi del tipo "Scrivi Hello world", "Premi il pulsante  e accendi il led", "Led Blink".



La programmazione è veramente facile, con un minimo di conoscienza della programmazione ad oggetti, tutti posso creare un'applicazione.

Ho anticipato l'arrivo della board col sviluppare la classe per la gestione dei servi, ora devo riuscire a creare un'interfaccia grafica per la gestione.



Today is arrived the main part, the Fez Domino, and I tried to make some programms as "Write Hello World", "Press button and then turn on the led", "Led blink".


The developing is realy easy, with a minimal knowledges of OGG you can make an application.

I anticipated the arrival of the board with I developed the class of the management of Servo and then now I need to make a web interface for management.

Tuesday 5 April 2011

Shopping list

Ho iniziato a comprare alcuni pezzi per iniziare il progetto, ecco la mia lista:
  • Servo SG90
 Product name: SG90 9g Servo
  Dimension: 23mm x 12.2mm x 29mm
  Weight: 9g
  Stall Torque. 1.5Kg/cm at 4.8V
 Operationg Speed: 0.12sec / 60 degress ( 4.8v no load)


  •  Jumpers Wires Male/Female
 Wire AWG: 24
 Lenght: 20cm and 30cm





  •  SIMCOM SIM300 GPRS+GSM
Power input: 5+
Communcation: RS232/TTL
Applications: SMS GPRS and Call




  •  Fez Domino
     Based on Microsoft's .NET Micro Framework
    Runs on 72Mhz NXP ARM processors
    Pin compatible with Arduino
    Shield Compatable
    It's freakin' easy to use!


Ho comprato il modulo gprs ora siccome era un'offerta su ebay, 40 dollari invece dei 150 dollari del modulo ufficiale per Arduino e Fez.
Appena mi arrivano i pezzi inizierò nello sviluppare il movimento dei servi ( per girare la camera ) e un'interfaccia web per gestire il movimento.



English:


I began buying some items to start my project and this is my list: ( look up )



I already bought the gprs module whereas I found a good offer in Ebay, just 40 dollar instead 150 dollar of official module for Arduino and Fez.
As soon as I reach the pieces I will begin to develop moviment of servo  ( to turn  the camera ) and a web interface for managing the moviment.

Sunday 3 April 2011

Descrizione / Description

Il progetto consiste nel creare una webcam motorizzata che sarà comandata tramite un modulo gprs ed eventualmente implmentare il modulo sensor motion e sensore temperatura.

I pezzi scelti sono i seguenti:
  • Fez Domino
  • DFRobot I / O Expansion
  • DFRobot DHT11 Temperature and Humidity Sensor
  • 2x Servo
  • LinkSprite camera
  • PIR Motion Sensor Detector 
  • SIMCOM SIM300 GPRS+GSM
Il modulo gprs l'ho comprato su ebay siccome non mi serve qualcosa di sicuro e perfomante.

Il linguaggio che verrà utilizzato sarà C# e la programmazione verrà fatta in OGG.


English:

The project consist to make a motorized webcam that it will be managed by gprs module and possibly to implement a motion sensor and temph sensor.

The items chosen there are:
  • Fez Domino
  • DFRobot I / O Expansion
  • DFRobot DHT11 Temperature and Humidity Sensor
  • 2x Servo
  • LinkSprite camera
  • PIR Motion Sensor Detector 
  • SIMCOM SIM300 GPRS+GSM
The gprs module I bought by ebay because I don't need something strong and performance.

The language will be used is c# and I will programmer in OGG.