cloudy

Author Topic: testtags with wdconsole  (Read 2206 times)

0 Members and 1 Guest are viewing this topic.

Offline Taliesin

  • Posts: 20
testtags with wdconsole
« on: March 12, 2009, 03:26:15 PM »
Hi,

I have been running the console version as my mini itx pc copes with it better and it is chatting away nicely uploading wx.html to my site. I came across the Saratoga templates and have tried implementing them. All is good apart from a the moonphase sunrise and sun set. I have read a number of threads and I believe I need to get a testtags.txt and trends-inc.txt to convert to a .php and .html respectively. The only instructions I can find are for WD with a GUI, what I do not understand is the custom tags for moonphase and sun rise/set work in my wx.html but are not extracted from the clientraw.txt by the template.

Is it just that the information does not appear the clientraw.txt?  or is there another way to produce the testtags.php??

Am I looking at this arse about face - if some one can set me on the right path it would be greatly appreciated.


Huw

Offline Taliesin

  • Posts: 20
Re: testtags with wdconsole
« Reply #1 on: March 12, 2009, 04:42:35 PM »
Ok found this, just to help those who are searching

   
Re: Need help with Saratoga-Weather templates...
« Reply #10 on: August 12, 2008, 08:58:37 PM »
   Reply with quoteQuote
Hi Brian, yes it is! How do I set up consolewd to create the testtags.php?

It's the last piece of the jigsaw...

Mike
   


windy
Brian
Climate Controller
   
   
Re: Need help with Saratoga-Weather templates...
« Reply #11 on: August 12, 2008, 10:35:58 PM »
   Reply with quoteQuote
in the config.txt
Create custom file=Y
needs to be set
then have a file called wxlocal.html with the custom tags in it
then a file called wx.html is created, with the custom tags replaced
also set,
Use this filename instead of wx.html=
and put testtags.php there




Offline Weather Display

  • Posts: 65,573
Re: testtags with wdconsole
« Reply #2 on: March 12, 2009, 06:51:56 PM »
but you have posted the solution

Offline Taliesin

  • Posts: 20
Re: testtags with wdconsole
« Reply #3 on: March 17, 2009, 08:17:34 AM »
I posted an answer I found much later - I am sorry for that but I wanted to help others searching the topic to find the solution easily.

I have had the chance to implement the solution now. I have a setting in the config:

Create custom file=Y   //converts the custom tags in a file called wxlocal.html to wx.html (or wxlocal2.html to wx2.html, up to wxlocal5.html (file needs to be where consolewd is))
custom log out=
Use this filename instead of wx.html=testtags.php (I have taken the testtags.txt from the webfiles in the template and renamed wxlocal.html in the root of consolewd)
Use this filename instead of wx2.html=index.php (I have my own small custom page I have been using as a control wxlocal2.html in the consolewd root)
Use this filename instead of wx3.html=
Use this filename instead of wx4.html=
Use this filename instead of wx5.html=
do custom log=N  // set to Y to create an appended logfile from a template (customlog.txt)
FTP the custom file=Y    //will FTP the wx.html or filename you set to FTP server specified (clientraw FTP needs to be enabled too)

The results I can see populate most of the custom tags in the template (apart from Alamac and Moon) but as far as I can see testtags.php is not uploaded - is that correct?
Also when I do cronftp it uploads all the clientraw files and wx.html - is it possible to upload wx2.html if so what setting do I need to change?

Thanks in advance

Offline pablo

  • Posts: 492
Re: testtags with wdconsole
« Reply #4 on: March 18, 2009, 08:31:50 PM »
Hi,

Due to limitations of `wdconsole', I've written custom shell/sed/named pipes to massage the client*.txt data so `wxlocal.html' is somewhat generated correctly.

My WMR-100 blew up Dec 18th, 2008 and I just found out Oregon Scientific messed up and forgot to send me a replacement.  It's on its way ... yeah right!  :) ... so my site is down/stale.
pablo
WMR-100

Offline Taliesin

  • Posts: 20
Re: testtags with wdconsole
« Reply #5 on: March 29, 2009, 06:02:04 AM »
Just an update the fix after a period stops showing the information shown in the wx.html file. The file generated in the wx.html file is correct but the page is fixed on a previous input.

Offline Taliesin

  • Posts: 20
Re: testtags with wdconsole
« Reply #6 on: September 28, 2009, 07:19:07 PM »
Ok this is for any one stuck with Saratoga templates and consolewd and is getting the error that contains unexpected T_DNUMBER testtags.php on line 252. If you work backwards and find the same lines in wxlocal.html - delete the comments corresponding to the next couple of lines. It seems the conversion to testtags.php by consolewd includes some of the characters in the comments and is screws up the conversion - it ends up ommitting "; / off the next line. I found this before and forgot the solution so just wasted another couple of hours finding it again, so I suppose it is for me too:).

Offline Weather Display

  • Posts: 65,573
Re: testtags with wdconsole
« Reply #7 on: September 28, 2009, 07:27:07 PM »
which particular custom tags?

Offline Taliesin

  • Posts: 20
Re: testtags with wdconsole
« Reply #8 on: September 28, 2009, 07:40:02 PM »
$currentrainratehr = "%currentrainratehr%";   // Current rain rate, mm/hr (or in./hr)

$maxrainrate = "%maxrainrate%";   // Max rain rate,for the day, mm/min (or in./min)

$maxrainratehr = "%maxrainratehr%";   // Max rain rate,for the day, mm/hr (or in.mm)


