#Use pyGSM to manage SMS

pyGSM is a Python module which uses pySerial to provide a nifty interface 
to send and receive SMS via a GSM Modem. 

* [Visit the pyGSM project on GitHub](https://github.com/adammck/pygsm)

#Install pyGSM on FOX Board G20

Download the pyGSM project from GitHub repository by typing:

<pre class="minicom">
debarm:~# git clone http://github.com/adammck/pygsm.git
Cloning into pygsm...
...
</pre>

Install the package <b>python-setuptools</b> required by the pygsm 
setup program.

<pre class="minicom">
debarm:~# apt-get update
...
debarm:~# apt-get install python-setuptools
...
</pre>

The install the pyGSM library by typing:

<pre class="minicom">
debarm:~# cd pygsm
debarm:~# python setup.py install
...
</pre>

Then try this example:

@pg='python/sms/lettercounter.py'

Change the serial port to use the right serial port where is wired your GSM modem:

* <b>/dev/ttyS1</b> if your are using a FOXGM or FOXGM2 board with the Telit GM862-QUAD
* <b>/dev/ttyS2</b> if you are a DAISY-13 data module plugged on D1
* <b>/dev/ttyS4</b> if you are a DAISY-13 data module plugged on D6
* <b>/dev/ttyUSB0</b> if you are using a Digicom USB Wave GPRS modem on a USB port

Run the lettercounter.py example by typing:

<pre class="minicom">
debarm:~# cd playground/python/sms#
debarm:~/playground/python/sms# python lettercounter.py
   debug Booting
   debug Connecting
   write 'ATE0\r'
    read '\r\n'
    read 'OK\r\n'
   write 'AT+CMEE=1\r'
    read '\r\n'
    read 'OK\r\n'
... 
</pre>

The demo will loop forever. Try to send a SMS from your mobile phone
to the SIM number mounted on the FOX Board G20 and see what happen.

Read the Author README to understand how to use the pyGSM API and the licence terms:

* [pyGSM README/doc](https://github.com/adammck/pygsm/blob/master/README)
* [pyGSM licence](https://github.com/adammck/pygsm/blob/master/LICENSE)

#Buy

* [Evaluation kit](/catalog_kit)
* [Single parts](/catalog_terra)

@shop='COMBO-M1'
@shop='COMBO-M2'


