[Gta04-owner] 3g internet access scripts
Dr. H. Nikolaus Schaller
hns at goldelico.com
Fri Jul 20 08:28:44 CEST 2012
Am 20.07.2012 um 03:19 schrieb Kevin Hremeviuc:
> Hi all,
>
> Thanks to Neil Brown for telling me to use /dev/ttyHS_Control, which works a treat (I was working from an old email posted to this list which said to use /dev/ttyHS3).
>
> Please find attached 2 scripts - one for starting internet access and the other for stopping it. They need an additional hack for reseting the nameserver when using usb0 which I'll leave up to individuals to sort out (backup /etc/resolv.conf and then restore or hardcode the nameserver ip address into the script and blitz /etc/resolv.conf). The scripts are rough and ready as at some stage I am sure there will be a better solution.
>
> You will need to install ser2net and expect:
>
> apt-get install ser2net
> apt-get install expect
>
> You will then need to modify the ser2net config file at /etc/ser2net.conf as follows (keep banner, comment default serial port configs and add /dev/ttyHS_Control) and then restart it (/etc/init.d/ser2net stop|start):
>
> BANNER:banner:\r\nser2net port \p device \d [\s] (Debian GNU/Linux)\r\n\r\n
>
> #2000:telnet:600:/dev/ttyS0:9600 8DATABITS NONE 1STOPBIT banner
> #2001:telnet:600:/dev/ttyS1:9600 8DATABITS NONE 1STOPBIT banner
> #3000:telnet:600:/dev/ttyS0:19200 8DATABITS NONE 1STOPBIT banner
> #3001:telnet:600:/dev/ttyS1:19200 8DATABITS NONE 1STOPBIT banner
> 127.0.0.1,3002:telnet:600:/dev/ttyHS_Control:115200 8DATABITS NONE 1STOPBIT -RTSCTS -HANGUP_WHEN_DONE -XONXOFF banner
>
> Hope this is of some help to someone,
There is a small tool "femtocom" which might be easier to use for doing experiments than ser2net:
http://git.goldelico.com/?p=gta04-rootfs.git;a=blob;f=debian/config/root/femtocom.c;h=7f15df363f384786fad084c1217d05d00a6746e3;hb=HEAD
It is neither perfect not widely available (someone should make a Debian package...).
You can just us it like
( echo "command"; echo "command" ) | femtocom /dev/ttyHS_Control | while read RESPONSE; do ....; done
like here:
http://git.goldelico.com/?p=gta04-rootfs.git;a=blob;f=debian/config/root/wwan;h=8213a01dacde0fc9e7b46318486876a78d4a40df;hb=HEAD
But a Qt application is obviously much better, especially for handling timeouts and errors.
Nikolaus
More information about the Gta04-owner
mailing list