Serial port failure

Asked by SV1CDN

Hello all!
Using Ubuntu 8.10 and Wine 1.0.1
Been using Wine since Ubuntu 7.10 and run a windows application with serial port I/O fine. Yeasterday I noticed that my application was not receiving data I/O from serial device, but it could very well send serial I/O data to the device.
So I tried to setup again the application. This time my windows application saw no serial port present. I forced it to COM1 yet it has stopped working at all!
Tested serial port with Ubuntu software, working fine. Tested with Windows 2000 (dual boot) working fine. Made a symbolic link at ~/.wine/dosdevices to my ttyS0 but still problem. Never had to make a link though! Ubuntu dmesg reports serial ports fine.
What went wrong? Any idea from you gurus?
Take care.
Dennis.

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu wine Edit question
Assignee:
No assignee Edit question
Solved by:
SV1CDN
Solved:
Last query:
Last reply:

This question was originally filed as bug #348971.

Revision history for this message
Chris Coulson (chrisccoulson) said :
#1

Thank you for taking the time to report this issue and helping to make Ubuntu better. Examining the information you have given us, this does not appear to be a bug report so we are closing it and converting it to a question in the support tracker. We appreciate the difficulties you are facing, but it would make more sense to raise problems you are having in the support tracker at https://answers.launchpad.net/ubuntu if you are uncertain if they are bugs. For help on reporting bugs, see https://help.ubuntu.com/community/ReportingBugs .

Revision history for this message
SV1CDN (sv1cdn) said :
#2

Further info, Ubuntu has all the latest upgrades!

Revision history for this message
SV1CDN (sv1cdn) said :
#3

Quote from winehq.org fellow Martin helped me a lot!

The following has been tested for Fedora 8 but should also work with any
Linux distro that uses udev to manage devices or runs the contents of
the /etc/rc.d/rc.local script during the boot process.

The problem was that the standard serial ports /dev/ttyS* and the USB
serial ports /dev/ttyUSB* are owned by root and by default only give
read and write access to their owner and the 'uucp' group. This means
that a normal user can't run programs that access them.

I know two solutions:

1) The kludge. Add the command

chmod uga+rw /dev/tty[A-Z]*

into /etc/rd.d/rc.local

By default this script is run as part of the boot process
but contains nothing except comments saying when it is run
and what it is for.

2) A cleaner solution. Add an overriding rule to the UDEV rules set.
These are run at boot time to set up the device files in /dev.
Add the following file to /etc/udev/rules.d and make sure it is
owned by root.root and has "rw-r--r--" permissions. Here's the file:

=========== /etc/udev/rules.d/51-local.rules ==========================
#
# Locally defined rules.
#

#
# Give world read/write access to ttyS* and ttyUSB* serial devices
#
KERNEL=="tty[A-Z]*", GROUP="uucp", MODE="0666"

=======================================================================

You may need to change the file name, which must not overwrite or
modify an existing file and MUST follow the file containing a
rule that sets the serial ports mode to "0660". Run

grep 'KERNEL=="tty[A-Z]*"' /etc/udev/rules.d/*

to check which file that is. In my system its in
/etc/udev/rules.d/50-udev-default.rules but other distros may differ.
Your new file must start with a number that's higher than that of the
file containing the default rule.

Martin