2003-08-21 12:44:36

by Zoltan Boszormenyi

[permalink] [raw]
Subject: How to use an USB<->serial adapter?

/*
* serialtest2
*/

#include <stdio.h>
#include <stdlib.h>
#include "serial.h"

serial_t *sp;
unsigned char c1, c2;
int i;

void myexit(void) {
serial_close(sp);
}

int main(int argc, char **argv) {
if (argc != 2) {
printf("give device name\n");
return 1;
}

sp = serial_open(argv[1]);
if (!sp) {
printf("cannot open %s\n", argv[1]);
return 1;
}

serial_setup(sp);
if (sp->err < 0) {
printf("cannot setup %s\n", argv[1]);
}

atexit(myexit);

while (1) {
again:
serial_read(sp, &c1, 1, 1);
if (sp->err <= 0)
goto again;

c2 = c1+1;

serial_write(sp, &c2, 1);
printf("read: 0x%02x, written: 0x%02x\n", c1, c2);

}

return 0;
}



Attachments:
serial.h (712.00 B)
posix-serial.c (2.26 kB)
win32-serial.c (4.44 kB)
serialtest1.c (677.00 B)
serialtest2.c (668.00 B)
Download all attachments

2003-08-21 17:21:28

by Greg KH

[permalink] [raw]
Subject: Re: How to use an USB<->serial adapter?

On Thu, Aug 21, 2003 at 02:44:18PM +0200, Boszormenyi Zoltan wrote:
> Hi,
>
> I am experimenting with a Prolific USB<->RS232 adaptor. We have
> in-house developments that need serial communication and there
> are more and more mainboards that provide only one RS232 connector.
> (We would need more in one machine...)
> So we decided to try an usb-serial converter. The one we bought
> was happily recognized by a RedHat 9 system but I couldn't get
> two-way communication over this converter.

Which kernel version are you using?

I didn't run your test programs, but are you sure you got the hardware
flow control settings correct? How about testing the device with
minicom, as that is a program that is known to work properly with these
devices (along with lots of other ones, but that's a good place to
start.)

> setserial produces an error:
>
> # setserial /dev/ttyUSB0
> Cannot get serial info: Invalid argument

Yes, setserial does not work with the majority of the usb-serial
drivers, patches gladly accepted to fix this :)

thanks,

greg k-h

2003-08-22 07:32:50

by Zoltan Boszormenyi

[permalink] [raw]
Subject: Re: How to use an USB<->serial adapter?

Greg KH wrote:
> On Thu, Aug 21, 2003 at 02:44:18PM +0200, Boszormenyi Zoltan wrote:
>
>>Hi,
>>
>>I am experimenting with a Prolific USB<->RS232 adaptor. We have
>>in-house developments that need serial communication and there
>>are more and more mainboards that provide only one RS232 connector.
>>(We would need more in one machine...)
>>So we decided to try an usb-serial converter. The one we bought
>>was happily recognized by a RedHat 9 system but I couldn't get
>>two-way communication over this converter.
>
>
> Which kernel version are you using?

RH9 errata kernel 2.4.20-19.9, I also tried 2.6.0-test3-mm3.
On a sidenote, I also tried its driver on W98SE, WinXP.
Same result with the MinGW compiled test programs.

> I didn't run your test programs, but are you sure you got the hardware
> flow control settings correct? How about testing the device with

Hmm, how comes the same settings *work* on real 16550?
Even under Win*, with the MinGW compiled testprograms...

> minicom, as that is a program that is known to work properly with these
> devices (along with lots of other ones, but that's a good place to
> start.)

I tried it now, thanks. Same thing happens. I set up two different
minirc, /etc/minirc.dfl using /dev/ttyS0 and /etc/minirc.usb
for /dev/ttyUSB0. In one terminal, I typed 'minicom', in another
'minicom usb'. In the 'minicom usb' what I type, appears in the
other window, but keys typed in the 'minicom' do not appear in
'minicom usb'.

