Skip to contentSkip to conversation

Issue with RS232 <-> USB adaptor (FC15)

DISCUSSION f8arr 3 participants 13 messages Jun 13, 2011 – Jun 14, 2011

lore
Share & tools
lore

f8arr

author
#0 lore raw

Hello Hams !

Apologies for the bandwich, but perhaps someone has allready faced it ...

Here is the case :
In order to have a TX port on WSJT I use /dev/ttyUSB0 from prolific pl2303. At boot, the serial comes up to TX.
On messages I have only this message :

Jun 13 17:00:08 f8arr2-station kernel: [ 3574.706035] usb 3-1: new full speed USB device using uhci_hcd and address 8
Jun 13 17:00:08 f8arr2-station kernel: [ 3574.852805] usb 3-1: New USB device found, idVendor=067b, idProduct=2303
Jun 13 17:00:08 f8arr2-station kernel: [ 3574.852814] usb 3-1: New USB device strings: Mfr=1, Product=2, SerialNumber=0
Jun 13 17:00:08 f8arr2-station kernel: [ 3574.852819] usb 3-1: Product: USB-Serial Controller
Jun 13 17:00:08 f8arr2-station kernel: [ 3574.852823] usb 3-1: Manufacturer: Prolific Technology Inc.
Jun 13 17:00:08 f8arr2-station kernel: [ 3574.855943] pl2303 3-1:1.0: pl2303 converter detected
Jun 13 17:00:08 f8arr2-station kernel: [ 3574.868109] usb 3-1: pl2303 converter now attached to ttyUSB0
Jun 13 17:00:08 f8arr2-station mtp-probe: checking bus 3, device 8: "/sys/devices/pci0000:00/0000:00:1d.1/usb3/3-1"
Jun 13 17:00:08 f8arr2-station mtp-probe: bus: 3, device: 8 was not an MTP device

Of course, If I run WSJT it can't commute the TX with an error message "Can't connect to /dev/ttyUSB0"

My user is on the "dialout" and "uucp" group.

I tried exactly the same manipulation with my only real RS232 port and it works like a charm.. (but dedicated to an other action). Of course, same configuration was ok under my ubuntu 10.04. but I switched to Fedora 15...

If someone had a idea.. it would be great. My freind google didn't came with something looking good...

regards
F8ARR - Guillaume

#1 lore raw
Quoted 8 lines · On 06/13/2011 12:24 PM, f8arr wrote:

Hello Hams !

Apologies for the bandwich, but perhaps someone has allready faced it ...

Here is the case :
In order to have a TX port on WSJT I use /dev/ttyUSB0 from prolific pl2303. At boot, the serial comes up to TX.

I'm not certain what you mean here. Does this mean that the transmitter is keyed up into TX, as soon as the system boots and the USB serial port adapter is recognized by the kernel?

If so, this would suggest one of several things:

- Your PL2303 adapter is asserting either DTR or RTS when it is first initialized, without waiting for some program to open the USB serial port.

[Question - which of these lines are you using to drive
PTT on your transmitter?]

- Some (unexpected) program is opening /dev/ttyUSB0 as soon as the adapter is connected.

Quoted 15 lines

On messages I have only this message :

Jun 13 17:00:08 f8arr2-station kernel: [ 3574.706035] usb 3-1: new full
speed USB device using uhci_hcd and address 8
Jun 13 17:00:08 f8arr2-station kernel: [ 3574.852805] usb 3-1: New USB
device found, idVendor=067b, idProduct=2303
Jun 13 17:00:08 f8arr2-station kernel: [ 3574.852814] usb 3-1: New USB
device strings: Mfr=1, Product=2, SerialNumber=0
Jun 13 17:00:08 f8arr2-station kernel: [ 3574.852819] usb 3-1: Product:
USB-Serial Controller
Jun 13 17:00:08 f8arr2-station kernel: [ 3574.852823] usb 3-1:
Manufacturer: Prolific Technology Inc.
Jun 13 17:00:08 f8arr2-station kernel: [ 3574.855943] pl2303 3-1:1.0:
pl2303 converter detected
Jun 13 17:00:08 f8arr2-station kernel: [ 3574.868109] usb 3-1: pl2303
Quoted 5 lines

