I've spent a while debugging wview with my WMR918 station, and I've
discovered some interesting behavior. It's a bit of a long story, so
bear with me. First, I noticed that I got these "WIND packet..." type
messages in my /var/log/messages file all the time. They were driving
me nuts. I tried to turn them off through the verbosity setting in
the configuration, but that didn't work. I even tried sending SIGHUP
to the wviewd process, and that didn't work either. While I was doing
all this debugging, I noticed that wviewd never gracefully shutdown,
to the point that I added a test to the init script to test if it
still hadn't shutdown and if it didn't it would kill the process and
remove the pid file. I did some digging in the source and discovered
that the WMR918 initialization doesn't finish until it's seen a packet
from each of the rain, wind, internal and external sensors.
Apparently, my external sensor isn't being processed properly as an
"external temperature sensor" (which I'll get to in a bit) so it never
finishes. During the initialization it prints those packet messages
regardless of your setting. I modified the source in wmr918protocol.c
so that during the init process it only posts a message to /var/log/
messages the first time it receives a given protocol type, and prints
the ones it's still waiting for. Also, in the while loop, it checks
if the shutdown message has been received. If it has, it allows the
process to gracefully terminate. The patch is in the files section
(it should work with 5.4.0):
http://groups.google.com/group/wview/web/wmr918patch.diff
About the external temperature sensor, I had written a program that
decodes the wmr918 protocol, and I noticed that my station does
provide a external temperature packet, it isn't the exact one that
this code is expecting. My station is providing the thermohygrometer
reading, not the thermohygrobarometer reading it's expecting. If
someone knows the architecture of this part of the application pretty
well, help would be very much appreciated. I don't quite have the
time to learn all the ins-and-outs of how that code works right now.
I can provide raw serial capture data and a good protocol reference if
it helps. Even if you can give me some pointers on the architecture
of the code, it would help.
Thanks!
hpux735