Weather-Watch.com

Weather Display => WD Questions => Topic started by: raypfaff on June 05, 2019, 07:49:28 PM

Title: Weather Monitor II and wdisplay
Post by: raypfaff on June 05, 2019, 07:49:28 PM
Oldie but a goodie.  I have owned a Davis WMII since 1998.  Recently I've been concerned that the Windows 2000 that I have Weather Link on is probably going to die sooner than the WM, so I'm trying to migrate it to a newer linux laptop.  I've tried to run wdisplay, but it appears that I'm just getting '0' as data.  I can run picocom and send a 'LOOP' command and get data back, so I know I have connectivity.  I'm not sure if the unit is a pre-rev E or not, but I've tried it both ways.  Is there some sort of debug option?  The error log shows nothing.  A also tried to run consolewd, but that's apparently compiled for a 32 bit system and not 64. 
Title: Re: Weather Monitor II and wdisplay
Post by: Weather Display on June 05, 2019, 09:08:24 PM
is this the 64 bit Gui version of WD for linux?
I will need to check on my code for supporting the davis WII
(you are the first person I think to test)
there is a 64 bit version of consolewd
Title: Re: Weather Monitor II and wdisplay
Post by: Weather Display on June 05, 2019, 10:22:57 PM
I did find one bug re getting data from a Davis WMII
so try the latest update
Title: Re: Weather Monitor II and wdisplay
Post by: raypfaff on June 06, 2019, 01:30:51 PM
Thanks, yes this is the 64 bit version of WD for linux.  I'll check out the new version of wdisplay and look for the 64 bit version of consolewd.   I thought there was just the one for linux and that (judging from the readme) looks to be made for the Raspberry PI
Title: Re: Weather Monitor II and wdisplay
Post by: Weather Display on June 06, 2019, 07:07:03 PM
there is a 64 bit version of consolewd for the raspberry pi 3 and for a Linux 64 bit desktop
Title: Re: Weather Monitor II and wdisplay
Post by: raypfaff on June 07, 2019, 02:08:47 PM
Okay, two things.  I've downloaded the 64 bit versions of  wdisplay and consolewd.  When I run wdisplay, I get the same result as before which is nothing.  Previously I was getting '0' in the terminal window, now not even that.  When I look at the debug log, it says that I'm opening the com port, but nothing after that.
I tried consolewd because I thought I might get some other info, but I'm hitting a wall there.  I get:
[email protected]:~/consolewdfiles$ ./GoWdconsole.sh
/home/owner/consolewdfiles/deploy
/home/owner/consolewdfiles/consolewd: error while loading shared libraries: libcom.so: cannot open shared object file: No such file or directory
[email protected]:~/consolewdfiles$ ls /home/owner/consolewdfiles/deploy
libcom.so  libhid.so  liblunar.so  libusbdll.so

I modified the script to print out LD_LIBRARY_PATH so you can see that it's pointing to the deploy directory, but it's not finding the file.
I looked at the executable:

[email protected]:~/consolewdfiles$ ldd consolewd
   linux-gate.so.1 =>  (0xf7f47000)
   libm.so.6 => /lib/i386-linux-gnu/libm.so.6 (0xf7ecd000)
   libcom.so => ./deploy/libcom.so (0xf7ec9000)
   libusbdll.so => ./deploy/libusbdll.so (0xf7ec5000)
   liblunar.so => ./deploy/liblunar.so (0xf7c29000)
   libdl.so.2 => /lib/i386-linux-gnu/libdl.so.2 (0xf7c23000)
   libc.so.6 => /lib/i386-linux-gnu/libc.so.6 (0xf7a6d000)
   /lib/ld-linux.so.2 (0xf7f49000)
   libusb-0.1.so.4 => not found
   libhid.so.0 => not found


I copied libcom and libusbdll to /lib/i386-linux-gnu, but no luck. 

Are those two files perhaps statically linked?  I'm confused.  There is no libusb in deploy (I assume I'm supposed to apt-get that) and no libhid
Title: Re: Weather Monitor II and wdisplay
Post by: Weather Display on June 07, 2019, 07:53:55 PM
there is a readme with the consolewd
you need to copy the library files in the deploy folder to
/usr/lib/
/usr/local/lib/
using sudo cp
Title: Re: Weather Monitor II and wdisplay
Post by: raypfaff on June 08, 2019, 04:11:55 PM
Yeah, I read the readme.txt and copied them there, in /lib, and in /lib/i386-linux-gnu.  It doesn't pick them up from any of those locations.
Title: Re: Weather Monitor II and wdisplay
Post by: Weather Display on June 08, 2019, 06:50:00 PM
did you copy to /usr/local/
also try
/usr/local/bin/