converter now attached to ttyUSB0

Of course, If I run WSJT it can't commute the TX with an error message "Can't connect to /dev/ttyUSB0"

That suggests that either the permissions are wrong, or that some other program/process has already opened the serial port for some reason.

Quoted 1 line

My user is on the "dialout" and "uucp" group.

When the system is in this state, try the following:

ls -l /dev/ttyUSB0
lsof | grep ttyUSB0

The output for the first command will show you what owner/group information was set up for the port during the hot-plugging.

The output for the second command should help you see whether there's another program "busying out" the USB serial port.

Quoted 4 lines

I tried exactly the same manipulation with my only real RS232 port and it works like a charm.. (but dedicated to an other action). Of course, same configuration was ok under my ubuntu 10.04. but I switched to Fedora 15...

That suggests that the adapter itself is OK, and that it's either an issue of permissions for the port (which would be set via a configuration file in /etc/udev/), or an issue of some other program opening the port (maybe something looking for a serial mouse or a modem?)

author
#2 lore raw

Hello My answers inside the email. (Thank you for your reply ;-) )

Quoted 6 lines · Dave Platt
Quoted 5 lines · On 06/13/2011 12:24 PM, f8arr wrote:

Hello Hams !

Apologies for the bandwich, but perhaps someone has allready faced it ...

Quoted 6 lines
Quoted 3 lines

Here is the case :
In order to have a TX port on WSJT I use /dev/ttyUSB0 from prolific pl2303. At boot, the serial comes up to TX.

I'm not certain what you mean here. Does this mean that the transmitter is keyed up into TX, as soon as the system boots and the USB serial port adapter is recognized by the kernel?

YES

Quoted 5 lines

If so, this would suggest one of several things:

- Your PL2303 adapter is asserting either DTR or RTS when it is first initialized, without waiting for some program to open the USB serial port.

you are right

Quoted 2 lines

[Question - which of these lines are you using to drive
PTT on your transmitter?]

I'm using DTR

Quoted 3 lines

- Some (unexpected) program is opening /dev/ttyUSB0 as soon as the adapter is connected.

may be.. but witch one ?? grrr

Quoted 17 lines
Quoted 16 lines

On messages I have only this message :

Jun 13 17:00:08 f8arr2-station kernel: [ 3574.706035] usb 3-1: new full
speed USB device using uhci_hcd and address 8
Jun 13 17:00:08 f8arr2-station kernel: [ 3574.852805] usb 3-1: New USB
device found, idVendor=067b, idProduct=2303
Jun 13 17:00:08 f8arr2-station kernel: [ 3574.852814] usb 3-1: New USB
device strings: Mfr=1, Product=2, SerialNumber=0
Jun 13 17:00:08 f8arr2-station kernel: [ 3574.852819] usb 3-1: Product:
USB-Serial Controller
Jun 13 17:00:08 f8arr2-station kernel: [ 3574.852823] usb 3-1:
Manufacturer: Prolific Technology Inc.
Jun 13 17:00:08 f8arr2-station kernel: [ 3574.855943] pl2303 3-1:1.0:
pl2303 converter detected
Jun 13 17:00:08 f8arr2-station kernel: [ 3574.868109] usb 3-1: pl2303

converter now attached to ttyUSB0

Quoted 6 lines
Quoted 2 lines

Of course, If I run WSJT it can't commute the TX with an error message "Can't connect to /dev/ttyUSB0"

That suggests that either the permissions are wrong, or that some other program/process has already opened the serial port for some reason.

I think that is due to program blocking. Because if I do some manipulations with my only real RS232 serial it is working like a charm. This is due to RS232<->USB (driver?)

