May 26, 2008

Maxis GPRS Connection

I'm putting this here just for my reference. Feel free to ask me on the comment section if you don't understand what I'm talking about... Please note that I'm using TS-7260 SBC from embedded arm which I've installed ts-7000 linux (debian-arm based) on SD card.

I'm using this to have wireless connection fron my Rain Gauge device to the internet. To make internet connection via Maxis GPRS on a Linux computer with ppp dial up connection, we just need some files which is:

  1. /etc/ppp/peers/maxisGPRS
  2. /etc/ppp/pap-secrets
  3. /etc/ppp/chat/maxisGPRS
  4. /etc/ppp/chat/gprs-disconnect

and make sure the ppp and chat package is installed on that box.

To install ppp on debian, you can use
$ apt-get install ppp

Here is the contents of /etc/ppp/peers/maxisGPRS
connect "/usr/sbin/chat -v -f /etc/ppp/chat/maxisGPRS"
disconnect "/usr/sbin/chat -V -s -S -f /etc/ppp/chat/gprs-disconnect"
user maxis
lcp-echo-interval 0
maxfail 0

here is the contents of /etc/ppp/pap-secrets
maxis   *       wap     *

here is the contents of /etc/ppp/chat/maxisGPRS
'' ATZ
OK AT+CGDCONT=1,"IP","net"
OK ATDT*99***1#
'' \d\c

here is the contents of /etc/ppp/chat/gprs-disconnect
# This is called at , (termination of pppd)
SAY "Sending break to the modem\n"
"" "\K"
"" "\K"
"" "\K"
"" "+++ATH"
"" "+++ATH"
"" "+++ATH"
SAY "PDP context detached\n"

I've tested this and verified that it works on ubuntu Gutsy too... just plug in the Wavecom modem and change the /etc/ppp/peers/maxisGPRS file to use /dev/ttyS0 or any serial port where you plug in the GPRS modem.

to dial the gprs connection, use this command:
$ pppd call maxisGPRS debug nodetach

(I'm using debug nodetach to see the output, you can strip out that two option if you wanna call this from cron or your script)

OK, that's all... Enjoy!!!

Share This Article:

Bookmark This Article:
Feed Me Digg Technorati Best to Stumbleupon Reddit Blinklist Furl Spurl Yahoo Simpy


Sean said...

Interesting - thought I'd nearly found my answer! Been trying to find out if I can use dynamic DNS over GPRS in Malaysia, when I started reading your article, I thought you were going to say you had a webserver on your SBC. Do you?
Are you periodically uploading your rain gauge data via GPRS? Can you start a remote console session on your SBC over GPRS? ... so many questions!

ApOgEE said...

hi sean, no I don't have webserver on my SBC. yes, I periodically uploading rain gauge data via GPRS. currently i can start remote console session on my SBC over GPRS just when those SBCs successfully connected to my pptp server and I'll have em as my VPN clients.

Daniel said...


Thanks for this article. I am also using a TS7260 card and I would like to use PPP with a wavecom modem but It still doesn't work even with your scripts. Could you please tell me how your tty is configured in /etc/inittab ?



ApOgEE said...

Hi Daniel,

I connect my wavecom modem to /dev/ttyTS0. I didn't set anything to the /etc/inittab

However, check this out if you wanna see my /etc/inittab contents: /etc/inittab

Daniel said...

Thanks for the answer. In fact, I use ttyAM0 because I have no device called /dev/ttyTS0. That's strange if we use the same board... Is it a link to another device ??

ApOgEE said...


there are three serial ports on the board. One with the male DB9 connector and the other two is labelled as COM2 and COM3 on the board.

the ttyAM0 is the one with DB9 connector. ttyAM1 is COM2 and ttyTS0 is COM3.

if you plug your wavecom modem on ttyAM0, you do have to disable the serial console output on /etc/inittab. I still need the serial console, that's why I use COM3 for the modem.

ApOgEE said...

in order to disable the serial console on ttyAM0, you can either swap the serial console to ttyAM1 by placing a jumper on JP4. Or you may simply disable the serial console by removing the jumper on JP2.

then comment this line on /etc/inittab :

T0:23:respawn:/sbin/getty -L ttyAM0 115200 vt100

Daniel said...

Thanks for your help, I will try that ASAP.

Daniel said...

I have tried using ttyAM0 and it seems to be better. But I still get an error message : "Couldn't set tty to PPP discipline: Invalid argument". I have made some search and it seems that this error comes from some kernel modules missing. Did you had to recompile the kernel to make PPP work ?

I use the debian that comes on the sd card from TS.

Moreover, do you know some hhtp/ftp sites that works for ARM to add in /etc/apt/sources.list ?

Thanks again for your help.


ApOgEE said...

Hi Daniel, I didn't recompile the kernel.

Make sure you have ppp_async on your /etc/modules

I'm using the same sd card image from TS. I just do some update and upgrade by apt-get update and apt-get upgrade.

Currently, my SD card image is debian Etch not Sarge. And install again the etch version of ppp and chat.

Daniel said...

You were rigth, I was missing ppp_async in /etc/modules.

Thanks very much for your help, it seems to be working now.


Daniel said...

Hi ApOgEE,

I am currently trying to use /dev/ttyTS0 for ppp connexion. I installed tsuart0 and tsuart7260 so that I can use /dev/ttyTS0.
When I try to output some caracters through COM3, it works on my hyperterminal. But when I try the ppp connexion (having modified /etc/ppp/peers/wavecomGPRS to use ttyTS0), it doesn't work. When I try ttyAM0, it works. Do you know if there is a difference that can explain this ??

Thanks for your help,


ApOgEE said...

Hi daniel,

yes, there is differences between ttyAM0 and ttyTS0. check your cable pinout. you can't simply wire the RX, TX and GND to the port because the wavecom modem also check for RTS,CTS and other signals. you have to also loopback the RTS and CTS pin on the wavecom 15 pin connector and also loop the DCD, DTR and DSR pins together.

Daniel said...

Yes, you are rigth, I missed that. Then I guess I will continue to use COM1...

Thanks for all,