but are you running the default rasberry pi OS?
or there might be a way to find out (i.e a command) where the default library seach path environement is your your setup
Title: Re: Weather Monitor II and wdisplay
Post by: raypfaff on June 08, 2019, 10:06:25 PM
I'm not running on a raspi, I'm using  consolewd64desktop.tar.gz, which should be for 64 bit desktops, right?  Anyway, I figured it out.  The problem is when you do a 'sudo consolewd' in the script.  That wipes away any changes you made to LD_LIBRARY_PATH.  If you just run './consolewd' it works... kinda;
Now to the next problem.  If you get beyond that point, you'll get an error for libusb.  It appears that the program is still 32 bit, so it will fail because libusb-dev installs the 64 bit versions of the library.  You can do this to fix that problem on ubuntu:
sudo apt-get install libusb-0.1-4:i386

Now I'm stuck with this error:
[email protected]:~/consolewdfiles$ ./consolewd
./consolewd: error while loading shared libraries: libhid.so.0: wrong ELF class: ELFCLASS64

That's because all I have are 64 bit x86 and ARM versions of this library (the later was from when I installed the wrong Raspi version.):

/usr/lib/libhid.so.0:       ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, BuildID[sha1]=918916164d292d242056269f94b3551f308d7b4c, not stripped
/usr/lib/libhid.so.0.0:   ELF 32-bit LSB shared object, ARM, EABI5 version 1 (SYSV), dynamically linked, BuildID[sha1]=106c85678eaf51586d8bfe8930f6aa2e274cd53f, not stripped

Does anyone have the 32 bit x86 version of this library or can tell me where the repo might be.  Doing an 'apt-get install libhid (libhid0,libhid-dev,libhid0-dev...)' show that there are no packages for it.  The 64 bit version's on my system, so something had to load it at some point.
Title: Re: Weather Monitor II and wdisplay
Post by: Weather Display on June 09, 2019, 05:18:45 AM
I will re check the code for the desktop gui 64 bit version too for Davis WMII
Title: Re: Weather Monitor II and wdisplay
Post by: raypfaff on June 14, 2019, 05:17:43 PM
I was able to find the source to lihid.so and tried to build a 32 bit version.  Unfortunately all I have is a 64 bit machine and when you do a 'configure' to build the makefiles, it assumes the architecture of the machine you're running on.  I've tried to force it to compile and load 32 bit, but I've had no luck.
If you have a x86_64 architecture available and can recompile your code so that consolewd64desktop.tar.gz has 64 bit rather than 32 bit binaries, that would be the far easier route.
Title: Re: Weather Monitor II and wdisplay
Post by: raypfaff on June 16, 2019, 08:03:36 PM
I was able to get the lihid library to compile.   I had to 'hand walk' the build by typing in the correct i386 library locations into the command that failed.  For some reason that I was never able to understand, it kept wanting to add a '-L/usr//lib/x64' into the linking rather than the 32 bit .  I had to install the 32 bit version of libusb.a, which removed my 64 bit version.  When I got the library built, I switched it back.  Anyway, I am getting data, but it;s not right:

Current data : Temperature= 30.2 Windspeed =0.0 Gustspeed =2.0 Direction =0 Humidity=100 Barometer=31.5 Daily Rain=0.0

Some of the data looks more or less right.  Temperature is wrong, even if it was Celsius (checked the config, it was not) and bounces between 30 and 80.  LIkewise Humidity bounces between 100 and something like 15
Title: Re: Weather Monitor II and wdisplay
Post by: Weather Display on June 16, 2019, 08:16:14 PM
its not clear what version you are now running to get data?
Title: Re: Weather Monitor II and wdisplay
Post by: raypfaff on June 17, 2019, 12:08:18 PM
consolewd64desktop.tar.gz
Listed on the site as "Weather Display for Linux console 64 bit Linux desktop Version on 27 May 2019 - 22:12:35"
Title: Re: Weather Monitor II and wdisplay
Post by: Weather Display on June 17, 2019, 07:11:24 PM
OK, so its working a bit..but getting out of sync by the sounds of it
I will check the code
and check on library files too
Title: Re: Weather Monitor II and wdisplay
Post by: Weather Display on June 18, 2019, 03:43:56 AM
re the 32/64 bit of the deploy files
using
objdump -f libcom.so | grep ^architecture