I am starting to be convinced that it is a hardware flaw.
I will try to replace it.

>>setserial produces an error:
>>
>># setserial /dev/ttyUSB0
>>Cannot get serial info: Invalid argument
>
>
> Yes, setserial does not work with the majority of the usb-serial
> drivers, patches gladly accepted to fix this :)

I wasn't prepared to this answer. ;-)

>
> thanks,
>
> greg k-h

--
Best regards,
Zolt?n B?sz?rm?nyi

---------------------
What did Hussein say about his knife?
One in Bush worth two in the hand.

2003-08-22 12:43:31

by Zoltan Boszormenyi

[permalink] [raw]
Subject: Re: How to use an USB<->serial adapter?

Hi,

here's the test programs output and I also set the module option
debug=1 in pl2303.

The testprograms' sources are still in my first mail.

In one terminal I started the listener test, it shows that
it received bytes on ttyS0, tried to write the answer:

$ ./serialtest2 /dev/ttyS0
read: 0x00, written: 0x01
read: 0x01, written: 0x02
read: 0x02, written: 0x03
read: 0x03, written: 0x04
read: 0x04, written: 0x05
read: 0x05, written: 0x06
read: 0x06, written: 0x07
read: 0x07, written: 0x08
read: 0x08, written: 0x09
read: 0x09, written: 0x0a
read: 0x00, written: 0x01
read: 0x01, written: 0x02
read: 0x02, written: 0x03
read: 0x03, written: 0x04
read: 0x04, written: 0x05
read: 0x05, written: 0x06
read: 0x06, written: 0x07
read: 0x07, written: 0x08
read: 0x08, written: 0x09
read: 0x09, written: 0x0a

In another terminal, I started the initiator test twice:

$ ./serialtest1 /dev/usb/ttyUSB0
written: 0x00, read: 0x00 <- sometimes I get one zero byte
written: 0x01, couldn't read
written: 0x02, couldn't read
written: 0x03, couldn't read
written: 0x04, couldn't read
written: 0x05, couldn't read
written: 0x06, couldn't read
written: 0x07, couldn't read
written: 0x08, couldn't read
written: 0x09, couldn't read
$ ./serialtest1 /dev/usb/ttyUSB0
written: 0x00, couldn't read
written: 0x01, couldn't read
written: 0x02, couldn't read
written: 0x03, couldn't read
written: 0x04, couldn't read
written: 0x05, couldn't read
written: 0x06, couldn't read
written: 0x07, couldn't read
written: 0x08, couldn't read
written: 0x09, couldn't read

During the session, the kernel log contains this:

