tech-sjh

2010年2月10日 星期三

ckermit to access serial port (gsm/gprs modem) in (embedded) linux


sudo apt-get install ckermit
cat ~/.kermrc



set modem type none ; There is no modem
set line /dev/ttyS0 ; Specify device name
set carrier-watch off ; If DTR CD are not cross‐connected
set speed 115200 ; Or other desired speed
set flow rts/cts ; If RTS and CTS are cross‐connected

; the following equivalent to kermit -8
set terminal bytesize 8
set command bytesize 8
set parity none ; (or "mark" or "space", if necessary)

set stop-bits 1 ; (rarely necessary)
set flow xon/xoff ; If you can't use RTS/CTS
connect ; Enter Connect (terminal) state


如果是要存取 gsm/gprs modem 的話,也可以試


set modem type user ; User defined
set modem name my-gsm ; gsm/gprs modem with AT commands
set modem capabilities at
set modem carrier-watch off
set modem kermit-spoof off
set modem flow-control none
set input echo on

set line /dev/ttyS0 ; Specify device name
set carrier-watch off ; If DTR CD are not cross connected
set speed 115200 ; Or other desired speed

; the following equivalent to kermit -8
set terminal bytesize 8
set command bytesize 8
set parity none ; (or "mark" or "space", if necessary)
set stop-bits 1 ; (rarely necessary)
set flow none
set local-echo on

; output AT\13 ; modem expect carriage return (13 in decimal or 0xD in hex)
lineout AT ; lineout would add carriage return for you
connect ; Enter Connect (terminal) state, you should see AT response OK


最後 sudo kermit 就可以 access

另外在 windows 上也可以用 putty 連線到 serial port, 選
serial 設定 baud rate 就可以 connect, 比一些 dummy
terminal 好用一點, 至少有 copy/paste 可以用 :P

要 cross compile ckermit 時,需要先 build host 版本的 wuart,
把 wuart 保留一份 host build 的版本,在 cross compile target 中 failed 時
手動換回 host 版本 wuart,再繼續 build 出 wermit, 要自己 rename 為
kermit :P

沒有留言:

張貼留言

版權宣告、免責聲明


創用 CC 授權條款
本著作係採用創用 CC 姓名標示-非商業性-相同方式分享 4.0 國際 授權條款授權.
免責聲明: 本文所載資料僅供參考,並不構成投資建議,
讀者閱讀或使用該資料所導致結果需要自擔風險與責任,
作者概不承擔閱讀人行為之任何風險與責任。
除非有特別宣稱,作者言論並不代表所屬任何團體、公司、或其他人意見。