views:

494

answers:

3

Hello,

I am currently running Ubuntu 8.10 and have been trying to use Open2300 to read data from a Lacrosse WS-2310 weather station and report it to the WUnderground server. The program compiles fine but when I try to run it, it does one of two things: usually it pauses for about 4 minutes, then prints "could not reset" to the screen. But sometimes it just hangs forever. It seems like my computer is unable to communicate with the weather station.

I have set the serial port as /dev/ttyS0 in the open2300.conf file and i have also tried /dev/ttyS1, /dev/ttyS2, etc with the same result. As far as I can tell, there are no other settings regarding how Open2300 communicates with the device. Is my serial port locked somehow?

It could be something as simple as an incorrect configuration for my serial port or something, but I would have no idea how to check that or change the configuration. Any help would be greatly appreciated.

thanks,
Gawain

EDIT: I tried some tests that i found online and everything seems to be working with my serial port...

gawain@gawain:~$ ls -l /dev/ttyS*
crw-rw---- 1 root dialout 4, 64 2009-07-09 10:01 /dev/ttyS0
crw-rw---- 1 root dialout 4, 65 2009-07-09 08:56 /dev/ttyS1
crw-rw---- 1 root dialout 4, 66 2009-07-09 08:56 /dev/ttyS2
crw-rw---- 1 root dialout 4, 67 2009-07-09 08:56 /dev/ttyS3

gawain@gawain:~$ 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


gawain@gawain:~$ setserial -g /dev/ttyS*
/dev/ttyS0, UART: 16550A, Port: 0x03f8, IRQ: 4
/dev/ttyS1, UART: 8250, Port: 0xd028, IRQ: 18
/dev/ttyS2, UART: 8250, Port: 0xd040, IRQ: 18
/dev/ttyS3, UART: 8250, Port: 0xd050, IRQ: 18

gawain@gawain:~$ echo 12345 > /dev/ttyS0

gawain@gawain:~$ dmesg | tail -3
[  144.424259] ppdev0: unregistered pardevice
[  145.692199] ppdev0: registered pardevice
[  145.740052] ppdev0: unregistered pardevice

I also tried changing the serial port name to /dev/ttys0 (with a lowercase S) and in that case it gave me a different error, "Unable to open serial device." This suggests to me that it is able to open /dev/ttyS0 but something else is preventing it from reading the weather station. Any ideas? thanks.

A: 

I got the same problem.

There seems to be a problem with the serial ports and Ubuntu 9.04.

A: 

Check if it is not a rights issue:

  • Run with "sudo mysql230"
  • Add yourself to the dialout group

Try using sudo minicom to play around with your ports to see if you have some responses...

That's my 2 cents hints ;)

Derick
A: 

From things You wrote, it seems that you have serial port at 115200 baud, while WS230x0 does the magic at 2400baud. Test it.

Yes, some time communication lasts really long, if You RTFM, you'll find that serial communication is lowest priority task for ws2300, so use commands that "talk less" like log2300 for example.

WS2300 uses strange 4-wire connection to serial port, so You might be stuck with not-so-standard-serial port on your pc, but that is wild guess.