usb.c: USB disconnect on device 00:04.2-2 address 3
pl2303.c: pl2303_shutdown
usbserial.c: PL-2303 converter now disconnected from ttyUSB0
hub.c: new USB device 00:04.2-2, assigned address 4
usbserial.c: PL-2303 converter detected
usbserial.c: PL-2303 converter now attached to ttyUSB0 (or usb/tts/0 for
devfs)
pl2303.c: pl2303_open - port 0
pl2303.c: 0xc0:0x1:0x8484:0x0 1 - 0
pl2303.c: 0x40:0x1:0x404:0x0 0
pl2303.c: 0xc0:0x1:0x8484:0x0 1 - 0
pl2303.c: 0xc0:0x1:0x8383:0x0 1 - 0
pl2303.c: 0xc0:0x1:0x8484:0x0 1 - 0
pl2303.c: 0x40:0x1:0x404:0x1 0
pl2303.c: 0xc0:0x1:0x8484:0x0 1 - 0
pl2303.c: 0xc0:0x1:0x8383:0x0 1 - 0
pl2303.c: 0x40:0x1:0x0:0x1 0
pl2303.c: 0x40:0x1:0x1:0xc0 0
pl2303.c: 0x40:0x1:0x2:0x4 0
pl2303.c: pl2303_set_termios - port 0, initialized = 0
pl2303.c: 0xa1:0x21:0:0 7 - 0 0 0 0 0 0 0
pl2303.c: 0x40:1:0:1 0
pl2303.c: pl2303_set_termios - data bits = 8
pl2303.c: pl2303_set_termios - baud = 9600
pl2303.c: pl2303_set_termios - stop bits = 1
pl2303.c: pl2303_set_termios - parity = none
pl2303.c: 0x21:0x20:0:0 7
pl2303.c: set_control_lines - value = 3, retval = 0
pl2303.c: 0xa1:0x21:0:0 7 - 80 25 0 0 0 0 8
pl2303.c: pl2303_open - submitting read urb
pl2303.c: pl2303_open - submitting interrupt urb
pl2303.c: pl2303_ioctl (0) cmd = 0x5401
pl2303.c: pl2303_ioctl not supported = 0x5401
pl2303.c: pl2303_ioctl (0) cmd = 0x540b
pl2303.c: pl2303_ioctl not supported = 0x540b
pl2303.c: pl2303_ioctl (0) cmd = 0x5402
pl2303.c: pl2303_ioctl not supported = 0x5402
pl2303.c: pl2303_set_termios - port 0, initialized = 1
pl2303.c: pl2303_read_int_callback - length = 10, data = a1 20 00 00 00
00 02 00 83 00
pl2303.c: 0xa1:0x21:0:0 7 - 80 25 0 0 0 0 8
pl2303.c: 0x40:1:0:1 0
pl2303.c: pl2303_set_termios - data bits = 8
pl2303.c: pl2303_set_termios - baud = 115200
pl2303.c: pl2303_set_termios - stop bits = 1
pl2303.c: pl2303_set_termios - parity = none
pl2303.c: 0x21:0x20:0:0 7
pl2303.c: set_control_lines - value = 3, retval = 0
pl2303.c: 0xa1:0x21:0:0 7 - 0 c2 1 0 0 0 8
pl2303.c: pl2303_ioctl (0) cmd = 0x5401
pl2303.c: pl2303_ioctl not supported = 0x5401
pl2303.c: pl2303_write - port 0, 1 bytes
pl2303.c: pl2303_write - length = 1, data = 00
pl2303.c: pl2303_write_bulk_callback - port 0
pl2303.c: pl2303_read_bulk_callback - port 0
pl2303.c: pl2303_read_bulk_callback - length = 1, data = 00
pl2303.c: pl2303_write - port 0, 1 bytes
pl2303.c: pl2303_write - length = 1, data = 01
pl2303.c: pl2303_write_bulk_callback - port 0
pl2303.c: pl2303_write - port 0, 1 bytes
pl2303.c: pl2303_write - length = 1, data = 02
pl2303.c: pl2303_write_bulk_callback - port 0
pl2303.c: pl2303_write - port 0, 1 bytes
pl2303.c: pl2303_write - length = 1, data = 03
pl2303.c: pl2303_write_bulk_callback - port 0
pl2303.c: pl2303_write - port 0, 1 bytes
pl2303.c: pl2303_write - length = 1, data = 04
pl2303.c: pl2303_write_bulk_callback - port 0
pl2303.c: pl2303_write - port 0, 1 bytes
pl2303.c: pl2303_write - length = 1, data = 05
pl2303.c: pl2303_write_bulk_callback - port 0
pl2303.c: pl2303_write - port 0, 1 bytes
pl2303.c: pl2303_write - length = 1, data = 06
pl2303.c: pl2303_write_bulk_callback - port 0
pl2303.c: pl2303_write - port 0, 1 bytes
pl2303.c: pl2303_write - length = 1, data = 07
pl2303.c: pl2303_write_bulk_callback - port 0
pl2303.c: pl2303_write - port 0, 1 bytes
pl2303.c: pl2303_write - length = 1, data = 08
pl2303.c: pl2303_write_bulk_callback - port 0
pl2303.c: pl2303_write - port 0, 1 bytes
pl2303.c: pl2303_write - length = 1, data = 09
pl2303.c: pl2303_write_bulk_callback - port 0
pl2303.c: pl2303_ioctl (0) cmd = 0x540b
pl2303.c: pl2303_ioctl not supported = 0x540b
pl2303.c: pl2303_ioctl (0) cmd = 0x5402
pl2303.c: pl2303_ioctl not supported = 0x5402
pl2303.c: pl2303_set_termios - port 0, initialized = 1
pl2303.c: 0xa1:0x21:0:0 7 - 0 c2 1 0 0 0 8
pl2303.c: 0x40:1:0:1 0
pl2303.c: pl2303_set_termios - data bits = 8
pl2303.c: pl2303_set_termios - baud = 9600
pl2303.c: pl2303_set_termios - stop bits = 1
pl2303.c: pl2303_set_termios - parity = none
pl2303.c: 0x21:0x20:0:0 7
pl2303.c: set_control_lines - value = 3, retval = 0
pl2303.c: 0xa1:0x21:0:0 7 - 80 25 0 0 0 0 8
pl2303.c: pl2303_ioctl (0) cmd = 0x5401
pl2303.c: pl2303_ioctl not supported = 0x5401
pl2303.c: pl2303_close - port 0
pl2303.c: set_control_lines - value = 0, retval = 0
pl2303.c: pl2303_close - shutting down urbs
pl2303.c: pl2303_close - usb_unlink_urb (write_urb) failed with reason: -19
pl2303.c: pl2303_read_bulk_callback - port 0
pl2303.c: pl2303_read_bulk_callback - urb->status = -2
pl2303.c: pl2303_read_bulk_callback - port is closed, exiting.
pl2303.c: pl2303_open - port 0
pl2303.c: 0xc0:0x1:0x8484:0x0 1 - 0
pl2303.c: 0x40:0x1:0x404:0x0 0
pl2303.c: 0xc0:0x1:0x8484:0x0 1 - 0
pl2303.c: 0xc0:0x1:0x8383:0x0 1 - 0
pl2303.c: 0xc0:0x1:0x8484:0x0 1 - 0
pl2303.c: 0x40:0x1:0x404:0x1 0
pl2303.c: 0xc0:0x1:0x8484:0x0 1 - 0
pl2303.c: 0xc0:0x1:0x8383:0x0 1 - 0
pl2303.c: 0x40:0x1:0x0:0x1 0
pl2303.c: 0x40:0x1:0x1:0xc0 0
pl2303.c: 0x40:0x1:0x2:0x4 0
pl2303.c: pl2303_set_termios - port 0, initialized = 1
pl2303.c: 0xa1:0x21:0:0 7 - 80 25 0 0 0 0 8
pl2303.c: 0x40:1:0:1 0
pl2303.c: pl2303_set_termios - data bits = 8
pl2303.c: pl2303_set_termios - baud = 9600
pl2303.c: pl2303_set_termios - stop bits = 1
pl2303.c: pl2303_set_termios - parity = none
pl2303.c: 0x21:0x20:0:0 7
pl2303.c: set_control_lines - value = 3, retval = 0
pl2303.c: 0xa1:0x21:0:0 7 - 80 25 0 0 0 0 8
pl2303.c: pl2303_open - submitting read urb
pl2303.c: pl2303_open - submitting interrupt urb
pl2303.c: pl2303_ioctl (0) cmd = 0x5401
pl2303.c: pl2303_ioctl not supported = 0x5401
pl2303.c: pl2303_ioctl (0) cmd = 0x540b
pl2303.c: pl2303_ioctl not supported = 0x540b
pl2303.c: pl2303_ioctl (0) cmd = 0x5402
pl2303.c: pl2303_ioctl not supported = 0x5402
pl2303.c: pl2303_set_termios - port 0, initialized = 1
pl2303.c: 0xa1:0x21:0:0 7 - 80 25 0 0 0 0 8
pl2303.c: 0x40:1:0:1 0
pl2303.c: pl2303_set_termios - data bits = 8
pl2303.c: pl2303_set_termios - baud = 115200
pl2303.c: pl2303_set_termios - stop bits = 1
pl2303.c: pl2303_set_termios - parity = none
pl2303.c: 0x21:0x20:0:0 7
pl2303.c: set_control_lines - value = 3, retval = 0
pl2303.c: 0xa1:0x21:0:0 7 - 0 c2 1 0 0 0 8
pl2303.c: pl2303_ioctl (0) cmd = 0x5401
pl2303.c: pl2303_ioctl not supported = 0x5401
pl2303.c: pl2303_write - port 0, 1 bytes
pl2303.c: pl2303_write - length = 1, data = 00
pl2303.c: pl2303_write_bulk_callback - port 0
pl2303.c: pl2303_write - port 0, 1 bytes
pl2303.c: pl2303_write - length = 1, data = 01
pl2303.c: pl2303_write_bulk_callback - port 0
pl2303.c: pl2303_write - port 0, 1 bytes
pl2303.c: pl2303_write - length = 1, data = 02
pl2303.c: pl2303_write_bulk_callback - port 0
pl2303.c: pl2303_write - port 0, 1 bytes
pl2303.c: pl2303_write - length = 1, data = 03
pl2303.c: pl2303_write_bulk_callback - port 0
pl2303.c: pl2303_write - port 0, 1 bytes
pl2303.c: pl2303_write - length = 1, data = 04
pl2303.c: pl2303_write_bulk_callback - port 0
pl2303.c: pl2303_write - port 0, 1 bytes
pl2303.c: pl2303_write - length = 1, data = 05
pl2303.c: pl2303_write_bulk_callback - port 0
pl2303.c: pl2303_write - port 0, 1 bytes
pl2303.c: pl2303_write - length = 1, data = 06
pl2303.c: pl2303_write_bulk_callback - port 0
pl2303.c: pl2303_write - port 0, 1 bytes
pl2303.c: pl2303_write - length = 1, data = 07
pl2303.c: pl2303_write_bulk_callback - port 0
pl2303.c: pl2303_write - port 0, 1 bytes
pl2303.c: pl2303_write - length = 1, data = 08
pl2303.c: pl2303_write_bulk_callback - port 0
pl2303.c: pl2303_write - port 0, 1 bytes
pl2303.c: pl2303_write - length = 1, data = 09
pl2303.c: pl2303_write_bulk_callback - port 0
pl2303.c: pl2303_ioctl (0) cmd = 0x540b
pl2303.c: pl2303_ioctl not supported = 0x540b
pl2303.c: pl2303_ioctl (0) cmd = 0x5402
pl2303.c: pl2303_ioctl not supported = 0x5402
pl2303.c: pl2303_set_termios - port 0, initialized = 1
pl2303.c: 0xa1:0x21:0:0 7 - 0 c2 1 0 0 0 8
pl2303.c: 0x40:1:0:1 0
pl2303.c: pl2303_set_termios - data bits = 8
pl2303.c: pl2303_set_termios - baud = 9600
pl2303.c: pl2303_set_termios - stop bits = 1
pl2303.c: pl2303_set_termios - parity = none
pl2303.c: 0x21:0x20:0:0 7
pl2303.c: set_control_lines - value = 3, retval = 0
pl2303.c: 0xa1:0x21:0:0 7 - 80 25 0 0 0 0 8
pl2303.c: pl2303_ioctl (0) cmd = 0x5401
pl2303.c: pl2303_ioctl not supported = 0x5401
pl2303.c: pl2303_close - port 0
pl2303.c: set_control_lines - value = 0, retval = 0
pl2303.c: pl2303_close - shutting down urbs
pl2303.c: pl2303_close - usb_unlink_urb (write_urb) failed with reason: -19
pl2303.c: pl2303_read_bulk_callback - port 0
pl2303.c: pl2303_read_bulk_callback - urb->status = -2
pl2303.c: pl2303_read_bulk_callback - port is closed, exiting.

