The Acme Systems shipping office will be closed for holidays from 14 august to 22 august
PLEASE NOTE: This article is obsolete or related to a discontinued product.

PPP over GPRS link

This article explains how to connect the FOX Board to a GPRS network using a FOXGM board and a Telit GM862-QUAD modem

 Note:   This is a discontinued product. Please evaluate to use the TERRA-M board

More info about the FOXGM board are available on:

To do a TCP/IP connection over a GPRS link it's required the pppd daemon installed on you FOX Board. To check that login to the FOX and type:

# ls /usr/sbin/pppd
/usr/sbin/pppd

If you obtain this message:

ls: /usr/sbin/pppd: No such file or directory

You have to install it with the SDK, enable the pppd support in the make menuconfig item:

Application ---> 
  [*] Enable Point to Point Protocol (PPP) support
and reflash the board.

The FOX Board and the FOXGM Board

Be sure to have a SIM card enabled to GPRS traffic in your area and the PIN request disabled.

Create the configuration file and script

Create the directory /etc/ppp:

# cd /etc
# mkdir ppp
# cd ppp

Inside this new directory copy the following files:

Configuration file and script in depth

ppp-start

ppp-start is a command file that launch the daemon program pppd passing as parameter the /etc/ppp/gprs-options that contains the PPP working options. This is its contents:

/usr/sbin/pppd file /etc/ppp/gprs-options
Once copied all the files indicated in the following you can start the PPP with this command:
# . /etc/ppp/ppp-start

It is important to respect the sintax of the separate dot before the command.

gprs-options

In this file it is specified the serial port connected to the modem, the modem port speed and the username to be used during the GPRS connection phase. Moreover the AT commands used for starting and stopping the connection are specified inside this file:

/dev/ttyS2 
9600
defaultroute
user "3347858253"
connect "/usr/sbin/chat -v -f /etc/ppp/gprs-connect"
disconnect "/usr/sbin/chat -v -f /etc/ppp/gprs-disconnect"

gprs-connect and gprs-disconnect

These two files will be used by the chat command in the initial phase of the ppp started and in the final phase of it.

TIMEOUT         60
ABORT           'BUSY'
ABORT           'ERROR'
ABORT           'NO CARRIER'
''              'AT'
OK              AT+CGDCONT=1,"IP","ibox.tim.it","0.0.0.0",0,0
OK              ATD*99***1#
CONNECT         ''
The string ""ibox.tim.it" in this example containts the APN (Access Point Name @wikipedia='Access_Point_Name') address of your GPRS provider (in this case the italian TIM).
Contact your provider to know what is the right address to use or take a look to the Ross Barkman's GPRS Info Page linked below to find it:

ABORT           'BUSY'
ABORT           'ERROR'
ABORT           'NO DIALTONE'
TIMEOUT         30
''              '+++\c'
SAY             " + sending break"
'NO CARRIER'    'ATH'
SAY             "\n + dropping data connection"
OK              'AT+CGATT=0'
SAY             "\n + disconnecting from GPRS"
OK              '\c'
SAY             "\n + disconnected."

pap-secrets

This file contains the username and password to access the GPRS network.

For the italian WIND and VODAFONE network companies these parameters are not requested and you can leave them at the default values. For the italian TIM network operator instead you can fill in the telephone number of the SIM card and the TIM access password for the I-BOX service.

It is important to note that the username indicated in this file has to be the same indicated in the file /etc/ppp/gprs-options.

'3347858253' * '18273645' *

Routing

To enable the GPRS routing for the FOX Board you have to disable the default gateway 192.168.0.1 using the command:
# route del default gw 192.168.0.1 eth0

To store this gateway cancellation even for the following startups you have edit the file /etc/conf.d/net.eth0 and delete the line:

GATEWAY="192.168.0.1"
or change it in a comment:
# GATEWAY="192.168.0.1"

Start the GPRS connection

First of all be sure that the GPRS modem in on. It is possible to turn on the Modem by the hardware making a short-cut between the two contacts on S1 placement for at least 1 second as showed on the figure.

The same effect can be obtained by software sending a 1 second pulse on the PB7 line typing:

# setbits -p b -b 7 -s 1
# setbits -p b -b 7 -s 0

The led L3 will start to blink quite fast to indicate that the modem is turning on and after few seconds more slowly to indicate that it is registered to the GSM network.

To see what happen while the GPRS call goes up activate a second telnet connection with the FOX and type this command:

