Manually using GSM/zh tw

From Openmoko

(Difference between revisions)
Jump to: navigation, search
(New page: '''When men were real men and typed their own AT commands...''' Thankfully, this may now be partially obsolete. The dialer now works! This is a short guide how to manually get...)
 
m (-Documentation, -Technical)
 
(5 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 
'''When men were real men and typed their own AT commands...'''
 
'''When men were real men and typed their own AT commands...'''
 +
這篇文章簡單的為您介紹了如何使用手動的方式,使用GSM。
  
Thankfully, this may now be partially obsolete.
+
== 需求 ==
The [[Dialer|dialer]] now works!
+
  
This is a short guide how to manually get GSM going.
+
* 安裝最新的u-boot boot-bootloader的GTA01Bv2 或 GTA01Bv3(透過USB)。
 +
* 不要連接任何debug board!
  
== Requirements ==
+
== 實際操作 ==
  
* GTA01Bv2 or GTA01Bv3 with very recent u-boot bootloader, providing usbtty (serial over USB) support)
+
=== 啟動系統 ===
* Do not connect any debug board!
+
  
== Walk-Through ==
+
* 確認你所使用的 rootfs在 /etc/network/interfaces 下包括 'auto usb0'
 
+
* 將主機的usb0介面設定為 192.168.0.200 netmask 255.255.255.0 See [[USB_Networking]]
=== Booting the system ===
+
 
+
* Make sure the rootfs you use has 'auto usb0' in /etc/network/interfaces
+
* Configure the host's usb0 interface to 192.168.0.200 netmask 255.255.255.0 See [[USB_Networking]]
+
 
* ssh to root@192.168.0.201
 
* ssh to root@192.168.0.201
  
=== Disabling the getty ===
+
=== 停用 getty ===
  
Our default images all have a getty running on /dev/ttySAC0, please edit /etc/inittab and disable the getty on that port
+
我們預設的映像檔在/dev/ttySAC0都包含了getty,請編輯/etc/inittab ,並且停用該通訊埠的getty。
  