Quoted 9 lines
Quoted 1 line

My user is on the "dialout" and "uucp" group.

When the system is in this state, try the following:

ls -l /dev/ttyUSB0
lsof | grep ttyUSB0

The output for the first command will show you what owner/group information was set up for the port during the hot-plugging.

crw-rw-rw-. 1 root uucp 188, 0 Jun 13 21:15 /dev/ttyUSB0

(My user is under uucp group)
uucp:x:14:uucp,f8arr
dialout:x:18:f8arr
f8arr:x:500:

Quoted 4 lines

The output for the second command should help you see whether there's another program "busying out" the USB serial port.

nothing...

Quoted 9 lines
Quoted 4 lines

I tried exactly the same manipulation with my only real RS232 port and it works like a charm.. (but dedicated to an other action). Of course, same configuration was ok under my ubuntu 10.04. but I switched to Fedora 15...

That suggests that the adapter itself is OK, and that it's either an issue of permissions for the port (which would be set via a configuration file in /etc/udev/), or an issue of some other program opening the port (maybe something looking for a serial mouse or a modem?)

I had this in udev rules :

SUBSYSTEM=="usb", SYSFS{idVendor}=="067b", MODE="0666"

with lsusb :

Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub Bus 005 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub Bus 002 Device 002: ID 0603:00f2 Novatek Microelectronics Corp. Bus 002 Device 003: ID 046d:c404 Logitech, Inc. TrackMan Wheel Bus 003 Device 002: ID 067b:2303 Prolific Technology, Inc. PL2303 Serial Port Bus 003 Device 003: ID 067b:2303 Prolific Technology, Inc. PL2303 Serial Port

(I have two usb to RS232 adpaters.)

Thaks for help !

Guillaume

Quoted 5 lines

--
To unsubscribe from this list: send the line "unsubscribe linux-hams" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#3 lore raw
In reply to f8arr
Quoted 1 line · Le 13/06/2011 à 21:24, f8arr a écrit :

mtp-probe: bus: 3, device: 8 was not an MTP device

Hello Guillaume,

Your problem might be related to that bug:

http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=630202

I guess it can occur in other Linux distros, so even if you're not running Debian, you might be concerned too.

This bug is still in "open" state, in the meantime, if you don't need "libmtp-runtime" (or its equivalent in your distro), the temporary solution is to remove it, or at least the "mtp-probe" binary which seems to be responsible for this buggy behaviour.

Best Regards,

Bruno - F8FIV
--
To unsubscribe from this list: send the line "unsubscribe linux-hams" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

author
#4 lore raw

Hello,

I'm not sure because I found the problem to resolve my issue :

stty --file=/dev/ttyUSB0 clocal

I remove all flow control on the serial.

Has I have two same USB controler, I made a diff from USB0 to USB1 :

# diff usb0 usb1
5c5
<  -parenb -parodd cs8 hupcl -cstopb cread clocal -crtscts
---
Quoted 1 line

-parenb -parodd cs8 hupcl -cstopb cread -clocal -crtscts

This is the only difference... maybe there is a configuration somewhere at boot that specify such parameters. Has i'm not really aware of hardware configuration I'll investigate to resolve on the source. (instead of putting a line on my .profile ;-)

f8arr

Quoted 9 lines · Bruno Tréguier
Quoted 1 line · Le 13/06/2011 à 21:24, f8arr a écrit :

mtp-probe: bus: 3, device: 8 was not an MTP device

Hello Guillaume,

Your problem might be related to that bug:

http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=630202

Quoted 12 lines

I guess it can occur in other Linux distros, so even if you're not running Debian, you might be concerned too.

This bug is still in "open" state, in the meantime, if you don't need "libmtp-runtime" (or its equivalent in your distro), the temporary solution is to remove it, or at least the "mtp-probe" binary which seems to be responsible for this buggy behaviour.

