[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Serial Weather Station

Hi everybody,

I have a laptop at home which is an old dell latitude xpi p133 st. I use
it as a small server, running OpenBSD 3.7. I would like to have my weather
station connected to the laptop, serving the weather via http.

The weather station is a WS3600, racorded to the server via a serial cable.

The program I use to retrieve the info from the station is open3600

To make it work under openbsd, I edited /etc/ttys and changed the line :
tty00  "/usr/libexec/getty std.9600"   unknown off

to :
tty00   none                            network on local

As open3600 is not available in binary form for OpenBSD, I compiled it.
I then configured it to retrieve the info from /dev/tty00.

Now when I launch the retrieval of the information, the command takes 30
seconds before outputing the result.
Each time I execute the command, it takes about 30 seconds, and sometimes
the output is right, sometimes it is totally wrong, indicating 0 values.
I would say I have 50% chance to get the good parameters.

The problem is not hardware, because I tried the command under Debian on
the same machine, and it retrieves the information with no problem, in
less than 2 seconds.

I think the problem is the configuration of the serial port under OpenBSD,
but my knowledge in serial devices is rather limited.

I ran 'stty -af /dev/tty00' under OpenBSD and 'stty -aF /dev/ttyS0' under
Debian and see the modes are a bit differents, but I did not manage to
change modes under OpenBSD.

'stty -af /dev/tty00' under OpenBSD:

speed 9600 baud; 0 rows; 0 columns;
lflags: icanon isig iexten echo echoe -echok echoke -echonl echoctl
        -echoprt -altwerase -noflsh -tostop -flusho -pendin -nokerninfo
        -extproc -xcase
iflags: -istrip icrnl -inlcr -igncr -iuclc ixon -ixoff ixany imaxbel
        -ignbrk brkint -inpck -ignpar -parmrk
oflags: opost onlcr -ocrnl -onocr -onlret -olcuc oxtabs -onoeot
cflags: cread cs8 -parenb -parodd hupcl clocal -cstopb -crtscts -mdmbuf
cchars: discard = ^O; dsusp = ^Y; eof = ^D; eol = <undef>;
        eol2 = <undef>; erase = ^?; intr = ^C; kill = ^U; lnext = ^V;
        min = 1; quit = ^\; reprint = ^R; start = ^Q; status = <undef>;
        stop = ^S; susp = ^Z; time = 0; werase = ^W;

'stty -aF /dev/ttyS0' under Debian:

speed 9600 baud; rows 0; columns 0; line = 0;
intr = ^C; quit = ^\; erase = ^?; kill = ^U; eof = ^D; eol = <undef>; eol2
= <undef>; start = ^Q; stop = ^S; susp = ^Z; rprnt = ^R;
werase = ^W; lnext = ^V; flush = ^O; min = 1; time = 0;
-parenb -parodd cs8 hupcl -cstopb cread clocal -crtscts
-ignbrk -brkint -ignpar -parmrk -inpck -istrip -inlcr -igncr icrnl ixon
-ixoff -iuclc -ixany -imaxbel
opost -olcuc -ocrnl onlcr -onocr -onlret -ofill -ofdel nl0 cr0 tab0 bs0
vt0 ff0
isig icanon iexten echo echoe echok -echonl -noflsh -xcase -tostop
-echoprt echoctl echoke

I don't even know if the problem comes from here.

Any help, any reference, any advice is welcomed.

Thanks in advance and sorry for my english


Visit your host, monkey.org