=== Reducing the loglevel ===
+
=== 消除loglevel ===
  
 
{{note|You don't need this in kernel builds with patchset ≥ 1288}}
 
{{note|You don't need this in kernel builds with patchset ≥ 1288}}
  
To keep the kernel from writing to /dev/ttySAC0, you need to use <code>dmesg -n1</code>.
+
為了避免kernel寫入 /dev/ttySAC0,你必須使用 <code>dmesg -n1</code>.
  
=== Powering up the GSM Modem ===
+
=== 啟動GSM Modem ===
  
* verify there is no getty or any other app running on /dev/ttySAC0  
+
* 檢核 getty 是否存在,或者是其它的程式是否在 /dev/ttySAC0 上執行
 
  root@fic-gta01:~$ lsof | grep ttySAC0
 
  root@fic-gta01:~$ lsof | grep ttySAC0
  
* If gsmd is using the GSM modem, shut it down with
+
* 若gsmd 目前使用 GSM modem,使用下列指令停用它:
  
 
<pre>
 
<pre>
Line 40: Line 36:
 
</pre>
 
</pre>
  
* power-up the GSM Modem
+
* 啟動GSM Modem
 
  root@fic-gta01:~$ echo "1" > /sys/bus/platform/devices/neo1973-pm-gsm.0/power_on
 
  root@fic-gta01:~$ echo "1" > /sys/bus/platform/devices/neo1973-pm-gsm.0/power_on
  
=== Connecting to GSM Modem (using socat) ===
+
=== 連接到GSM Modem (using socat) ===
  
 
* If you have the command socat (built and installed):
 
* If you have the command socat (built and installed):
Line 49: Line 45:
 
  AT-Command Interpreter ready
 
  AT-Command Interpreter ready
  
=== Connecting to GSM Modem (using cu) ===
+
=== 連接到 GSM Modem (使用cu) ===
  
If you don't have socat, you can use cu, although it has problems with file permissions and hardware flow control.
+
若你沒有 socat,你可以使用 cu,雖然它有一些檔案存取及硬體流量控制的問題存在。
  
* change permissions on ttySAC0
+
* 修改ttySAC0的使用權限
 
  root@fic-gta01:~$ chown uucp.uucp /dev/ttySAC0
 
  root@fic-gta01:~$ chown uucp.uucp /dev/ttySAC0
* setup /usr/spool/uucp
+
* 安裝 /usr/spool/uucp
 
  root@fic-gta01:~$ mkdir -p /usr/spool/uucp
 
  root@fic-gta01:~$ mkdir -p /usr/spool/uucp
 
  root@fic-gta01:~$ chown uucp.uucp /usr/spool/uucp
 
  root@fic-gta01:~$ chown uucp.uucp /usr/spool/uucp
* enable CTS/RTS flow control
+
* 啟動 CTS/RTS 流量控制
 
  root@fic-gta01:~$ stty -F /dev/ttySAC0 crtscts
 
  root@fic-gta01:~$ stty -F /dev/ttySAC0 crtscts
* access the GSM Modem UART
+
* 存取 GSM Modem UART
 
  root@fic-gta01:~$ cu -l /dev/ttySAC0
 
  root@fic-gta01:~$ cu -l /dev/ttySAC0
  Connected.
+
  連接
 
  AT-Command Interpreter Ready
 
  AT-Command Interpreter Ready
 
  OK
 
  OK
  
''If it hangs on "Connected" message then probably your device has a non-working GSM modem - check [http://bugzilla.openmoko.org/cgi-bin/bugzilla/show_bug.cgi?id=256 Bug #256], also you may want to try powering off the modem then on again as this worked for me''
+
''若停滯在 "Connected" 訊息,你的GSM modem可能無法運作 - 請查看check [http://bugzilla.openmoko.org/cgi-bin/bugzilla/show_bug.cgi?id=256 Bug #256],或者,你可能想要再次重新啟動''
  
 
'''cu seems to have problems with the hardware flow control. The one way I always managed to get GSM working is to start cu first and then on a different console issue the stty command.'''
 
'''cu seems to have problems with the hardware flow control. The one way I always managed to get GSM working is to start cu first and then on a different console issue the stty command.'''
Line 151: Line 147:
 
See [[Manually using GPRS]]
 
See [[Manually using GPRS]]
  
[[Category:Documentation]]
+
[[Category:Application Developer/zh tw]]
[[Category:Application Developer]]
+
[[Category:GSM/zh tw]]
[[Category:Technical]]
+
[[Category:GSM]]
+

Latest revision as of 22:37, 12 September 2008

When men were real men and typed their own AT commands... 這篇文章簡單的為您介紹了如何使用手動的方式,使用GSM。

Contents

[edit] 需求

  • 安裝最新的u-boot boot-bootloader的GTA01Bv2 或 GTA01Bv3(透過USB)。
  • 不要連接任何debug board!

[edit] 實際操作

[edit] 啟動系統

  • 確認你所使用的 rootfs在 /etc/network/interfaces 下包括 'auto usb0'
  • 將主機的usb0介面設定為 192.168.0.200 netmask 255.255.255.0 See USB_Networking
  • ssh to root@192.168.0.201

[edit] 停用 getty

我們預設的映像檔在/dev/ttySAC0都包含了getty,請編輯/etc/inittab ,並且停用該通訊埠的getty。

[edit] 消除loglevel

NOTE: You don't need this in kernel builds with patchset ≥ 1288


為了避免kernel寫入 /dev/ttySAC0,你必須使用 dmesg -n1.

[edit] 啟動GSM Modem

  • 檢核 getty 是否存在,或者是其它的程式是否在 /dev/ttySAC0 上執行
root@fic-gta01:~$ lsof | grep ttySAC0
  • 若gsmd 目前使用 GSM modem,使用下列指令停用它:
root@fic-gta01:~$ /etc/init.d/gsmd stop 
  • 啟動GSM Modem
root@fic-gta01:~$ echo "1" > /sys/bus/platform/devices/neo1973-pm-gsm.0/power_on

[edit] 連接到GSM Modem (using socat)

  • If you have the command socat (built and installed):
root@fic-gta01:~$ socat - file:/dev/ttySAC0,crtscts,crnl
AT-Command Interpreter ready

[edit] 連接到 GSM Modem (使用cu)

若你沒有 socat,你可以使用 cu,雖然它有一些檔案存取及硬體流量控制的問題存在。

  • 修改ttySAC0的使用權限
root@fic-gta01:~$ chown uucp.uucp /dev/ttySAC0
  • 安裝 /usr/spool/uucp
root@fic-gta01:~$ mkdir -p /usr/spool/uucp
root@fic-gta01:~$ chown uucp.uucp /usr/spool/uucp
  • 啟動 CTS/RTS 流量控制
root@fic-gta01:~$ stty -F /dev/ttySAC0 crtscts
  • 存取 GSM Modem UART
root@fic-gta01:~$ cu -l /dev/ttySAC0
連接
AT-Command Interpreter Ready
OK

若停滯在 "Connected" 訊息,你的GSM modem可能無法運作 - 請查看check Bug #256,或者,你可能想要再次重新啟動

cu seems to have problems with the hardware flow control. The one way I always managed to get GSM working is to start cu first and then on a different console issue the stty command. --DanielWillmann 01:15, 20 March 2007 (CET)

  • close the connection with <Return>~~.<Return>
OK
~[fic-gta01].

Disconnected.
root@fic-gta01:/$

[edit] Using it manually

[edit] Registering with the Network

ATE1
OK
AT+CFUN=1
ERROR
AT+CPIN="...."
OK
AT+COPS
OK

[edit] List available carriers

This can take a few seconds to process but will list the available carriers

AT+COPS=?

[edit] Answering an incoming call

RING
ATA
OK

[edit] Dialling an outgoing call

To actually be able to talk you have to configure your audio accordingly

root@fic-gta01:~$ cd /etc/alsa/
root@fic-gta01:/etc/alsa$ wget http://opensource.wolfsonmicro.com/~gg/neo1973/gsmheadset.working.state
root@fic-gta01:/etc/alsa$ alsactl -f /etc/alsa/gsmheadset.working.state restore

Up the "Amp right" volume to hear the speaker on both ears, then dial (note the ; at the end of the dial string, this signifies a voice call, if you omit the ; it is regarded as a data call).

ATD012340234;   

If you get NO CARRIER, try...

ATD+xxyzzzzzzz

ie, ATD+<country_code><area_code><phone_number>

[edit] Hanging up

ATH
OK

[edit] Using gsmd

You can use the gsmd and libgsmd-tool programs to have a slightly more high-level interface to the GSM Modem. It's still console based, though.

For further instructions, see gsmd

[edit] Using tui

Tui (available from sourceforge) is able to do all this. It is still text-based, but input-rxvt can take data from touchscreen, so you can actually do the calls using your finger. It also plays wav file on incoming call, so it is theoretically usable. It even does caller id.

[edit] Manually using GPRS

See Manually using GPRS

Personal tools

When men were real men and typed their own AT commands...

Thankfully, this may now be partially obsolete. The dialer now works!

This is a short guide how to manually get GSM going.

Requirements

  • GTA01Bv2 or GTA01Bv3 with very recent u-boot bootloader, providing usbtty (serial over USB) support)
  • Do not connect any debug board!

Walk-Through

Booting the system

  • Make sure the rootfs you use has 'auto usb0' in /etc/network/interfaces
  • Configure the host's usb0 interface to 192.168.0.200 netmask 255.255.255.0 See USB_Networking
  • ssh to root@192.168.0.201

Disabling the getty

Our default images all have a getty running on /dev/ttySAC0, please edit /etc/inittab and disable the getty on that port

Reducing the loglevel

NOTE: You don't need this in kernel builds with patchset ≥ 1288


To keep the kernel from writing to /dev/ttySAC0, you need to use dmesg -n1.

Powering up the GSM Modem

  • verify there is no getty or any other app running on /dev/ttySAC0
root@fic-gta01:~$ lsof | grep ttySAC0
  • If gsmd is using the GSM modem, shut it down with
root@fic-gta01:~$ /etc/init.d/gsmd stop 
  • power-up the GSM Modem
root@fic-gta01:~$ echo "1" > /sys/bus/platform/devices/neo1973-pm-gsm.0/power_on

Connecting to GSM Modem (using socat)

  • If you have the command socat (built and installed):
root@fic-gta01:~$ socat - file:/dev/ttySAC0,crtscts,crnl
AT-Command Interpreter ready

Connecting to GSM Modem (using cu)

If you don't have socat, you can use cu, although it has problems with file permissions and hardware flow control.

  • change permissions on ttySAC0
root@fic-gta01:~$ chown uucp.uucp /dev/ttySAC0
  • setup /usr/spool/uucp
root@fic-gta01:~$ mkdir -p /usr/spool/uucp
root@fic-gta01:~$ chown uucp.uucp /usr/spool/uucp
  • enable CTS/RTS flow control
root@fic-gta01:~$ stty -F /dev/ttySAC0 crtscts
  • access the GSM Modem UART
root@fic-gta01:~$ cu -l /dev/ttySAC0
Connected.
AT-Command Interpreter Ready
OK

If it hangs on "Connected" message then probably your device has a non-working GSM modem - check Bug #256, also you may want to try powering off the modem then on again as this worked for me

cu seems to have problems with the hardware flow control. The one way I always managed to get GSM working is to start cu first and then on a different console issue the stty command. --DanielWillmann 01:15, 20 March 2007 (CET)

  • close the connection with <Return>~~.<Return>
OK
~[fic-gta01].

Disconnected.
root@fic-gta01:/$

Using it manually

Registering with the Network

ATE1
OK
AT+CFUN=1
ERROR
AT+CPIN="...."
OK
AT+COPS
OK

List available carriers

This can take a few seconds to process but will list the available carriers

AT+COPS=?

Answering an incoming call

RING
ATA
OK

Dialling an outgoing call

To actually be able to talk you have to configure your audio accordingly

root@fic-gta01:~$ cd /etc/alsa/
root@fic-gta01:/etc/alsa$ wget http://opensource.wolfsonmicro.com/~gg/neo1973/gsmheadset.working.state
root@fic-gta01:/etc/alsa$ alsactl -f /etc/alsa/gsmheadset.working.state restore

Up the "Amp right" volume to hear the speaker on both ears, then dial (note the ; at the end of the dial string, this signifies a voice call, if you omit the ; it is regarded as a data call).

ATD012340234;   

If you get NO CARRIER, try...

ATD+xxyzzzzzzz

ie, ATD+<country_code><area_code><phone_number>

Hanging up

ATH
OK

Using gsmd

You can use the gsmd and libgsmd-tool programs to have a slightly more high-level interface to the GSM Modem. It's still console based, though.

For further instructions, see gsmd

Using tui

Tui (available from sourceforge) is able to do all this. It is still text-based, but input-rxvt can take data from touchscreen, so you can actually do the calls using your finger. It also plays wav file on incoming call, so it is theoretically usable. It even does caller id.

Manually using GPRS

See Manually using GPRS