I also tried some different baud rates (2400, 19200) besides
the fastest 115200 that was default in the testprograms.

Now what?

Oh, did I mention that the pinout of the cable (that I use to loopback
the USB<->serial cable into the same PC) is

DB9 <-> DB9
1,6 <-> 4
2 <-> 3
3 <-> 2
4 <-> 1,6
5 <-> 5
7 <-> 8
8 <-> 7

--
Best regards,
Zolt?n B?sz?rm?nyi

---------------------
What did Hussein say about his knife?
One in Bush worth two in the hand.

2003-08-22 13:51:13

by Daniel Egger

[permalink] [raw]
Subject: Re: How to use an USB<->serial adapter?

Am Don, 2003-08-21 um 14.44 schrieb Boszormenyi Zoltan:

> usb.c: registered new driver serial
> usbserial.c: USB Serial support registered for Generic
> usbserial.c: USB Serial Driver core v1.4
> usbserial.c: USB Serial support registered for PL-2303
> usbserial.c: PL-2303 converter detected
> usbserial.c: PL-2303 converter now attached to ttyUSB0 \
> (or usb/tts/0 for devfs)
> pl2303.c: Prolific PL2303 USB to serial adaptor driver v0.9

Works for me, even on PowerPC. I'm typically using minicom and ckermit
but mgetty and others work fine, too.

