/dev/ttyUSB0を読む

/dev/ttyUSB0を読む

Ubuntu(15.04)、カーネル3.19を使用して加速度計の出力を表示しようとしています。 UARTドライバはcp210x.ko、加速度計チップはMPU6050wです。したがって、デバイスを接続すると、次のようになります。

$ lsusb
Bus 001 Device 024: ID 10c4:ea60 Cygnal Integrated Products, Inc. CP210x UART Bridge / myAVR mySmartUSB light

$ sudo dmesg -c
[45550.171578] usb 1-14.3: new full-speed USB device number 24 using xhci_hcd
[45550.277334] usb 1-14.3: New USB device found, idVendor=10c4, idProduct=ea60
[45550.277337] usb 1-14.3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[45550.277338] usb 1-14.3: Product: CP2102 USB to UART Bridge Controller
[45550.277339] usb 1-14.3: Manufacturer: Silicon Labs
[45550.277340] usb 1-14.3: SerialNumber: 0001
[45550.278356] cp210x 1-14.3:1.0: cp210x converter detected
[45550.279845] usb 1-14.3: cp210x converter now attached to ttyUSB0

$ lsmod | grep cp210
cp210x                 24576  1 
usbserial              49152  3 cp210x

問題は、出力を読みたいときに/dev/ttyUSB0何もないということです。キュートコム、ミニコム、スクリーンなど様々なツールを使ってみましたが…表示もなく、カードを回すとカードのLEDだけが点滅します。

私が持っている他の情報は次のとおりです。

$ sudo lsusb -D /dev/ttyUSB0
Cannot open /dev/ttyUSB0

$ ls -l /dev/ttyUSB0
crw-rw-rw- 1 root dialout 188, 0 mai    4 10:57 /dev/ttyUSB0

$ stty -a -F /dev/ttyUSB0
speed 115200 baud; rows 0; columns 0; line = 0;
intr = ^C; quit = ^\; erase = ^?; kill = ^H; eof = ^D; eol = <undef>; eol2 = <undef>; swtch = <undef>; start = ^Q; stop = ^S;
susp = ^Z; rprnt = ^R; werase = ^W; lnext = ^V; flush = ^O; min = 100; time = 2;
-parenb -parodd -cmspar cs8 -hupcl -cstopb cread clocal -crtscts
-ignbrk brkint ignpar -parmrk -inpck -istrip -inlcr -igncr -icrnl ixon -ixoff -iuclc -ixany -imaxbel -iutf8
-opost -olcuc -ocrnl -onlcr -onocr -onlret -ofill -ofdel nl0 cr0 tab0 bs0 vt0 ff0
-isig -icanon iexten -echo echoe echok -echonl -noflsh -xcase -tostop -echoprt echoctl echoke

誰でもこの問題を解決するのに役立ちますか?私はこれを見たことがある質問しかし、私には解決策はありません。

ベストアンサー1

使用する場合、ttyUSBコンバータの速度はUSB <-> UARTコンバータの背後にあるデバイスが動作する速度に調整する必要があります。たとえば、コンバータの背後にあるデバイスの情報を表示するには、次の形式のコマンドを使用できます。

screen /dev/ttyUSB0 115200

115200コンバータの背後にあるデバイスの転送速度はどこにありますか?

PuTTYなどのユーティリティを使用できます。

おすすめ記事