在 Ubuntu 上使用 open2300
我目前正在运行 Ubuntu 8.10,并一直在尝试使用 Open2300从 Lacrosse WS-2310 气象站读取数据并将其报告给 WUnderground 服务器。 该程序编译得很好,但当我尝试运行它时,它会执行以下两件事之一:通常会暂停大约 4 分钟,然后在屏幕上打印“无法重置”。 但有时它会永远挂起。 我的计算机似乎无法与气象站通信。
我已在 open2300.conf 文件中将串行端口设置为 /dev/ttyS0,并且还尝试了 /dev/ttyS1、/dev/ttyS2 等,结果相同。 据我所知,没有关于 Open2300 如何与设备通信的其他设置。 我的串行端口是否被锁定?
这可能是简单的事情,比如我的串口配置不正确或其他什么,但我不知道如何检查或更改配置。 任何帮助将不胜感激。
谢谢,
高文
编辑: 我尝试了一些在网上找到的测试,一切似乎都适用于我的串行端口...
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
我还尝试将串行端口名称更改为 /dev/ttys0 (带有小写的 S),在这种情况下,它给了我一个不同的错误,“无法打开串行设备。” 这对我来说表明它能够打开 /dev/ttyS0 但其他东西阻止它读取气象站。 有任何想法吗? 谢谢。
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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
检查它是否不是权限问题:
尝试使用 sudo minicom 来玩弄你的端口,看看你是否有一些响应...
这是我的 2 美分提示;)
Check if it is not a rights issue:
Try using sudo minicom to play around with your ports to see if you have some responses...
That's my 2 cents hints ;)
从你写的东西来看,你的串行端口似乎是 115200 波特,而 WS230x0 在 2400 波特上发挥了作用。 测试一下。
是的,有时通信会持续很长时间,如果您使用 RTFM,您会发现串行通信对于 ws2300 来说是最低优先级的任务,因此请使用“少说话”的命令,例如 log2300。
WS2300 使用奇怪的 4 线连接到串行端口,因此您可能会被电脑上不那么标准的串行端口所困扰,但这是疯狂的猜测。
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.