[PLUG] Setting serial parameters
Denis Heidtmann
denish at dslnorthwest.net
Sun Apr 27 01:25:28 UTC 2008
Richard C. Steffens wrote:
>
> Do you have the source code? Perhaps you could search it for what it
> wants in the way of a serial port. I'm not a C programmer, but I can
> sort of follow what's going on when I read the file that has the code to
> access the serial port.
No source, and I cannot decipher it even if I had it. I downloaded your program
source, and found that it was Greek to me.
>
> If I ever re-compile it I'll just use /dev/ttyS0 for TTY. I have to
> re-create a sym link after every boot to get it to work. I finally
> figured out how to do that with an entry in /etc/init.d/boot.local
>
> # create a symlink for the X10 program
> ln -s /dev/ttyS0 /dev/ttyX10
>
> I suspect that is not particularly relevant to your program, but maybe
> it will trigger a thought.
>
The docs for my program mention the symlink to set the serial port, as well as
setting an environment variable X10_PORTNAME. I chose the latter. But here is
what I get with various settings:
parents at R2D2:~$ X10_PORTNAME=/dev/ttys0
parents at R2D2:~$ x10 -t
Could not access serial port /dev/ttys0
Please set environment variable X10_PORTNAME to proper serial device
or else make the appropriate soft link as superuser.
parents at R2D2:~$ X10_PORTNAME=/dev/ttys1
parents at R2D2:~$ x10 -t
Could not access serial port /dev/ttys1
Please set environment variable X10_PORTNAME to proper serial device
or else make the appropriate soft link as superuser.
parents at R2D2:~$ X10_PORTNAME=/dev/ttyS0
parents at R2D2:~$ x10 -t
Performing self-test (This will take about 10 seconds)
Sorry, something is wrong
parents at R2D2:~$ X10_PORTNAME=/dev/ttyS1
parents at R2D2:~$ x10 -t
Performing self-test (This will take about 10 seconds)
This last required a ^c to force a termination.
I note that setserial tells me that only ttyS0 and ttyS1 are valid:
parents at R2D2:~$ setserial /dev/ttyS0 -a
/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
parents at R2D2:~$ setserial /dev/ttyS1 -a
/dev/ttyS1, Line 1, UART: 16550A, Port: 0x02f8, IRQ: 3
Baud_base: 115200, close_delay: 50, divisor: 0
closing_wait: 3000
Flags: spd_normal skip_test
parents at R2D2:~$ setserial /dev/ttys0 -a
/dev/ttys0: Input/output error
parents at R2D2:~$ setserial /dev/ttys1 -a
/dev/ttys1: Input/output error
parents at R2D2:~$ setserial /dev/ttyS2 -a
/dev/ttyS2, Line 2, UART: unknown, Port: 0x03e8, IRQ: 4
Baud_base: 115200, close_delay: 50, divisor: 0
closing_wait: 3000
Flags: spd_normal skip_test
Does this info give anybody here some ideas which might help me?
-Denis
More information about the PLUG
mailing list