
USING THE GSM
- Ion Technical Information Manual
44
Setting up the GSM module
The Ion R4301P reader has an (optional) internal GSM/GPRS module that can be used to send/receive SMS or as
Internet gateway. Here some basic instructions about how to send SMS and how to connect to the Internet using the
GSM/GPRS module.
The GSM/GPRS module is connected to the system through the second serial port (the first is used for the console)
mapped to the pseudo-file /dev/ttyS1.
We suggest to create a symbolic link for the pseudo-file /dev/ttyS1 in order to have a mnemonic shortcut for the future
use of the module:
root@ion:~# ln -s /dev/ttyS2 /dev/mobilephone
Then you need to switch on the GSM/GPRS module that is switched off by default; this can be obtained invoking the
ion-manager
script in the following way:
root@ion:~# ion-manager gsm switch
ion-manager; switching the GSM on/off... ok
You can verify if the GSM/GPRS module is correctly activated by issuing the
gsmctl
command:
root@ion:~# gsmctl all
gsmctl[ERROR]: ME/TA error 'SIM PIN required' (code 311)
The message above is what you should obtain and indicate that the module is active and working, it is just waiting for
the PIN of the SIM card.
In the following snippet you can see how to provide the PIN of the SIM card to the module and the reply to the
gsmctl
call when the module is ready to be used:
root@ion:~# gsmctl -I "+cpin=NNNN"
root@ion:~# gsmctl all
<ME0> Manufacturer: Telit
<ME1> Model: GC864-QUAD
<ME2> Revision: 10.00.063
<ME3> Serial Number: 359294031006030
<FUN> Functionality Level: 1
...
Sending a SMS message
Once the GSM/GPRS module is correctly configured, you can send SMS messages in a very simple way form the
command shell, for example the following command line will send a SMS message with the body “Hello world!” to the
specified number:
root@ion:~# gsmsendsms <phone_number> 'Hello world!'
Obviously you can create shell scripts that include the gsmsendsms calls in order to automate SMS message delivering.
C language
If you need sending a SMS from a C program the easiest way is by using the
system(3)
function with the command
above. Please refer to system Linux man pages for further info.