Best Regards,

Bruno - F8FIV

Signature · 3 lines
To unsubscribe from this list: send the line "unsubscribe linux-hams" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

--
To unsubscribe from this list: send the line "unsubscribe linux-hams" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#5 lore raw
Quoted 6 lines · Le 13/06/2011 à 22:28, f8arr a écrit :

Hello,

I'm not sure because I found the problem to resolve my issue :

stty --file=/dev/ttyUSB0 clocal

Quoted 9 lines

I remove all flow control on the serial.

Has I have two same USB controler, I made a diff from USB0 to USB1 :

# diff usb0 usb1
5c5
< -parenb -parodd cs8 hupcl -cstopb cread clocal -crtscts
---
Quoted 1 line

-parenb -parodd cs8 hupcl -cstopb cread -clocal -crtscts

Ok, sorry for that, I made the wrong assumption that your /dev/ttyUSB0 device didn't even exist and that it was the reason you could not have any access to it.

This is quite strange as (at least as far as I know) PL2303 chips usually cope quite well with flow control. I've been using quite a few of them here, but never on Fedora Core however (thought I doubt this makes any difference here).

Quoted 4 lines

This is the only difference... maybe there is a configuration somewhere at boot that specify such parameters. Has i'm not really aware of hardware configuration I'll investigate to resolve on the source. (instead of putting a line on my .profile ;-)

;-)

Regards,

Bruno - F8FIV
--
To unsubscribe from this list: send the line "unsubscribe linux-hams" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#6 lore raw
Quoted 8 lines · Bruno Tréguier
Quoted 7 lines · Le 13/06/2011 à 22:28, f8arr a écrit :

Hello,

I'm not sure because I found the problem to resolve my issue :

stty --file=/dev/ttyUSB0 clocal

I remove all flow control on the serial.

I don't think that "clocal" removes flow control (on RTS/CTS) - that's controlled by a separate option.

What "clocal" does, is "disable modem control signals". Specifically, for a port marked "-clocal" (not local), an open() call will block until the device on the port asserts the CD (carrier detect) line, and if the CD line is deasserted the port will "hang up". This is useful for serial ports connected to dial-up modems, but not particularly desirable for serial ports being used to control local devices such as transceiver.

I can't recall whether a -clocal port automagically asserts DTR even when it isn't open... I don't think so but I could be wrong.

--
To unsubscribe from this list: send the line "unsubscribe linux-hams" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

author
#7 lore raw

hum...

you are right the Issue is not clear.. something is going wrong... I have to investigate.

73 qro
f8ARR

Quoted 21 lines · Dave Platt
Quoted 8 lines · Bruno Tréguier
Quoted 7 lines · Le 13/06/2011 à 22:28, f8arr a écrit :

Hello,

I'm not sure because I found the problem to resolve my issue :

stty --file=/dev/ttyUSB0 clocal

I remove all flow control on the serial.

I don't think that "clocal" removes flow control (on RTS/CTS) - that's controlled by a separate option.

What "clocal" does, is "disable modem control signals". Specifically, for a port marked "-clocal" (not local), an open() call will block until the device on the port asserts the CD (carrier detect) line, and if the CD line is deasserted the port will "hang up". This is useful for serial ports connected to dial-up modems, but not particularly desirable for serial ports being used to control local devices such as transceiver.

Quoted 9 lines

I can't recall whether a -clocal port automagically asserts DTR even when it isn't open... I don't think so but I could be wrong.

--
To unsubscribe from this list: send the line "unsubscribe linux-hams" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

--
To unsubscribe from this list: send the line "unsubscribe linux-hams" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

author
#8 lore raw

Hello

Some progress on my acknowledge...

When the PC start, my DTR of my USB-RS232 is up (-6v).
It mean that a program or a daemon is listenning and/or managing my serial. I don't want it because i'll use it directly from Wsjt.

If someone has an idear where to search...