# tail -f /var/log/messages

Go back to the first telnet session and start the PPP typing:

# . /etc/ppp/ppp-start

Something like this will appear in the second telnet session:

Dec 17 05:17:54 axis pppd[143]: pppd 2.4.2b3 started by root, uid 0
Dec 17 05:17:55 axis chat[145]: timeout set to 60 seconds
Dec 17 05:17:55 axis chat[145]: abort on (BUSY)
Dec 17 05:17:55 axis chat[145]: abort on (ERROR)
Dec 17 05:17:55 axis chat[145]: abort on (NO CARRIER)
Dec 17 05:17:55 axis chat[145]: send (AT^M)
Dec 17 05:17:55 axis chat[145]: expect (OK)
Dec 17 05:17:55 axis chat[145]: AT^M^M
Dec 17 05:17:55 axis chat[145]: OK
Dec 17 05:17:55 axis chat[145]:  -- got it
Dec 17 05:17:55 axis chat[145]: send (AT+CGDCONT=1,"IP","ibox.tim.it","0.0.0.0",0,0^M)
Dec 17 05:17:56 axis chat[145]: expect (OK)
Dec 17 05:17:56 axis chat[145]: ^M
Dec 17 05:17:56 axis chat[145]: AT+CGDCONT=1,"IP","ibox.tim.it","0.0.0.0",0,0^M^M
Dec 17 05:17:56 axis chat[145]: OK
Dec 17 05:17:56 axis chat[145]:  -- got it
Dec 17 05:17:56 axis chat[145]: send (ATD*99***1#^M)
Dec 17 05:17:57 axis chat[145]: expect (CONNECT)
Dec 17 05:17:57 axis chat[145]: ^M
Dec 17 05:17:57 axis chat[145]: ATD*99***1#^M^M
Dec 17 05:17:57 axis chat[145]: CONNECT
Dec 17 05:17:57 axis chat[145]:  -- got it
Dec 17 05:17:57 axis chat[145]: send (^M)
Dec 17 05:17:57 axis pppd[143]: Serial connection established.
Dec 17 05:17:57 axis pppd[143]: Using interface ppp0
Dec 17 05:17:57 axis pppd[143]: Connect: ppp0 <--> /dev/ttyS2
Dec 17 05:17:59 axis pppd[143]: Remote message: Welcome!
Dec 17 05:17:59 axis pppd[143]: PAP authentication succeeded
Dec 17 05:18:00 axis pppd[143]: local  IP address 217.201.67.36
Dec 17 05:18:00 axis pppd[143]: remote IP address 192.168.202.1
Dec 17 05:18:31 axis pppd[143]: Terminating on signal 15.
Dec 17 05:18:31 axis pppd[143]: Connection terminated.
Dec 17 05:18:31 axis pppd[143]: Connect time 0.6 minutes.
Dec 17 05:18:31 axis pppd[143]: Sent 362 bytes, received 288 bytes.
Dec 17 05:19:16 axis pppd[143]: disconnect script failed
Dec 17 05:19:17 axis pppd[143]: Connect time 0.6 minutes.
Dec 17 05:19:17 axis pppd[143]: Sent 362 bytes, received 288 bytes.
Dec 17 05:19:17 axis pppd[143]: Exit.

In the final part of the messages you should see the IP address assigned from the network operator to the FOX board and the corresponding IP address of the remote PPP interface.

We can check the activation of the PPP protocol also with the command:

# ifconfig

It should appear the ppp0 port just activated other than the normally showned eth0 e lo:

eth0      Link encap:Ethernet  HWaddr 00:40:8C:CD:00:00
          inet addr:192.168.0.90  Bcast:192.168.0.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:649 errors:0 dropped:0 overruns:0 frame:0
          TX packets:398 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:40613 (39.6 KiB)  TX bytes:32213 (31.4 KiB)
          Interrupt:17 DMA chan:1

lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

ppp0      Link encap:Point-Point Protocol
          inet addr:217.201.67.36  P-t-P:192.168.202.1  Mask:255.255.255.255
          UP POINTOPOINT RUNNING NOARP MULTICAST  MTU:1500  Metric:1
          RX packets:6 errors:0 dropped:0 overruns:0 frame:0
          TX packets:7 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:3
          RX bytes:288 (288.0 B)  TX bytes:362 (362.0 B)

Trying to connect through the web to the address assigned from the network operator (in this case 217.201.67.36) the FOX web server should answer with its default web page.

Related links