Page 1 of 1

[SOLVED] Serial port

PostPosted: Apr 27th, '12, 22:25
by bkv1958
Hi

I need to use the serial port on my Dell Latitude D630, but the application can't find it. Neither can I find it in the hardware section of Mageia Control Center. do you know what the problem is?

Thanks.

Re: Serial port

PostPosted: Apr 28th, '12, 17:37
by doktor5000

Re: Serial port

PostPosted: Apr 28th, '12, 22:18
by bkv1958
doktor5000 wrote:Maybe you want to have a look at http://www.cyberciti.biz/faq/find-out-l ... setserial/ ?

Thanks,
I get this out

Code: Select all
/dev/ttyS0, UART: 16550A, Port: 0x03f8, IRQ: 4


Still, my application says there is no serial port.

Re: Serial port

PostPosted: Apr 29th, '12, 04:17
by Ken-Bergen
bkv1958 wrote:Still, my application says there is no serial port.
Perhaps telling us what the application is would help, or is that top secret?

Re: Serial port

PostPosted: Apr 29th, '12, 11:06
by bkv1958
Ken-Bergen wrote:
bkv1958 wrote:Still, my application says there is no serial port.
Perhaps telling us what the application is would help, or is that top secret?


No it is not secret :) It is JMRI, a java application. http://jmri.sourceforge.net/

I had also expected to see the serial port in the hardware section of the control center.

Re: Serial port

PostPosted: Apr 29th, '12, 12:12
by djennings
Take a look at the permissions of /dev/ttyS0 Maybe your user does not have permission to access it.
Code: Select all
ls -l /dev/ttyS0

Re: Serial port

PostPosted: Apr 29th, '12, 12:52
by bkv1958
I get this:
crw-rw---- 1 root dialout 4, 64 Apr 29 11:00 /dev/ttyS0

Re: Serial port

PostPosted: Apr 29th, '12, 14:14
by djennings
bkv1958 wrote:I get this:
crw-rw---- 1 root dialout 4, 64 Apr 29 11:00 /dev/ttyS0


There is your problem. The port is owned by root and members of the group dialout can access it, but others cannot.
The solution is to open MageiaControlCentre>System>Users>Groups and edit the group dialout to add yourself as a member.

Re: Serial port

PostPosted: Apr 29th, '12, 16:59
by bkv1958
still no luck. Is there an other program which I could try, that would look for serial ports?

Re: Serial port

PostPosted: Apr 29th, '12, 19:26
by djennings
Tp test a serial port
http://www.cyberciti.biz/faq/find-out-linux-serial-ports-with-setserial/
setserial is in the setserial package. You may need to install it

To confirm you are a member of the dialout group
Code: Select all
more /etc/groups | grep dialout

Re: Serial port

PostPosted: Apr 29th, '12, 19:55
by bkv1958
This is what I get

Code: Select all
[bjorn@localhost rsync]$ setserial -a /dev/ttyS0
/dev/ttyS0, Line 0, UART: 16550A, Port: 0x03f8, IRQ: 4
        Baud_base: 115200, close_delay: 50, divisor: 0
        closing_wait: 3000
        Flags: spd_normal skip_test


more /etc/group | grep dialout
dialout:x:83:bjorn


Re: Serial port

PostPosted: Apr 30th, '12, 08:39
by juergen_harms
In case your problem is not yet sorted out:

- If you launch your application by clicking a menu or desktop item, you should look what happens if you launch it from a command line in a shell console - the application might print valuable information to its standard or error output that might contain helpful information

- Many tty applications use the /var/lock/tty directory for creating lock files that prevent several applications using the tty port in an uncoordinated way. Mageia does not create that directory by default (and I do not know whether your applications really needs it - is there documentation, for instance in a README file?). Nevertheless, may be worth while to try to create one if problems persist; you do that from a shell console and with root privileges:
    mkdir /var/lock/tty
    chgrp dialout /var/lock/tty
    chmod g+w /var/lock/tty
will create such a directory (and does not do any harm). Sorry for this "preventive dump" - I dont regularly visit this forum

Re: Serial port

PostPosted: Apr 30th, '12, 14:38
by djennings
bkv1958 wrote:This is what I get

Code: Select all
[bjorn@localhost rsync]$ setserial -a /dev/ttyS0
/dev/ttyS0, Line 0, UART: 16550A, Port: 0x03f8, IRQ: 4
        Baud_base: 115200, close_delay: 50, divisor: 0
        closing_wait: 3000
        Flags: spd_normal skip_test


more /etc/group | grep dialout
dialout:x:83:bjorn


That looks like it is working to me.
To confirm operation you can use minicom to output characters to the port and receive responses assuming you know how to control whatever is on the other end. There is a minicom package in Mageia.
http://en.wikipedia.org/wiki/Minicom

[Solved]Re: Serial port

PostPosted: May 6th, '12, 18:20
by bkv1958
Thanks, I got it to work. Must say, I am no quite certain what did the trick. At least I learned something abount dealing with serial ports, thanks