RS232Cでリモート

Last-modified: 2013-08-31 (土) 07:41:27
 

LinuxサーバへRS232Cポートを利用して接続する方法です。

  • 環境
    DebianWheezy
    GRUB
     

Linux側の設定

GRUBの設定を編集

# nano /etc/default/grub
 

青字が修正箇所になります。
これによりディスプレイとCOMポート両方に出力されるようになるらしい。

# If you change this file, run ‘update-grub’ afterwards to update
# /boot/grub/grub.cfg.
# For full documentation of the options in this file, see:
#   info -f grub -n ‘Simple configuration’
GRUB_DEFAULT=0
GRUB_HIDDEN_TIMEOUT=0
GRUB_HIDDEN_TIMEOUT_QUIET=true
GRUB_TIMEOUT=10
GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian`
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash console=tty0 console=ttyS0,115200"
GRUB_CMDLINE_LINUX=""
# Uncomment to enable BadRAM filtering, modify to suit your needs
# This works with Linux (no patch required) and with any kernel that obtains
# the memory map information from GRUB (GNU Mach, kernel of FreeBSD …)
#GRUB_BADRAM="0×01234567,0xfefefefe,0x89abcdef,0xefefefef"
# Uncomment to disable graphical terminal (grub-pc only)
GRUB_TERMINAL=console
GRUB_TERMINAL=serial 
GRUB_SERIAL_COMMAND="serial –speed=115200 –unit=0 –word=8 –parity=no # –stop=1"
# The resolution used on graphical terminal
# note that you can use only modes which your graphic card supports via VBE
# you can see them in real GRUB with the command `vbeinfo’
#GRUB_GFXMODE=640×480
# Uncomment if you don’t want GRUB to pass "root=UUID=xxx" parameter to Linux
#GRUB_DISABLE_LINUX_UUID=true
# Uncomment to disable generation of recovery mode menu entries
#GRUB_DISABLE_RECOVERY="true"
# Uncomment to get a beep at grub start
#GRUB_INIT_TUNE="480 440 1"
 

設定反映

# update-grub
 

デーモン小暮閣下うんちゃら
新規で作成します。

# nano /etc/init/ttyS0.conf

以下内容

#
# ttyS0 – getty
#
# This service maintains a getty on ttyS0 from the point the system is
# started until it is shut down again.
start on stopped rc or RUNLEVEL=[2345]
stop on runlevel [!2345]
respawn
exec /sbin/getty -L 115200 ttyS0 vt102

クライアント設定

書くの面倒だから設定に必要そうな内容だけ
(Teratermの場合)

  • Port
    クライアント側のポート
    例:COM1
  • Baudrate
    帯域的な?
    一応今回は115200を選択
  • Data
    よくわかんない
    一応8bitでよさげ
  • Parity
    よくわかんない
    noneでよさげ
  • Stop
    よくわかんない
    1bitでよさげ
  • Flowcontorol
    よくわかんない
    noneでよさげ

  • 0でよさげ

linuxの場合?
http://d.hatena.ne.jp/k-side/20130304/1362368976

いんすこ

$sudo apt-get install ckermit

設定

$ touch ./.kermrc
$ nano -w ./.kermrc
set line /dev/ttyS0
set speed 115200
set stop-bits 1
set flow-control none
set parity none
set carrier-watch off

接続

$ screen -AmdS kmt sudo kermit
$ screen -r kmt
$ C-Kermit>connect

※screenだけでできた

#screen /dev/ttyS0 115200

http://d.hatena.ne.jp/junjun777/20080503/1209774326
http://80286.blog62.fc2.com/blog-entry-37.html