USB till seriell!!???

PatricD
Inlägg: 22
Blev medlem: 31 mar 2007, 19:37
OS: Ubuntu
Utgåva: 10.04 Lucid LTS

USB till seriell!!???

Inlägg av PatricD »

Hej är i desperat behov av hjälp! Har en usb-dongel som jag försöker installera, det följde med ett installations-skript o lite filer på skivan, men får bara en massa fel.... Har Dapper 6.06 på en Acer travelmate 2410. Har förstått att PL-2303 modul måste finnas i kernel, men är inte den med o aktiverad från början? Under är output från make, hoppas någon kan utläsa nåt från det...
Jag är fortfarande n00b på detta ;)

patric@juggernaut:/tmp/Linux$ make
gcc -D__KERNEL__ -I/usr/src/linux/include -DCPU=586 -march=i586  -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer -fno-strict-aliasing -pipe -DMODULE  -c pl2303.c
In file included from pl2303.c:12:
/usr/include/linux/config.h:1:2: error: #error "Compilation aborted. Please read the FAQ for linux-libc-headers package."
/usr/include/linux/config.h:2:2: error: #error "(can be found at http://ep09.pld-linux.org/~mmazur/linux ... aders/doc/)"
In file included from /usr/include/linux/sched.h:16,
                from pl2303.c:14:
/usr/include/linux/signal.h:2:2: warning: #warning "You should include <signal.h>. This time I will do it for you."
In file included from /usr/include/linux/resource.h:4,
                from /usr/include/linux/sched.h:79,
                from pl2303.c:14:
/usr/include/linux/time.h:9: error: redefinition of ‘struct timespec’
/usr/include/linux/time.h:15: error: redefinition of ‘struct timeval’
/usr/include/linux/time.h:20: error: redefinition of ‘struct timezone’
/usr/include/linux/time.h:47: error: redefinition of ‘struct itimerval’
In file included from pl2303.c:15:
/usr/include/linux/signal.h:2:2: warning: #warning "You should include <signal.h>. This time I will do it for you."
pl2303.c:19:24: error: linux/slab.h: No such file or directory
pl2303.c:22:30: error: linux/tty_driver.h: No such file or directory
pl2303.c:23:28: error: linux/tty_flip.h: No such file or directory
In file included from pl2303.c:24:
/usr/include/linux/module.h:41: error: field ‘attr’ has incomplete type
/usr/include/linux/module.h:49: error: field ‘kobj’ has incomplete type
In file included from /usr/include/linux/spinlock.h:1,
                from pl2303.c:25:
/usr/include/linux/err_kernel_only.h:1:2: error: #error Kernel only header included in userspace
In file included from usb-serial.h:40,
                from pl2303.c:33:
