Pages : 1
#1 Le 04/05/2015, à 10:48
- Gaara
[résolu] Accéléromètre USB
Salut à tous,
Je viens de recevoir un accéléromètre usb qui utilise le protocole série (UART) pour communiquer avec le pc.
Le driver UART est installé (nativement) dans le kernel, c'est le cp210x.
La puce accéléromètre est ATMega328p.
Je n'arrive pas à voir les données dans /dev/ttyUSB0, pourtant quand je bouge la carte, une lumière clignote (c'est qu'il fonctionne!)
Voilà ce que j'obtiens:
(je ne copie que les lignes qui sont intéressantes)
$ lsusb
Bus 001 Device 024: ID 10c4:ea60 Cygnal Integrated Products, Inc. CP210x UART Bridge / myAVR mySmartUSB light
$ lsusb -vs 24
Bus 001 Device 024: ID 10c4:ea60 Cygnal Integrated Products, Inc. CP210x UART Bridge / myAVR mySmartUSB light
Couldn't open device, some information will be missing
Device Descriptor:
bLength 18
bDescriptorType 1
bcdUSB 1.10
bDeviceClass 0 (Defined at Interface level)
bDeviceSubClass 0
bDeviceProtocol 0
bMaxPacketSize0 64
idVendor 0x10c4 Cygnal Integrated Products, Inc.
idProduct 0xea60 CP210x UART Bridge / myAVR mySmartUSB light
bcdDevice 1.00
iManufacturer 1
iProduct 2
iSerial 3
bNumConfigurations 1
Configuration Descriptor:
bLength 9
bDescriptorType 2
wTotalLength 32
bNumInterfaces 1
bConfigurationValue 1
iConfiguration 0
bmAttributes 0x80
(Bus Powered)
MaxPower 100mA
Interface Descriptor:
bLength 9
bDescriptorType 4
bInterfaceNumber 0
bAlternateSetting 0
bNumEndpoints 2
bInterfaceClass 255 Vendor Specific Class
bInterfaceSubClass 0
bInterfaceProtocol 0
iInterface 2
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x81 EP 1 IN
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 0x01 EP 1 OUT
bmAttributes 2
Transfer Type Bulk
Synch Type None
Usage Type Data
wMaxPacketSize 0x0040 1x 64 bytes
bInterval 0
$ 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
$ sudo cat /dev/ttyUSB0
# rien
Le "Couldn't open device, some information will be missing" m'ennuie un peu, c'est qu'il n'arrive pas à lire le flux.
J'ai essayé de recompiler le driver, au cas ou le driver d'origine soit mal compilé/configuré:
make
sudo cp cp210x.ko /lib/modules/3.19.0-15-generic/kernel/drivers/usb/serial
sudo rmmod cp210x.ko
sudo insmod cp210x.ko
$ lsmod | grep cp210
Module Size Used by
cp210x 24576 0
usbserial 49152 1 cp210x
Mais ça fait pareil, même résultat.
Une idée qui pourait m'aider à avancer ?
Merci
Dernière modification par Gaara (Le 05/05/2015, à 10:23)
Kubuntu 18.04 x64
Un terminal tactile Raspberry Pi et Odroid
<code>zenity --question --title "Alert" --text "Microsoft Windows has been found! Would you like to remove it?"</code>
Hors ligne
#2 Le 04/05/2015, à 11:18
- Gaara
Re : [résolu] Accéléromètre USB
Voici d'autres infos, dans le désordre:
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
Dernière modification par Gaara (Le 04/05/2015, à 11:35)
Kubuntu 18.04 x64
Un terminal tactile Raspberry Pi et Odroid
<code>zenity --question --title "Alert" --text "Microsoft Windows has been found! Would you like to remove it?"</code>
Hors ligne
#3 Le 05/05/2015, à 10:22
- Gaara
Re : [résolu] Accéléromètre USB
J'ai trouvé la solution !
C'est en fait un accéléromètre de type Arduino, il fallait donc reprogrammer la carte avec l'exemple "DigitalReadSerial" du logiciel.
On peut aussi faire clignoter la led orange avec l'exemple "Blink"
Donc maintenant j'ai ça:
$ tail -f /dev/ttyUSB0
Kubuntu 18.04 x64
Un terminal tactile Raspberry Pi et Odroid
<code>zenity --question --title "Alert" --text "Microsoft Windows has been found! Would you like to remove it?"</code>
Hors ligne
Pages : 1