cloudy cloudy

Author Topic: 1-wire reader & laser sensor  (Read 2793 times)

0 Members and 1 Guest are viewing this topic.

Offline Weather Display

  • Posts: 82,687
  • Davis VP2
  • New Zealand
  • OS/Browser:
  • Win NT 10.0
  • Chrome 62.0.3202.94
    • Weather Display
Re: 1-wire reader & laser sensor
« Reply #105 on: December 07, 2017, 08:28:49 PM »
maybe I can get cronlazer snow to do the actual sample (i.e send the command to go that) at the time freq you set
(assuming I can get sending a command to do that to work)

Offline Weather Display

  • Posts: 82,687
  • Davis VP2
  • New Zealand
  • OS/Browser:
  • Win NT 10.0
  • Chrome 62.0.3202.94
    • Weather Display
Re: 1-wire reader & laser sensor
« Reply #106 on: December 07, 2017, 09:29:47 PM »
the is from the source code
// Turn on the laser 10 seconds prior to the goal time
      if (TicksNow >= (TicksGoal-10)) {
         if ((ConfigValue & 0x0000008) == 0) {
            // Write the rangefinder's configuration (writes it from ConfigValue global variable)
            ConfigValue |= 0x00000008;      //Set the Single mode bit
            if (SetConfiguration() == FALSE) {
               printf ("Error: Could not write configuration to the rangefinder device.\n");
               goto ExitFromApp;
            }
         }
      }

      // If we are past the goal time, then trigger a measurement
      if (TicksNow >= TicksGoal) {
         TicksGoal = TicksGoal + Interval;  // Calculate the next goal time

         // Write the rangefinder's configuration (writes it from ConfigValue global variable)
         ConfigValue |= 0x00008000;      //Set the Run bit to trigger the measurement
         if (SetConfiguration() == FALSE) {
            printf ("Error: Could not write configuration to the rangefinder device.\n");
            goto ExitFromApp;
         }
      }


BOOLEAN SetConfiguration (void)
{
   UCHAR CmdBuf[8];

   CmdBuf[0] = CMD_SET_CONFIG;
   CmdBuf[1] = (UCHAR)(ConfigValue);
   CmdBuf[2] = (UCHAR)(ConfigValue >> 8);
   CmdBuf[3] = (UCHAR)(ConfigValue >> 16);
   CmdBuf[4] = (UCHAR)(ConfigValue >> 24);
   CmdBuf[5] = 0;
   CmdBuf[6] = 0;
   CmdBuf[7] = 0;

   return DYNCALL(writeData)(&CmdBuf[0]);
}

i,e its turning on some bits

I should be able to get cronlazersnow to do this
will need to be tested

Offline mikeym

  • Posts: 1,209
  • Thornhurst, Pa USA
  • OS/Browser:
  • Win 7/Srvr 2008R2
  • Firefox 57.0
    • MikeyMs Thornhurst,PA Weather
Re: 1-wire reader & laser sensor
« Reply #107 on: December 07, 2017, 10:37:05 PM »
Brian

That would be awesome. Breezy and I did some testing, but it was inconclusive with B61 whether it's correctly recording the additional snowfall. I have to take a break for dinner, but I'll do further testing later tonight. Cronlazersnow is working perfectly, it's just whether WD is seeing the input from cronlazersnow. I'm assuming you have to head to school soon. Have fun!

 :D

MikeyM
http://mikeymsweather.com/

Another VERY Happy WD user
Shuttle XS36v4 8 GB RAM
Davis Vantage Pro 2 wireless w/ Davis solar sensor
Laser Snow Depth Sensor LR4/Fluke 414D working in WD thanks to Brian

Offline Weather Display

  • Posts: 82,687
  • Davis VP2
  • New Zealand
  • OS/Browser:
  • Win NT 10.0
  • Chrome 62.0.3202.94
    • Weather Display
Re: 1-wire reader & laser sensor
« Reply #108 on: December 08, 2017, 01:43:20 AM »
new update
http://www.weather-display.com/downloadfiles/cronlazersnow.zip

I have added button to try and trigger a reading
got no idea if will work

Offline mikeym

  • Posts: 1,209
  • Thornhurst, Pa USA
  • OS/Browser:
  • Win 7/Srvr 2008R2
  • Firefox 57.0
    • MikeyMs Thornhurst,PA Weather
Re: 1-wire reader & laser sensor
« Reply #109 on: December 08, 2017, 02:20:26 AM »
Brian

This what I get when I run the new version and it the "get reading" button.  I did it twice which is why there 2 readings.
« Last Edit: December 08, 2017, 02:45:00 AM by mikeym »
http://mikeymsweather.com/

Another VERY Happy WD user
Shuttle XS36v4 8 GB RAM
Davis Vantage Pro 2 wireless w/ Davis solar sensor
Laser Snow Depth Sensor LR4/Fluke 414D working in WD thanks to Brian

Offline Weather Display

  • Posts: 82,687
  • Davis VP2
  • New Zealand
  • OS/Browser:
  • Win NT 10.0
  • Chrome 62.0.3202.94
    • Weather Display
Re: 1-wire reader & laser sensor
« Reply #110 on: December 08, 2017, 02:50:01 AM »
I am using the original hid component to send the commands (easier)
looks like no new reading was triggered
I will see if I can figure out how to send data using the  new HID component

Offline Weather Display

  • Posts: 82,687
  • Davis VP2
  • New Zealand
  • OS/Browser:
  • Win NT 10.0
  • Chrome 62.0.3202.94
    • Weather Display