/usr/include/linux/config.h:1:2: error: #error "Compilation aborted. Please read the FAQ for linux-libc-headers package."
/usr/include/linux/config.h:2:2: error: #error "(can be found at http://ep09.pld-linux.org/~mmazur/linux ... aders/doc/)"
In file included from pl2303.c:33:
usb-serial.h:72: error: syntax error before ‘wait_queue_head_t’
usb-serial.h:72: warning: no semicolon at end of struct or union
usb-serial.h:76: error: syntax error before ‘port_lock’
usb-serial.h:76: warning: type defaults to ‘int’ in declaration of ‘port_lock’
usb-serial.h:76: warning: data definition has no type or storage class
usb-serial.h:79: error: syntax error before ‘}’ token
usb-serial.h:92: error: array type has incomplete element type
usb-serial.h:117: error: field ‘driver_list’ has incomplete type
usb-serial.h:127: warning: ‘struct file’ declared inside parameter list
usb-serial.h:127: warning: its scope is only this definition or declaration, which is probably not what you want
usb-serial.h:128: warning: ‘struct file’ declared inside parameter list
usb-serial.h:131: warning: ‘struct file’ declared inside parameter list
usb-serial.h:132: warning: ‘struct termios’ declared inside parameter list
usb-serial.h: In function ‘serial_paranoia_check’:
usb-serial.h:164: warning: implicit declaration of function ‘dbg’
usb-serial.h: In function ‘port_paranoia_check’:
usb-serial.h:188: error: dereferencing pointer to incomplete type
usb-serial.h:193: error: dereferencing pointer to incomplete type
usb-serial.h:198: error: dereferencing pointer to incomplete type
usb-serial.h: In function ‘get_usb_serial’:
usb-serial.h:209: error: dereferencing pointer to incomplete type
usb-serial.h:215: error: dereferencing pointer to incomplete type
pl2303.c: At top level:
pl2303.c:42: warning: ‘struct file’ declared inside parameter list
pl2303.c:43: warning: ‘struct file’ declared inside parameter list
pl2303.c:45: warning: ‘struct termios’ declared inside parameter list
pl2303.c:47: warning: ‘struct file’ declared inside parameter list
pl2303.c:53: error: array type has incomplete element type
pl2303.c:54: warning: implicit declaration of function ‘USB_DEVICE’
pl2303.c:58: error: array type has incomplete element type
pl2303.c:78: warning: initialization from incompatible pointer type
pl2303.c:79: warning: initialization from incompatible pointer type
pl2303.c:83: warning: initialization from incompatible pointer type
pl2303.c:84: warning: initialization from incompatible pointer type
make: *** Deleting file `pl2303.o'
make: *** [pl2303.o] Interrupt
Lars
Inlägg: 6191
Blev medlem: 14 jan 2007, 19:31
OS: Ubuntu
Utgåva: 22.10 Kinetic Kudu
Ort: Stockholm

SV: USB till seriell!!???

Inlägg av Lars »

Jo, pl2303 verkar följa med som standard. Kommandot make försöker kompilera en egen modul, det kan vara lite knöligt så om det fungerar så är det bäst att använda det som kommer med Ubuntu.

När du ansluter dongeln så borde pl2303 laddas automatiskt, du kan kolla det genom att köra "lsmod". Om modulen inte finns med i listan så kan du köra "sudo modprobe pl2303" för att tvinga in den. Kolla också i systemloggen om dongeln har detekterats eller om det finns några felmeddelanden där.
PatricD
Inlägg: 22
Blev medlem: 31 mar 2007, 19:37
OS: Ubuntu
Utgåva: 10.04 Lucid LTS

SV: USB till seriell!!???

Inlägg av PatricD »

Apr 24 13:34:38 localhost kernel: [17200378.832000] usb 3-1: new full speed USB device using uhci_hcd and address 3
Apr 24 13:34:38 localhost kernel: [17200378.972000] pl2303 3-1:1.0: pl2303 converter detected
Apr 24 13:34:38 localhost kernel: [17200378.972000] usb 3-1: pl2303 converter now attached to ttyUSB0


Jo det ser ju faktiskt ut att fungera, men nästa problem blir då hur jag ansluter till enheten ? Det är en switch, jag trodde man kunde ansluta via terminalen, men hittar inte några såna inställlningar, måste ju ställa in baud-rate, paritet m.m... Krävs det ytterligare ett program eller?
Lars
Inlägg: 6191
Blev medlem: 14 jan 2007, 19:31
OS: Ubuntu
Utgåva: 22.10 Kinetic Kudu
Ort: Stockholm

SV: USB till seriell!!???

Inlägg av Lars »

Det ser ju bra ut, då ska det väl bara vara att använda /dev/ttyUSB0 istället för /dev/ttyS0 (som normala serieportar heter). Och ja, du behöver ett lämpligt program också, det jag kommer på just nu är minicom, kan säkert installeras med apt-get.
PatricD
Inlägg: 22
Blev medlem: 31 mar 2007, 19:37
OS: Ubuntu
Utgåva: 10.04 Lucid LTS

SV: USB till seriell!!???

Inlägg av PatricD »

Lade in Kermit istället, funkar skitbra! Tack
Skriv svar

Återgå till "Installation/Uppgradering/Drivrutiner - inaktuell"