User:Miki/hosted gsmd

From Openmoko

< User:Miki(Difference between revisions)
Jump to: navigation, search
(First notes (still not completely succesful))
 
m (small tweaks)
Line 1: Line 1:
 
 
These notes shows how to run gsmd on your workstation, while actually interacting with the modem in the Neo1973.
 
These notes shows how to run gsmd on your workstation, while actually interacting with the modem in the Neo1973.
  
 
== Attach the modem ==
 
== Attach the modem ==
 
Start your post svn r2885 [[uboot]] phone into the uboot menu.
 
Start your post svn r2885 [[uboot]] phone into the uboot menu.
Use a serial terminal emulation program (here picocom) to acess the uboot serial command line
+
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):
 
<pre>picocom /dev/ttyACM0</pre>
 
<pre>picocom /dev/ttyACM0</pre>
  
Power on gsm modem and attach modem to serial line.
+
Power on gsm modem and attach modem to serial line:
 
<pre>
 
<pre>
 
GTA01Bv4 # neo1973 gsm on
 
GTA01Bv4 # neo1973 gsm on
Line 16: Line 15:
 
</pre>
 
</pre>
  
Now quit the terminal emulation program, without resetting the serial line! (in picocom C-a,C-q).
+
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.
<pre>
+
Thanks for using picocom
+
</pre>
+
  
 
Now you have a shiny gsm modem connected to a tty of you machine, use at to your wish.
 
Now you have a shiny gsm modem connected to a tty of you machine, use at to your wish.
Line 25: Line 21:
 
== Build gsmd ==
 
== Build gsmd ==
 
<pre>
 
<pre>
svn co https://svn.openmoko.org/trunk/src/target/gsm/ moko_gsmd
+
svn co https://svn.openmoko.org/trunk/src/target/gsm/ moko_gsmd
 +
cd moko_gsmd
 
./autogen.sh
 
./autogen.sh
 
make
 
make
Line 53: Line 50:
 
<pre>
 
<pre>
 
util/libgsmd-tool -m shell
 
util/libgsmd-tool -m shell
 +
</pre>
 +
 +
===Debug it===
 +
<pre>
 +
$ 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)
 
</pre>
 
</pre>

Revision as of 21:11, 17 October 2007

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

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

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'

Run it

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

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

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

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

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

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'

Run it

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

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

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)