> setserial produces an error:

What do you need this relic from former times for?

--
Servus,
Daniel


Attachments:
signature.asc (189.00 B)
Dies ist ein digital signierter Nachrichtenteil

2003-08-25 06:24:31

by Zoltan Boszormenyi

[permalink] [raw]
Subject: Re: How to use an USB<->serial adapter?

Daniel Egger wrote:
> Am Don, 2003-08-21 um 14.44 schrieb Boszormenyi Zoltan:
>
>
>>usb.c: registered new driver serial
>>usbserial.c: USB Serial support registered for Generic
>>usbserial.c: USB Serial Driver core v1.4
>>usbserial.c: USB Serial support registered for PL-2303
>>usbserial.c: PL-2303 converter detected
>>usbserial.c: PL-2303 converter now attached to ttyUSB0 \
>>(or usb/tts/0 for devfs)
>>pl2303.c: Prolific PL2303 USB to serial adaptor driver v0.9
>
>
> Works for me, even on PowerPC. I'm typically using minicom and ckermit
> but mgetty and others work fine, too.

What product is this? Mine is a Wiretek UN8BE, based on Prolific 2303.

# lsusb -s 001:002
Bus 001 Device 002: ID 067b:2303 Prolific Technology, Inc. PL2303 Serial
Port
Language IDs: none (invalid length string descriptor 63; len=7)
Device Descriptor:
bLength 18
bDescriptorType 1
bcdUSB 1.10
bDeviceClass 0 Interface
bDeviceSubClass 0
bDeviceProtocol 0
bMaxPacketSize0 8
idVendor 0x067b Prolific Technology, Inc.
idProduct 0x2303 PL2303 Serial Port
bcdDevice 2.02
iManufacturer 0 <--- should'nt these two be set?
iProduct 0 <--- (or not, it is optional)
iSerial 0
bNumConfigurations 1
Configuration Descriptor:
bLength 9
bDescriptorType 2
wTotalLength 39
bNumInterfaces 1
bConfigurationValue 1
iConfiguration 0
bmAttributes 0xa0
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
wMaxPacketSize 10
bInterval 1
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x02 EP 2 OUT
bmAttributes 2
Transfer Type Bulk
Synch Type none
wMaxPacketSize 64
bInterval 0
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x83 EP 3 IN
bmAttributes 2
Transfer Type Bulk
Synch Type none
wMaxPacketSize 64
bInterval 0
Language IDs: none (invalid length string descriptor 63; len=7)

