1

SMS ゲートウェイとして使用できるように、Linux マシン (Vmware で OpenSuse 12.1 64 ビット) 用の GSM モデムを起動することにしました。私は USB インターフェイスを提供する Wavecom M1306B GSM モデムを持っており、明らかに USB ケーブル (エンド ツー エンド、GSM モデムからデスクトップへ) が付属しています。

Windows 7 64 ビット PC でいくつかの基本的なコマンドを実行して、このモデムを正常にテストしました。(例: AT 、ATZ、..)

ここに私のログのいくつかがあります:

machine2:~ # lsusb
Bus 001 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 001 Device 002: ID 0e0f:0003 VMware, Inc. Virtual Mouse
Bus 001 Device 003: ID 0e0f:0002 VMware, Inc. Virtual USB Hub
Bus 001 Device 006: ID 067b:2303 Prolific Technology, Inc. PL2303 Serial Port

そのインターフェースの lsusb -v 出力:

Bus 001 Device 006: ID 067b:2303 Prolific Technology, Inc. PL2303 Serial Port
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               1.10
  bDeviceClass            0 (Defined at Interface level)
  bDeviceSubClass         0 
  bDeviceProtocol         0 
  bMaxPacketSize0        64
  idVendor           0x067b Prolific Technology, Inc.
  idProduct          0x2303 PL2303 Serial Port
  bcdDevice            3.00
  iManufacturer           1 Prolific Technology Inc.
  iProduct                2 USB-Serial Controller
  iSerial                 0 
  bNumConfigurations      1
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength           39
    bNumInterfaces          1
    bConfigurationValue     1
    iConfiguration          0 
    bmAttributes         0xa0
      (Bus Powered)
      Remote Wakeup
    MaxPower              100mA
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       0
      bNumEndpoints           3
      bInterfaceClass       255 Vendor Specific Class
      bInterfaceSubClass      0 
      bInterfaceProtocol      0 
      iInterface              0 
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x81  EP 1 IN
        bmAttributes            3
          Transfer Type            Interrupt
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x000a  1x 10 bytes
        bInterval               1
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x02  EP 2 OUT
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0040  1x 64 bytes
        bInterval               0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x83  EP 3 IN
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0040  1x 64 bytes
        bInterval               0
Device Status:     0x0000
  (Bus Powered)



machine2:/proc # setserial -a /dev/ttyUSB0
/dev/ttyUSB0, Line 0, UART: 16654, Port: 0x0000, IRQ: 0
        Baud_base: 460800, close_delay: 0, divisor: 0
        closing_wait: infinte
        Flags: spd_normal

machine2:/home/smsto/bin # setserial -a /dev/ttyS0
/dev/ttyS0, Line 0, UART: 16550A, Port: 0x03f8, IRQ: 4
        Baud_base: 115200, close_delay: 50, divisor: 0
        closing_wait: 3000
        Flags: spd_normal skip_test

machine2:/home/smsto/bin # setserial -a /dev/ttyS1
/dev/ttyS1, Line 1, UART: 16550A, Port: 0x02f8, IRQ: 3
        Baud_base: 115200, close_delay: 50, divisor: 0
        closing_wait: 3000
        Flags: spd_normal skip_test

machine2:/proc # setserial -G /dev/ttyUSB0
/dev/ttyUSB0 uart 16654 port 0x0000 irq 0 baud_base 460800 spd_normal

machine2:/proc # setserial /dev/ttyUSB0
/dev/ttyUSB0, UART: 16654, Port: 0x0000, IRQ: 0


machine2:/proc/tty/driver # ls -ltr
total 0
-r--r--r-- 1 root root 0 Jan 10 14:03 usbserial
-r--r--r-- 1 root root 0 Jan 10 14:03 serial

machine2:/proc/tty/driver # cat serial 
serinfo:1.0 driver revision:
0: uart:16550A port:000003F8 irq:4 tx:0 rx:0 CTS|DSR|CD
1: uart:16550A port:000002F8 irq:3 tx:0 rx:0 CTS|DSR|CD
2: uart:unknown port:000003E8 irq:4
3: uart:unknown port:000002E8 irq:3
4: uart:unknown port:00000000 irq:0
5: uart:unknown port:00000000 irq:0
6: uart:unknown port:00000000 irq:0
7: uart:unknown port:00000000 irq:0

machine2:/proc/tty/driver # cat usbserial 
usbserinfo:1.0 driver:2.0
0: module:pl2303 name:"pl2303" vendor:067b product:2303 num_ports:1 port:1 path:usb-0000:02:00.0-2.1

machine2:/proc/tty # cat drivers 
/dev/tty             /dev/tty        5       0 system:/dev/tty
/dev/console         /dev/console    5       1 system:console
/dev/ptmx            /dev/ptmx       5       2 system
/dev/vc/0            /dev/vc/0       4       0 system:vtmaster
usbserial            /dev/ttyUSB   188 0-253 serial
serial               /dev/ttyS       4 64-79 serial
pty_slave            /dev/pts      136 0-1048575 pty:slave
pty_master           /dev/ptm      128 0-1048575 pty:master
unknown              /dev/tty        4 1-63 console


machine2:/proc/tty # dmesg | grep -i tty

[    1.383652] serial8250: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A
[    1.424541] serial8250: ttyS1 at I/O 0x2f8 (irq = 3) is a 16550A
[    1.581063] 00:0a: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A
[    1.654207] 00:0b: ttyS1 at I/O 0x2f8 (irq = 3) is a 16550A
[    1.938507] tty tty17: hash matches
[ 2498.137304] usb 1-2.1: pl2303 converter now attached to ttyUSB0

USB0 インターフェイスのボーレートが高すぎることに気付いたので、115200 を割り当ててみました。

machine2:/proc # setserial /dev/ttyUSB0 baud_base 115200
Cannot set serial info: Invalid argument

それで、それが問題です...そして私はこのエラーを受け取ります。minicom 経由で S0、S1、USB0 インターフェイスを接続しようとすると、うまくいきません。

4

2 に答える 2

1

Baud_base はポート速度ではなく、周波数除数が 1 の場合の最大速度です。baud_base を設定する機能は、おそらく USB シリアル デバイスにはまったく適用されません。

sttyポート速度を設定するために使用するか、テスト用に または を使用しcuますminicom(ポート速度を自分で設定できます)。

于 2013-01-10T16:51:41.987 に答える
0

ボーレートについてはわかりませんが、別の端末を開いて実行するcat /dev/ttyUSB0 と、最初の端末echo AT > /dev/ttyUSB0でOKが返される可能性があります。それが役立つかどうかはわかりませんが、少なくとも応答が得られるはずです。

于 2013-01-10T16:50:20.593 に答える