- asking the PIN code multiple times [2]
- network registration rarely effective
- SIM contacts and messages not always fetched [3]
- sending messages not always working
- no GPRS support at all (from a GUI like [4])
Therefore, I've been using libgsmd-tool extensively for a while. First, I realized that the code for its "shell" mode (-m shell) is somewhat fragile. Unfortunately, the design of this part doesn't make it trivial to fix.
Anyway, then, I've been using the "atcmd" mode as well (-m atcmd), while working on the GPRS interaction in particular. Here comes the funny part: since this command then basically works like a serial console, why not tell pppd to use it instead of the actual serial device?
gsm-tool - (C) 2006-2007 by Harald Welte and OpenMoko, Inc. This program is Free Software and has ABSOLUTELY NO WARRANTY ATZ STR=`ATZ' RSTR=`OK'It makes even more sense in this context, since the phone stack no longer runs as root, and therefore shouldn't be allowed to tinker with the gsmd daemon at all anymore (eg "/etc/init.d/gsmd start/stop").
The first part was easy; patching libgsmd-tool to:
- output errors to stderr,
- remove the local echo (eg "STR=...")
- write the response without escaping (eg "RSTR=...")
## ## pppd options ## #/dev/ttySAC0 pty "/usr/bin/libgsmd-tool -m atcmd"It actually works up to a certain point:
- I doubt that connectivity reports still work while the connection is up (eg signal quality, etc)
- gsmd probably currently doesn't expect this to happen,
- there should be some kind of pass-through mode, where libgsmd-tool would pipe the data in and out of stdin to and from the gsm daemon.
For the record:
Sep 16 15:47:34 syn pppd[321]: pppd 2.4.4 started by khorben, uid 1000 Sep 16 15:47:34 syn chat[518]: send (ATZ^M) Sep 16 15:47:34 syn chat[518]: expect (OK) Sep 16 15:47:34 syn chat[518]: OK Sep 16 15:47:34 syn chat[518]: -- got it Sep 16 15:47:34 syn chat[518]: send (AT+CGDCONT=1,"IP","internet.eplus.de"^M) Sep 16 15:47:35 syn chat[518]: expect (OK) Sep 16 15:47:35 syn chat[518]: Sep 16 15:47:35 syn chat[518]: OK Sep 16 15:47:35 syn chat[518]: -- got it Sep 16 15:47:35 syn chat[518]: send (ATD*99***1#^M) Sep 16 15:47:35 syn chat[518]: expect (CONNECT)[1] http://www.hackable1.org/
[2] http://trac.hackable1.org/trac/ticket/254
[3] http://trac.hackable1.org/trac/ticket/264
[4] http://people.defora.org/~khorben/place/blog/60/New-project--gprs-for-hackable-1-on-the-Openmoko-Freerunner