In the shop they said this one cannot be used as a null-link but works
with external serial devices, e.g. modems. I have yet to verify this
statement myself.

>>setserial produces an error:
>
>
> What do you need this relic from former times for?

I tried to query the USB serial line's current parameters.
Is there any other utilities that can do this for me?

--
Best regards,
Zolt?n B?sz?rm?nyi

---------------------
What did Hussein say about his knife?
One in Bush worth two in the hand.

2003-08-25 10:27:20

by Daniel Egger

[permalink] [raw]
Subject: Re: How to use an USB<->serial adapter?

Am Mon, 2003-08-25 um 08.24 schrieb Boszormenyi Zoltan:

> What product is this? Mine is a Wiretek UN8BE, based on Prolific 2303.

Mine is from STLAB.

Bus 002 Device 003: ID 7b06:0323
Language IDs: none (invalid length string descriptor 63; len=7)
Device Descriptor:
bLength 18
bDescriptorType 1
bcdUSB 10.01
bDeviceClass 0 Interface
bDeviceSubClass 0
bDeviceProtocol 0
bMaxPacketSize0 8
idVendor 0x7b06
idProduct 0x0323
bcdDevice 2.02
iManufacturer 0
iProduct 0
iSerial 0
bNumConfigurations 1
Configuration Descriptor:
bLength 9
bDescriptorType 2
wTotalLength 39
bNumInterfaces 1
bConfigurationValue 1
iConfiguration 0
bmAttributes 0xa0
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
wMaxPacketSize 10
bInterval 1
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x02 EP 2 OUT
bmAttributes 2
Transfer Type Bulk
Synch Type none
wMaxPacketSize 64
bInterval 0
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x83 EP 3 IN
bmAttributes 2
Transfer Type Bulk
Synch Type none
wMaxPacketSize 64
bInterval 0
Language IDs: none (invalid length string descriptor 63; len=7)