73 qro
F8ARR

Quoted 34 lines · On 06/13/2011 11:26 PM, f8arr wrote:

hum...

you are right the Issue is not clear.. something is going wrong... I have to investigate.

73 qro
f8ARR

Quoted 25 lines · Dave Platt
Quoted 8 lines · Bruno Tréguier
Quoted 7 lines · Le 13/06/2011 à 22:28, f8arr a écrit :

Hello,

I'm not sure because I found the problem to resolve my issue :

stty --file=/dev/ttyUSB0 clocal

I remove all flow control on the serial.

I don't think that "clocal" removes flow control (on RTS/CTS) - that's controlled by a separate option.

What "clocal" does, is "disable modem control signals". Specifically, for a port marked "-clocal" (not local), an open() call will block until the device on the port asserts the CD (carrier detect) line, and if the CD line is deasserted the port will "hang up". This is useful for serial ports connected to dial-up modems, but not particularly desirable for serial ports being used to control local devices such as transceiver.

I can't recall whether a -clocal port automagically asserts DTR even when it isn't open... I don't think so but I could be wrong.

Quoted 10 lines
Quoted 5 lines
Signature · 3 lines
To unsubscribe from this list: send the line "unsubscribe linux-hams" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Signature · 3 lines
To unsubscribe from this list: send the line "unsubscribe linux-hams" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

--
To unsubscribe from this list: send the line "unsubscribe linux-hams" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#9 lore raw
Quoted 9 lines · Le 14/06/2011 à 22:52, f8arr a écrit :

Hello

Some progress on my acknowledge...

When the PC start, my DTR of my USB-RS232 is up (-6v). It mean that a program or a daemon is listenning and/or managing my serial. I don't want it because i'll use it directly from Wsjt.

If someone has an idear where to search...

Hi Guillaume,

Have you tried using "fuser" to see which process was using your tty ?

A simple "fuser /dev/ttyUSB0" (preferably as root) should do the trick...

Best regards,

Bruno - F8FIV
--
To unsubscribe from this list: send the line "unsubscribe linux-hams" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

author
#10 lore raw

yes..

nothing.. (as root)

But I remember that there was a daemon that was working on serial by default on linux.. I'am wrong ? I'm unable to remember.

f8arr

Quoted 13 lines · Bruno Tréguier
Quoted 9 lines · Le 14/06/2011 à 22:52, f8arr a écrit :

Hello

Some progress on my acknowledge...

When the PC start, my DTR of my USB-RS232 is up (-6v). It mean that a program or a daemon is listenning and/or managing my serial. I don't want it because i'll use it directly from Wsjt.

If someone has an idear where to search...

Hi Guillaume,

Quoted 12 lines

Have you tried using "fuser" to see which process was using your tty ?

A simple "fuser /dev/ttyUSB0" (preferably as root) should do the trick...

Best regards,

Bruno - F8FIV

Signature · 3 lines
To unsubscribe from this list: send the line "unsubscribe linux-hams" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

--
To unsubscribe from this list: send the line "unsubscribe linux-hams" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

author
#11 lore raw

I found !!!!!!!!!!!!!!!!!!!!!!!!!

The problem came from modem-manager lauched by dbus. In order to desactivate I had to remove

/usr/share/dbus-1/system-services/org.freedesktop.ModemManager.service

The following trace on /var/log/messages put me on the rails:

Jun 13 14:32:24 f8arr2-station modem-manager[721]: <info>  (ttyUSB0) closing serial port...
Jun 13 14:32:24 f8arr2-station modem-manager[721]: <info>  (ttyUSB0) serial port closed
Jun 13 14:32:24 f8arr2-station modem-manager[721]: <info>  (ttyUSB0) opening serial port...
Jun 13 14:32:24 f8arr2-station modem-manager[721]: <info>  (ttyUSB1) closing serial port...
Jun 13 14:32:24 f8arr2-station modem-manager[721]: <info>  (ttyUSB1) serial port closed
Jun 13 14:32:24 f8arr2-station modem-manager[721]: <info>  (ttyUSB1) opening serial port...
Jun 13 14:32:24 f8arr2-station modem-manager[721]: <info>  (ttyUSB0) closing serial port...
Jun 13 14:32:24 f8arr2-station modem-manager[721]: <info>  (ttyUSB0) serial port closed