Re: 1-wire reader & laser sensor
« Reply #111 on: December 08, 2017, 03:22:15 AM »
new update ready to test re the trigger a data read

Offline mikeym

  • Posts: 1,209
  • Thornhurst, Pa USA
  • OS/Browser:
  • Win 7/Srvr 2008R2
  • Firefox 57.0
    • MikeyMs Thornhurst,PA Weather
Re: 1-wire reader & laser sensor
« Reply #112 on: December 08, 2017, 04:08:48 AM »
Brian

Here's the last test. I did hit the "get reading" button several times. I'm heading to bed. Hope you had a good day with the family!

Cheers

MikeyM
http://mikeymsweather.com/

Another VERY Happy WD user
Shuttle XS36v4 8 GB RAM
Davis Vantage Pro 2 wireless w/ Davis solar sensor
Laser Snow Depth Sensor LR4/Fluke 414D working in WD thanks to Brian

Offline Weather Display

  • Posts: 82,687
  • Davis VP2
  • New Zealand
  • OS/Browser:
  • Win NT 10.0
  • Chrome 62.0.3202.94
    • Weather Display
Re: 1-wire reader & laser sensor
« Reply #113 on: December 08, 2017, 07:54:02 AM »
that is not working
but I cam compile the LRTimelog
and so make that program run, trigger a reading, and exit (ie get cronlazersnow to run that program at set intervals)

Offline schwab

  • Posts: 39
  • OS/Browser:
  • Win 7/Srvr 2008R2
  • Chrome 63.0.3239.84
Re: 1-wire reader & laser sensor
« Reply #114 on: December 08, 2017, 12:34:13 PM »
V1.9 is worked for me overnight after opening LRTimelog and starting it to record snow depths every 6 minutes (360 seconds) 

I'm looking forward to the next steps as to how to update WD and eventually upload the V1.9 data to my website.

Thank you so much.

Offline Breezy

  • Indian Trail Weather
  • Posts: 263
  • Hessville, NY, U.S.A.
    • baldwinj1
  • OS/Browser:
  • Win 7/Srvr 2008R2
  • Firefox 57.0
    • Indian Trail Weather
Re: 1-wire reader & laser sensor
« Reply #115 on: December 08, 2017, 02:23:11 PM »
Brian,

Mike asked me to tell you that he had to go shopping this morning. He'll be back to continue testing around 2:30 p.m. our time (EST) or 8:30 a.m. your time.

Thanks for your continuing work and progress! Much appreciated!

Jeff
Jeff

W7-64, Intel Z170A 16 GB RAM
Davis VP2 Plus & Soil Moisture/Temp Sensors, Laser Snow Sensor LR4/Fluke 414D, 4 Webcams

Offline Weather Display

  • Posts: 82,687
  • Davis VP2
  • New Zealand
  • OS/Browser:
  • Win NT 10.0
  • Chrome 62.0.3202.94
    • Weather Display
Re: 1-wire reader & laser sensor
« Reply #116 on: December 08, 2017, 05:22:58 PM »
@schwab
re getting WD to use the snow data
use the latest .zip update
and in setup, advanced/misc, snow section, tick enable for the lazer snow and tick to use the cronlazer snow
and set your needed offset too (you can do that in the cron lazer snow)
and then make sure WD is getting live data from your weather station (or at least set to stationless mode)
and then try adding some fake snow to test?

Offline Weather Display

  • Posts: 82,687
  • Davis VP2
  • New Zealand
  • OS/Browser:
  • Win NT 10.0
  • Chrome 62.0.3202.94
    • Weather Display
Re: 1-wire reader & laser sensor
« Reply #117 on: December 08, 2017, 05:45:16 PM »
I have re compile the LRTimelog.exe
(and renamed it as LRTimelogtest.exe)
download
http://www.weather-display.com/downloadfiles/lrtest.zip

run that (double click) and see if it triggers a reading in a runing cronlazersnow.exe

the idea is that I get cronlazersnow to run this program and a user selectable interval

Offline mikeym

  • Posts: 1,209
  • Thornhurst, Pa USA
  • OS/Browser:
  • Win 7/Srvr 2008R2
  • Firefox 57.0
    • MikeyMs Thornhurst,PA Weather
Re: 1-wire reader & laser sensor
« Reply #118 on: December 08, 2017, 08:24:04 PM »
Brian

The LRTimeLogtest.exe does trigger a reading, but if cronlazersnow is running before LRTimelog that it produces an erroneous reading in cronlazersnow. Also the interval you have have set in LRTimeLogtest is 30 sec and the reading has to be 60 sec or greater otherwise LRTimelog quits. So it works but only takes 1 reading which is an erroneous depth.
MikeyM
http://mikeymsweather.com/

Another VERY Happy WD user
Shuttle XS36v4 8 GB RAM
Davis Vantage Pro 2 wireless w/ Davis solar sensor
Laser Snow Depth Sensor LR4/Fluke 414D working in WD thanks to Brian

Offline Weather Display

  • Posts: 82,687
  • Davis VP2
  • New Zealand
  • OS/Browser:
  • Win NT 10.0
  • Chrome 62.0.3202.94
    • Weather Display
Re: 1-wire reader & laser sensor
« Reply #119 on: December 08, 2017, 08:42:22 PM »
yeah I hard coded the reading interval
but in the code it does say 30 seconds or longer
what I have done in the code to trigger one reading is added to sleep 10 seconds after turning on the lazer before requesting a reading
I see that that LTtimelog does then look to get a reading back ,...then after that sets the lazer back to sleep and then it should exit...yes?
does the reading it get back look ok? (maybe I can make it report to the terminal instead of to a log)