Hrm, lsusb seems to have an endianess problem, the vendorid is garbled.

> In the shop they said this one cannot be used as a null-link but works
> with external serial devices, e.g. modems. I have yet to verify this
> statement myself.

Doesn't really make sense to me. RS232 is specified electrically, the
adapter doesn't know which kind of device it is talking to. I'm using
mine to connect to a TTL-RS232 adapter which sits on a DSL-router, so
it's like a "null-link".

> I tried to query the USB serial line's current parameters.
> Is there any other utilities that can do this for me?

Why do you need this, don't you know what you set it to? :)
There are ioctls for it and probably a terminal program will know how to
read and write it.

--
Servus,
Daniel


Attachments:
signature.asc (189.00 B)
Dies ist ein digital signierter Nachrichtenteil

2003-08-27 09:34:05

by Zoltan Boszormenyi

[permalink] [raw]
Subject: Re: How to use an USB<->serial adapter?

Daniel Egger wrote:
> Am Mon, 2003-08-25 um 08.24 schrieb Boszormenyi Zoltan:
>
>
>>What product is this? Mine is a Wiretek UN8BE, based on Prolific 2303.
>
>
> Mine is from STLAB.
> ...
>
>>In the shop they said this one cannot be used as a null-link but works
>>with external serial devices, e.g. modems. I have yet to verify this
>>statement myself.
>
>
> Doesn't really make sense to me. RS232 is specified electrically, the
> adapter doesn't know which kind of device it is talking to. I'm using
> mine to connect to a TTL-RS232 adapter which sits on a DSL-router, so
> it's like a "null-link".

Now, I was able to get an external modem. No workee...
The modem RD/TD LEDs are flashing, DTR is lit on permanently
so the modem is receiving and *tries to send*. Maybe the shop
went this far in testing to say that the cable works. :-(
But the PC isn't receiving. E.g. in WinXX, the modem is not found,
in RH9, no dialing out.

At least it is consistent with my findings with the null-link cable.
Back to the shop and sorry for the noise.

--
Best regards,
Zolt?n B?sz?rm?nyi

---------------------
What did Hussein say about his knife?
One in Bush worth two in the hand.