This is working now !!
Thanks everybody for support

Let's go on the rock now (EME) !!!

73 qro
f8arr

Quoted 27 lines · On 06/14/2011 11:06 PM, f8arr wrote:

yes..

nothing.. (as root)

But I remember that there was a daemon that was working on serial by default on linux.. I'am wrong ? I'm unable to remember.

f8arr

Quoted 17 lines · Bruno Tréguier
Quoted 9 lines · Le 14/06/2011 à 22:52, f8arr a écrit :

Hello

Some progress on my acknowledge...

When the PC start, my DTR of my USB-RS232 is up (-6v). It mean that a program or a daemon is listenning and/or managing my serial. I don't want it because i'll use it directly from Wsjt.

If someone has an idear where to search...

Hi Guillaume,

Have you tried using "fuser" to see which process was using your tty ?

A simple "fuser /dev/ttyUSB0" (preferably as root) should do the trick...

Quoted 13 lines
Quoted 8 lines

Best regards,

Bruno - F8FIV

Signature · 3 lines
To unsubscribe from this list: send the line "unsubscribe linux-hams" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Signature · 3 lines
To unsubscribe from this list: send the line "unsubscribe linux-hams" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

--
To unsubscribe from this list: send the line "unsubscribe linux-hams" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#12 lore raw
Quoted 24 lines · Le 14/06/2011 à 23:20, f8arr a écrit :

I found !!!!!!!!!!!!!!!!!!!!!!!!!

The problem came from modem-manager lauched by dbus. In order to desactivate I had to remove

/usr/share/dbus-1/system-services/org.freedesktop.ModemManager.service

The following trace on /var/log/messages put me on the rails:

Jun 13 14:32:24 f8arr2-station modem-manager[721]: <info> (ttyUSB0)
closing serial port...
Jun 13 14:32:24 f8arr2-station modem-manager[721]: <info> (ttyUSB0)
serial port closed
Jun 13 14:32:24 f8arr2-station modem-manager[721]: <info> (ttyUSB0)
opening serial port...
Jun 13 14:32:24 f8arr2-station modem-manager[721]: <info> (ttyUSB1)
closing serial port...
Jun 13 14:32:24 f8arr2-station modem-manager[721]: <info> (ttyUSB1)
serial port closed
Jun 13 14:32:24 f8arr2-station modem-manager[721]: <info> (ttyUSB1)
opening serial port...
Jun 13 14:32:24 f8arr2-station modem-manager[721]: <info> (ttyUSB0)
closing serial port...
Jun 13 14:32:24 f8arr2-station modem-manager[721]: <info> (ttyUSB0)
Quoted 1 line

serial port closed

Well done ! But it's rather strange that "fuser" didn't give away the name of the culprit... As the modem-manager application seems to keep opening and closing the ttys, you must have been unlucky and "fuser" checked just when the port was closed...

Quoted 2 lines

This is working now !!
Thanks everybody for support

Well, thanks to you, as there is no doubt this kind of information is useful for everybody. We can all be victims of those little processes launched without notice (usually at session startup time). Linux is becoming too complicated sometimes, haha ! :-)

Quoted 1 line

Let's go on the rock now (EME) !!!

Good luck ! Maybe we'll have the opportunity to make a QSO via moonbounce one day: I'm a member of F6KHM here in Brest, and we have a nice 10.30m dish, that we use for EME too. ;-)

Best regards,

Bruno - F8FIV
--
To unsubscribe from this list: send the line "unsubscribe linux-hams" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html