says its 64 bit (and same with all the other library files in the deploy folder
Title: Re: Weather Monitor II and wdisplay
Post by: raypfaff on June 18, 2019, 01:51:13 PM
That's at least not what I'm seeing:
[email protected]:~/consolewdfiles/deploy$ file libcom.so
libcom.so: ELF 32-bit LSB shared object, Intel 80386, version 1 (SYSV), dynamically linked, not stripped
[email protected]:~/consolewdfiles/deploy$ objdump -f libcom.so | grep ^architecture
architecture: i386, flags 0x00000150:
Title: Re: Weather Monitor II and wdisplay
Post by: raypfaff on June 18, 2019, 02:26:51 PM
Okay, redownloaded again and I concur that it's 64 bit and the libs are 64 bit.  it's running, but there still seems to be a couple of issues:

ser_read : Entering
ser_read error Resource temporarily unavailable
Read size -1 :
ser_read : Exiting
Write size 7 : 4c 4f 4f 50 ff ff 0d
ser_read : Entering
Read size 19 : 06 01 fe 02 25 03 00 5f 00 bb 4e 30 7b 4f 04 00 00 48 bc
ser_read : Exiting
*****Received count =  ----------------------------->  19
WMII Data OK
Current data 10:20:41: Temperature= 78.7 Windspeed =0.0 Gustspeed =0.0 Direction =95 Humidity=100 Barometer=29.9 Daily Rain=0.0  Rain Rate 0.0mm/min
ser_read : Entering
ser_read error Resource temporarily unavailable

The temperature is close at least, the monitor console shows 80.  The humidity is way off (45% on the consoe).  I'm not sure if the "error Resource temporarily Unavailable" is a feature of debug or not.  I'm getting a lot of them, but the code is writing and getting data back
Title: Re: Weather Monitor II and wdisplay
Post by: Weather Display on June 18, 2019, 07:03:38 PM
re the humidity
check what you have set as the humidity offset maybe in the config.txt?

I could add some debug code around that
Title: Re: Weather Monitor II and wdisplay
Post by: raypfaff on June 19, 2019, 05:29:11 PM
Nope.  No offset at all.  There's one for Barometric pressure (set to 0), but none for Humidity
Title: Re: Weather Monitor II and wdisplay
Post by: Weather Display on June 19, 2019, 07:25:31 PM
I will add some debug code...
Title: Re: Weather Monitor II and wdisplay
Post by: Weather Display on June 19, 2019, 07:53:37 PM
done that
try a new update download
Title: Re: Weather Monitor II and wdisplay
Post by: raypfaff on June 20, 2019, 01:15:35 PM
I don't really see any change:
er_read : Exiting
Write size 7 : 4c 4f 4f 50 ff ff 0d
ser_read : Entering
Read size 19 : 06 01 f5 02 1b 03 00 07 01 a8 4d 35 65 60 04 00 00 32 c5
ser_read : Exiting
*****Received count =  ----------------------------->  19
WMII Data OK
Current data 09:12:27: Temperature= 77.7 Windspeed =0.0 Gustspeed =0.0 Direction =263 Humidity=100 Barometer=29.9 Daily Rain=0.0  Rain Rate 0.0mm/min
ser_read : Entering
ser_read error Resource temporarily unavailable
Read size -1 :
ser_read : Exiting
Title: Re: Weather Monitor II and wdisplay
Post by: Weather Display on June 20, 2019, 06:35:13 PM
it should say in the debug window about the raw humidity
are you sure you have downloaded the latest consolewd64desktop version?
i.e check the modified date/time on the consolewd program to see if its like recent
Title: Re: Weather Monitor II and wdisplay
Post by: raypfaff on June 20, 2019, 08:10:36 PM
I downloaded the consolewd64desktop.tar.gz  that was changed yesterday and verified that the checksum is the same as what I'm running:
[email protected]:~/Downloads$ sum consolewdfiles/consolewd
52491  2010
[email protected]:~/Downloads$ cd ~/consolewdfiles
[email protected]:~/consolewdfiles$ sum consolewd
52491  2010
[email protected]:~/consolewdfiles$ ./consolewd | grep -i hum
Current data 16:07:06: Temperature= 87.4 Windspeed =0.0 Gustspeed =2.0 Direction =261 Humidity=66 Barometer=29.9 Daily Rain
Current data 16:08:18: Temperature= 87.4 Windspeed =2.0 Gustspeed =1.0 Direction =167 Humidity=65 Barometer=29.9 Daily Rain


Although now the humidity looks more or less right.  It was still reading 100 earlier.
Title: Re: Weather Monitor II and wdisplay
Post by: raypfaff on June 20, 2019, 08:11:41 PM
Let me let it run for a while and see if it's working now
Title: Re: Weather Monitor II and wdisplay
Post by: raypfaff on June 20, 2019, 08:15:06 PM
lol, posted too soon.  Now I'm getting weird results again.  If you called it something like "raw humidity", I should be seeing the line though

Current data 16:11:44: Temperature= 87.3 Windspeed =1.8 Gustspeed =1.0 Direction =0 Humidity=1 Barometer=29.9 Daily Rain=0.0  Rain Rate 0.0mm/min
Current data 16:12:05: Temperature= 87.3 Windspeed =1.3 Gustspeed =0.0 Direction =0 Humidity=100 Barometer=29.9 Daily Rain=0.0  Rain Rate 0.0mm/min
Read size 1 : 06 6:12:12: Temperature= 87.3 Windspeed =0.9 Gustspeed =80.0 Direction =0 Humidity=0 Barometer=29.9 Daily Rain=0.0  Rain Rate 0.0mm/min
Current data 16:12:46: Temperature= 87.4 Windspeed =80.0 Gustspeed =0.0 Direction =238 Humidity=67 Barometer=29.9 Daily Rain=0.0  Rain Rate 0.0mm/min
Current data 16:13:50: Temperature= 87.4 Windspeed =0.0 Gustspeed =1.0 Direction =0 Humidity=0 Barometer=29.9 Daily Rain=0.0  Rain Rate 0.0mm/min
Current data 16:14:03: Temperature= 87.4 Windspeed =0.4 Gustspeed =1.0 Direction =259 Humidity=67 Barometer=29.9 Da
Title: Re: Weather Monitor II and wdisplay
Post by: Weather Display on June 20, 2019, 09:07:07 PM
no need to look for it
it should be coming out in the console data
*debug outdoor hum

have you checked the actual modified date/time on the consolewd file
Title: Re: Weather Monitor II and wdisplay
Post by: raypfaff on June 21, 2019, 12:51:57 PM
2019 6 19 5:17
Title: Re: Weather Monitor II and wdisplay
Post by: Weather Display on June 21, 2019, 08:00:14 PM
that should be it
I will add more debug code
I used to have a davis wmii here
not easy when you dont have one
Title: Re: Weather Monitor II and wdisplay
Post by: raypfaff on June 21, 2019, 08:02:51 PM
Yeah, I understand.  It's funny that the station's been running just fine all these years.  I think I had to replace the external thermometer and humidity  sensor at one point and re-crimp some of the cables, but that's been it.
Title: Re: Weather Monitor II and wdisplay
Post by: Weather Display on June 21, 2019, 08:40:07 PM
try another download update...;)
Title: Re: Weather Monitor II and wdisplay
Post by: raypfaff on June 23, 2019, 01:26:53 PM
Looks to be working now.  Did you change any of the code or just add a debug in?
*debug outdoor hum 75
*debug outdoor hum after offset 75
Current data 09:22:52: Temperature= 70.9 Windspeed =0.0 Gustspeed =0.0 Direction =70 Humidity=75 Barometer=29.9 Daily R
*debug outdoor hum 75
*debug outdoor hum after offset 75
Current data 09:22:54: Temperature= 70.9 Windspeed =0.0 Gustspeed =0.0 Direction =70 Humidity=75 Ba
*debug outdoor hum 75
*debug outdoor hum after offset 75
Read size 1 : 06  Temperature= 70.9 Windspeed =0.0 Gustspeed =0.0 Direction =70 Humidity=75 Barometer=29.9 Daily Rain=0.0  Rain Rate 0.0mm/min
*debug outdoor hum 74
*debug outdoor hum after offset 74
Read size 18 : 01 eb 02 d7 02 00 46 00 a1 4f 31 4a 60 04 00 00 cb e9 ion =70 Humidity=74 Barometer=29.9 Daily Rain=0.0  Rain Rate 0.0mm/min
Title: Re: Weather Monitor II and wdisplay
Post by: Weather Display on June 23, 2019, 07:03:17 PM
no, but, I found where the problem was :)
Title: Re: Weather Monitor II and wdisplay
Post by: raypfaff on June 23, 2019, 10:31:40 PM
OK, great!  Thanks for the help!
Title: Re: Weather Monitor II and wdisplay
Post by: raypfaff on July 12, 2019, 12:15:24 PM
It took a while to get more than a trace of rain here, but it looks like the Daily total and rain rate are not working although all the other values look good.  At this point I'm running the console code in test mode.  The laptop is on battery power when it's connected to the serial port, so I can't leave it on 24 hours a day.  I'm wondering if perhaps I'm not running consolewd long enough?  Does the rain values come from the WMII or are they perhaps calculated?
Title: Re: Weather Monitor II and wdisplay
Post by: raypfaff on August 08, 2019, 03:09:50 PM
I finally got a decent rainstorm yesterday and I let consolewd run for an hour.  During this time, the screen on my Weather Monitor II showed .16 inches of accumulated rain.  Daily Rain and Rain Rate in consolewd both stayed at 0.  I'm not sure if Daily Rain is calculated over a 24 hour period, but surely the Rain Rate value should change over the course of an hour, right?
Title: Re: Weather Monitor II and wdisplay
Post by: Weather Display on August 08, 2019, 07:19:51 PM
HI
I will check on the code and I could add some debug code and you could run that?
Title: Re: Weather Monitor II and wdisplay
Post by: raypfaff on August 09, 2019, 01:03:28 AM
Sure, I can do that.
Title: Re: Weather Monitor II and wdisplay
Post by: Weather Display on August 10, 2019, 09:12:28 AM
i might have found an issue
try a new update (for consolewd for rapsberry pi 3)
Title: Re: Weather Monitor II and wdisplay
Post by: raypfaff on August 10, 2019, 01:06:30 PM
This is being run on a 64 bit Ubuntu system, not a Raspi
Title: Re: Weather Monitor II and wdisplay
Post by: Weather Display on August 10, 2019, 09:47:29 PM
ah
it was not very clear
I will make the change for that one and let you know
Title: Re: Weather Monitor II and wdisplay
Post by: Weather Display on August 11, 2019, 02:20:51 AM
try a new update...
Title: Re: Weather Monitor II and wdisplay
Post by: raypfaff on August 11, 2019, 12:27:42 PM
Okay, I'll give it a try.  We should have thunderstorms on Tuesday.  If not, I'll just pour some water into the rain gauge
Title: Re: Weather Monitor II and wdisplay
Post by: raypfaff on August 13, 2019, 10:09:12 PM
Well, this version isn't printing out any data.  I'm not sure if that's intentional or not.  I'm getting stuff like this:
*****Received count =  ----------------------------->  1
*****Received count =  ----------------------------->  18
ser_read error Resource temporarily unavailable
ser_read error Resource temporarily unavailable
ser_read error Resource temporarily unavailable
ser_read error Resource temporarily unavailable
*****Received count =  ----------------------------->  1
*****Received count =  ----------------------------->  9
decoding davis wizard/wmii data
*****Received count =  ----------------------------->  9
decoding davis wizard/wmii data
ser_read error Resource temporarily unavailable
ser_read error Resource temporarily unavailable
ser_read error Resource temporarily unavailable
*****Received count =  ----------------------------->  1
*****Received count =  ----------------------------->  18