After I deleted the comments on there 3 - no problems.

Offline Taliesin

  • Posts: 20
Re: testtags with wdconsole
« Reply #9 on: September 28, 2009, 08:27:15 PM »
noted too soon - problem is continuing, the symptoms are


Parse error: syntax error, unexpected T_DNUMBER in /www/wd/testtags.php on line 252

which read

$dayswithrain = "0";   // Days with rain for the month
$dayswithrainyear = "%dayswithrainyear%";   // Days with rain for the year
$currentrainratehr = "0.0in rate, mm/hr (or in./hr)
$maxrainrate = "0.0";   // Max rain rate,for the day, mm/min (or in./min)
$maxrainratehr = "0.0";   // Max rain rate,for the day, mm/hr (or in.mm)
$maxrainratetime = "%maxrainratetime%";   // Time that occurred

I am no coder but there seems to be a "; // missing in currentrainratehr

This is from a wxlocal.html that reads

 Rain

// ====

// Current:

// --------

$dayrn = "%dayrn%";   // today's rain

$monthrn = "%monthrn%";   // rain so far this month

$yearrn = "%yearrn%";   // rain so far this year

$dayswithnorain = "%dayswithnorain%";   // Consecutative days with no rain

$dayswithrain = "%dayswithrain%";   // Days with rain for the month

$dayswithrainyear = "%dayswithrainyear%";   // Days with rain for the year

$currentrainratehr = "%currentrainratehr%";   // Current rain rate, mm/hr (or in./hr)

$maxrainrate = "%maxrainrate%";   // Max rain rate,for the day, mm/min (or in./min)

$maxrainratehr = "%maxrainratehr%";   // Max rain rate,for the day, mm/hr (or in.mm)

$maxrainratetime = "%maxrainratetime%";   // Time that occurred

// Yesterday:

// ----------

$yesterdayrain = "%yesterdayrain%";   // Yesterday rain

//

$vpstormrainstart = '%vpstormrainstart%';  //Davis VP Storm rain start date

$vpstormrain = '%vpstormrain%';           //Davis VP Storm rain value

//

//


Hope some one can help, sorry for jumping to the wrong conclusion the symptoms are still live

Offline pablo

  • Posts: 492
Re: testtags with wdconsole
« Reply #10 on: September 28, 2009, 08:32:04 PM »
Howdy,

Would it be possible for you to fix your `testtags.txt' file withe correct syntax?

Here's how it works:  wd ingests the .txt file and spits out a .php file with the values set for the `testtags'  (%tag%).

If there's a syntax error in the .php file, more than likely it's in the .txt file.  Unless of course wdconsole has a bug and overreaches its replacement - I'm not sure if I've encountered such an issue before.

HTH.

Cheers,
-pablo
pablo
WMR-100

Offline Taliesin

  • Posts: 20
Re: testtags with wdconsole
« Reply #11 on: September 29, 2009, 05:52:27 AM »
Hi Pablo,

Thanks for that.

I am with you there and that is exactly what I was trying to do. testtags.txt to wxlocal.html to testtags.php. Correct my logic but as a test I downloaded testtags.php from the site found the offending line saw the omissions put them in re uploaded and a clean page. Working backwards I checked the testtags.txt and wxlocal.html and there were no omissions in the file, so my logic was the wxlocal.html converting to testtags.php was where the issue lay. In my naivety the only thing I believed could throw it out was the / & () behind the comments and I changed the wxlocal.html and seemed to get a clean page but 10 mins later back to the error as probably a new testtags.php had been generated. After a nights rest on reflection if consolewd does not generate the data for a certain field - that may throw it out too so I will try that tack this am.

I am kicking myself as I had it working before & did not document it

Offline Taliesin

  • Posts: 20
Re: testtags with wdconsole
« Reply #12 on: September 29, 2009, 06:49:32 AM »
I think I have fixed / fudged it,  deleted the 3 lines completely but it still came up with the error then I checked the testtags.php & it was still showing the 3 lines, i checked on the PC and there was a testtags.php in consolewdfiles so I deleted that. Now the page is showing true & I rechecked the testtags.php and the lines are not there. I am sure there is a less brutal solution but I have no time to sort it.

Thanks

Offline stumpey

  • Posts: 765
  • Sunbury on Thames UK
    • Sunbury Weather
Re: testtags with wdconsole
« Reply #13 on: September 29, 2009, 07:48:52 AM »
I had a similar problem with the normal GUI version I resolved it like this.

I simply renamed the testtag file to wxlocal3.html then let wd parse the file in the normal manner to wx3.html

Then with a bit of script below and cron every 5 mins, moved and renamed the file to testtags.php..job done. This has been working for months perfectly :).

Steve


Code: [Select]
#!/bin/sh

sleep 15

cp /home/weather/wdisplay/webfiles/wx3.html /var/www/testtags.php

exit

Offline pablo

  • Posts: 492
Re: testtags with wdconsole
« Reply #14 on: September 29, 2009, 07:56:17 AM »
Hey Steve,

That's exactly been my approach:  writing shell scripts to prop wdconsole.  It's far easier to do it that way and you have ultimate control.  Which I prefer.

Also, as a hint, with creative use of symbolic links, you can have wdconsole fire off your code rather than its own code (like cronftp and their ilk).  In other words, you can create your own shell script and either sym link it to, say, `cronftp' or name it `cronftp'  wdconsole will run your script just the same.  Remember to delete/rename the original `crontftp' (or any other script you replace with your own).  ;)

Cheers,
-pablo
pablo
WMR-100