User:Miki/hosted gsmd

From Openmoko

Jump to: navigation, search

These notes shows how to run gsmd on your workstation, while actually interacting with the modem in the Neo1973.

Currently there is some problems doing this, probably caused by the u-boot passthrough, but Thomas Wood has another user-space approach.

Contents

Attach the modem

Start your post svn r2885 uboot phone into the uboot menu. Use a serial terminal emulation program (here picocom) to access the uboot serial command line (I'm assuming the phone is the only ACM device):

picocom /dev/ttyACM0

Power on gsm modem and attach modem to serial line:

GTA01Bv4 # neo1973 gsm on
GTA01Bv4 # terminal serial
switching s3ser0 from console into GSM mode
Entering terminal mode for port serial
Use '~.' to leave the terminal and get back to u-boot

Now quit the terminal emulation program, without resetting the serial line! In picocom use C-a,C-q. With cu ~. will also work, as it only quits cu, it isn't sent to uboot.

Now you have a shiny gsm modem connected to a tty of you machine, use at to your wish.

Build gsmd

sudo apt-get install build-essential subversion automake1.9 libtool libglib2.0-dev
sudo apt-get install libgtk2.0-dev libwnck-dev libwnck-common libgconf2-dev libglib2.0-dev libgnome2-dev libgnome-desktop-2 libgnome-desktop-dev libdbus-glib-1-dev gnome-common libxcomposite-dev libxdamage-dev
NOTE: not all these packages are needed. If one can cleanup this list, he is welcome.
svn co https://svn.openmoko.org/trunk/src/target/gsm/ moko_gsmd
cd moko_gsmd
./autogen.sh
make

Setup .so path

su -c 'ln -s ~/moko_gsmd/src/gsmd/.libs/ /usr/local/lib/gsmd'

Note: if still not working, put the full path to  .libs dir in LD_LIBRARY_PATH like this:

export LD_LIBRARY_PATH=`echo ~/moko_gsmd/src/gsmd/.libs/`:${LD_LIBRARY_PATH}

Run it

cd src
gsmd/gsmd -p /dev/ttyACM0 -v ti -m generic

OR

export PATH=${PATH}:`echo ~/moko_gsmd/src/gsmd/`
gsmd -p /dev/ttyACM0 -v ti -m generic

At the moment I have some troubles getting past modem initialization:

Wed Oct 17 11:21:06 2007 <1> vendor.c:59:gsmd_vendor_plugin_find() selecting vendor plugin "TI Calypso"
Wed Oct 17 11:21:06 2007 <1> atcmd.c:545:atcmd_submit() submitting command `ATZ'
Wed Oct 17 11:21:06 2007 <1> atcmd.c:210:ml_parse() buf=`ATZ'(3)
Wed Oct 17 11:21:06 2007 <1> atcmd.c:229:ml_parse() ignoring echo
Wed Oct 17 11:21:06 2007 <1> atcmd.c:210:ml_parse() buf=`ATZ'(3)
Wed Oct 17 11:21:06 2007 <1> atcmd.c:229:ml_parse() ignoring echo

You can invoke libgsm-tool as usual in another shell

util/libgsmd-tool -m shell

Debug it

$ gdb gsmd/gsmd 
GNU gdb 6.6-debian
Copyright (C) 2006 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "i486-linux-gnu"...
Using host libthread_db library "/lib/tls/i686/cmov/libthread_db.so.1".
(gdb) b gsmd_initsettings 
Breakpoint 1 at 0x804a8f7: file gsmd.c, line 239.
(gdb) run -p /dev/ttyACM0 -v ti -m generic
Starting program: /home/miki/moko_gsmd/src/gsmd/gsmd -p /dev/ttyACM0 -v ti -m generic
gsmd - (C) 2006-2007 by OpenMoko, Inc. and contributors
This program is FREE SOFTWARE under the terms of GNU GPL

Wed Oct 17 21:56:37 2007 <1> machine.c:72:gsmd_machine_plugin_load() loading machine plugin "generic"
Wed Oct 17 21:56:37 2007 <1> vendor.c:75:gsmd_vendor_plugin_load() loading vendor plugin "ti"
Wed Oct 17 21:56:37 2007 <1> machine.c:56:gsmd_machine_plugin_find() selecting machine plugin "generic"
Wed Oct 17 21:56:38 2007 <1> atcmd.c:561:atcmd_drain() c_iflag = 0x00000000, c_oflag = 0x00000000, c_cflag = 0x00001cb2, c_lflag = 0x00000a30
Wed Oct 17 21:56:38 2007 <1> vendor.c:59:gsmd_vendor_plugin_find() selecting vendor plugin "TI Calypso"

Breakpoint 1, gsmd_initsettings (gsmd=0x8056480) at gsmd.c:239
239     {
(gdb) 
Personal tools