Title: Re: Weather Monitor II and wdisplay
Post by: raypfaff on August 13, 2019, 10:14:30 PM
I spoke a little too soon.  Looks like when it gets 19 bytes of data it successfully decodes the data.  Still no rain though.  I poured a bunch of water into the gauge so it would register for a bit and I'm still getting this:
****Received count =  ----------------------------->  19
WMII Data OK
Current data 18:12:26: Temperature= 83.4 Windspeed =0.0 Gustspeed =0.0 Direction =116 Humidity=91 Barometer=29.9 Daily Rain=0.0  Rain Rate 0.0mm/min
Title: Re: Weather Monitor II and wdisplay
Post by: Weather Display on August 13, 2019, 10:24:03 PM
let me add some more debug code
Title: Re: Weather Monitor II and wdisplay
Post by: Weather Display on August 15, 2019, 05:08:02 AM
try a new update download..
Title: Re: Weather Monitor II and wdisplay
Post by: raypfaff on August 15, 2019, 07:15:35 PM
Looks like that got it.  I assume rain total is also supposed to be in mm?  The data I'm seeing makes sense if that;s the case:
MII Data OK
Current data 15:08:35: Temperature= 70.2 Windspeed =4.8 Gustspeed =1.0 Direction =143 Humidity=100 Barometer=29.9 Daily Rain=1.0  Rain Rate 0.1mm/min
ser_read error Resource temporarily unavailable
ser_read error Resource temporarily unavailable
Title: Re: Weather Monitor II and wdisplay
Post by: Weather Display on August 15, 2019, 09:06:00 PM
yes mm
good its OK now :)