Please read the posts in the Announcements section about the current status of Cumulus development now that I have retired

Please read this post before posting

Latest Cumulus release v1.9.4 (build 1099) - Nov 28 2014
Latest Cumulus MX release - v3.0.0 build 3043 Jan 20 2017. See this post for download

Cumulus to clientrawhour.txt gives zero length file

Please discuss beta versions of Cumulus 1 here. Note: There are currently no beta versions of Cumulus 1.
Dinant
Posts: 34
Joined: Sat Aug 17, 2013 9:11 am
Weather Station: Davis Vantage Pro2
Operating System: Windows 2003
Location: Markelo
Contact:

Cumulus to clientrawhour.txt gives zero length file

Postby Dinant » Tue Sep 17, 2013 9:42 pm

Hello Steve,

I want to make a file "clientrawhour.txt" which can be used with WU-Graphs v 1.8.0 from Radomir Luza to graph the last hour. Normally the file is being produced by Weather Display. I don't like WD, so I want to use Cumulus. I have made a clientrawhourT.txt file which is about 14K in size and have added the file to the internet files section. The file which being produced after the web tags are substituted has a size of zero! I think I know why. The clientrawhourT.txt is 14k (more than 500 web tags) and it contains only one line!
I am using version 1.9.4 build 1082. The file clientrawhourT.txt is being attached.

Dinant
You do not have the required permissions to view the files attached to this post.

User avatar
beteljuice
Posts: 2455
Joined: Tue Dec 09, 2008 1:37 pm
Weather Station: None !
Operating System: XP SP3 - honest
Location: Dudley, West Midlands, UK

Re: Cumulus to clientrawhour.txt gives zero length file

Postby beteljuice » Tue Sep 17, 2013 10:03 pm

Have you tried just the first few entries to make sure you have your file settings and tick boxes all correct ?
Image
......................Imagine, what you will KNOW tomorrow !

User avatar
steve
Cumulus Author
Posts: 26254
Joined: Mon Jun 02, 2008 6:49 pm
Weather Station: None
Operating System: None
Location: On tour in France
Contact:

Re: Cumulus to clientrawhour.txt gives zero length file

Postby steve » Wed Sep 18, 2013 6:53 am

Dinant wrote: I think I know why. The clientrawhourT.txt is 14k (more than 500 web tags) and it contains only one line!
Yes, the parser which the web tags code uses can't cope with a line 14k characters long; there will be an error message to this effect in the diags file. I don't actually know what the limit is, sorry, but I suspect it is a lot less than 14k, possibly as low as 255.
Steve
-----
Hosting available for Cumulus web sites. See http://sandaysoft.com/forum/viewtopic.php?f=2&t=11876

Please read the posts in the Announcements section about the current status of Cumulus development now that I have retired

User avatar
beteljuice
Posts: 2455
Joined: Tue Dec 09, 2008 1:37 pm
Weather Station: None !
Operating System: XP SP3 - honest
Location: Dudley, West Midlands, UK

Re: Cumulus to clientrawhour.txt gives zero length file

Postby beteljuice » Wed Sep 18, 2013 11:46 am

Will the graphics prog accept a line delimited files ?

As you are having to imitate a WD file there must be an interface which is parsing it to give the graphics prog what it really wants.
Image
......................Imagine, what you will KNOW tomorrow !

User avatar
mcrossley
Posts: 4979
Joined: Thu Jan 07, 2010 9:44 pm
Weather Station: Davis VP2
Operating System: Jessie Lite rPi
Location: Wilmslow, Cheshire, UK
Contact:

Re: Cumulus to clientrawhour.txt gives zero length file

Postby mcrossley » Wed Sep 18, 2013 2:48 pm

The realtimegaugesT.txt file worked OK with a single line slightly smaller than 2K characters.

User avatar
nitrx
Posts: 1300
Joined: Sun Dec 13, 2009 1:21 pm
Weather Station: WH1080
Operating System: Windows 10
Location: Apeldoorn The Netherlands
Contact:

Re: Cumulus to clientrawhour.txt gives zero length file

Postby nitrx » Wed Sep 18, 2013 2:59 pm

Is rapidfire added to the logs on Wundergroound in that case you can use v1.79 of the graphs my daily graph is now updatet every 15 minutes http://www.apeldoorn.tk/weer/wugraphs.php

Dinant
Posts: 34
Joined: Sat Aug 17, 2013 9:11 am
Weather Station: Davis Vantage Pro2
Operating System: Windows 2003
Location: Markelo
Contact:

Re: Cumulus to clientrawhour.txt gives zero length file

Postby Dinant » Wed Sep 18, 2013 4:38 pm

beteljuice wrote:Have you tried just the first few entries to make sure you have your file settings and tick boxes all correct ?


Yes, if I replace al spaces between the web tags by CR+LF, so everything web tag is on a separate line then it works fine. But that file isn't a clientrawhour.txt file as being produced by WD. As a result the hour tab in the WU-Graphs v 1.8.0 doesn't work.

Dinant

Dinant
Posts: 34
Joined: Sat Aug 17, 2013 9:11 am
Weather Station: Davis Vantage Pro2
Operating System: Windows 2003
Location: Markelo
Contact:

Re: Cumulus to clientrawhour.txt gives zero length file

Postby Dinant » Wed Sep 18, 2013 4:45 pm

mcrossley wrote:The realtimegaugesT.txt file worked OK with a single line slightly smaller than 2K characters.


I am also using the realtimegaugesT.txt file. That file is in JSON format and about 2000 bytes and the longest line is about 46 bytes. After every comma in the file you may or may not enter a CR+LF. That's why this file is not a problem.

Dinant

User avatar
mcrossley
Posts: 4979
Joined: Thu Jan 07, 2010 9:44 pm
Weather Station: Davis VP2
Operating System: Jessie Lite rPi
Location: Wilmslow, Cheshire, UK
Contact:

Re: Cumulus to clientrawhour.txt gives zero length file

Postby mcrossley » Wed Sep 18, 2013 5:00 pm

Dinant wrote:
mcrossley wrote:The realtimegaugesT.txt file worked OK with a single line slightly smaller than 2K characters.


I am also using the realtimegaugesT.txt file. That file is in JSON format and about 2000 bytes and the longest line is about 46 bytes. After every comma in the file you may or may not enter a CR+LF. That's why this file is not a problem.

Dinant
Yes but older versions which were slightly shorter were formatted as a single line, I only made it multi-line for readability in later versions, not because Cumulus couldn't parse it.

Dinant
Posts: 34
Joined: Sat Aug 17, 2013 9:11 am
Weather Station: Davis Vantage Pro2
Operating System: Windows 2003
Location: Markelo
Contact:

Re: Cumulus to clientrawhour.txt gives zero length file

Postby Dinant » Wed Sep 18, 2013 5:17 pm

steve wrote:
Dinant wrote: I think I know why. The clientrawhourT.txt is 14k (more than 500 web tags) and it contains only one line!
Yes, the parser which the web tags code uses can't cope with a line 14k characters long; there will be an error message to this effect in the diags file. I don't actually know what the limit is, sorry, but I suspect it is a lot less than 14k, possibly as low as 255.


Hello Steve,

I have a question:
If I replace the space between the webtags by CR+LF (so one web tag on every line).
Is there a trick to concat the lines of the clientrawhour.txt file just before sending to the web?

Dinant

User avatar
steve
Cumulus Author
Posts: 26254
Joined: Mon Jun 02, 2008 6:49 pm
Weather Station: None
Operating System: None
Location: On tour in France
Contact:

Re: Cumulus to clientrawhour.txt gives zero length file

Postby steve » Wed Sep 18, 2013 5:20 pm

Dinant wrote:If I replace the space between the webtags by CR+LF (so one web tag on every line).
Is there a trick to concat the lines of the clientrawhour.txt file just before sending to the web?
I have no idea, but someone else might.
Steve
-----
Hosting available for Cumulus web sites. See http://sandaysoft.com/forum/viewtopic.php?f=2&t=11876

Please read the posts in the Announcements section about the current status of Cumulus development now that I have retired

User avatar
beteljuice
Posts: 2455
Joined: Tue Dec 09, 2008 1:37 pm
Weather Station: None !
Operating System: XP SP3 - honest
Location: Dudley, West Midlands, UK

Re: Cumulus to clientrawhour.txt gives zero length file

Postby beteljuice » Wed Sep 18, 2013 7:10 pm

WU-Graphs v 1.8.0 doesn't work.
... but as I suggested, modify the code to accept the input you are giving. :o
Image
......................Imagine, what you will KNOW tomorrow !

BigOkie
Posts: 210
Joined: Tue May 28, 2013 1:06 am
Weather Station: Davis VP2
Operating System: Raspian Jessie
Location: Tulsa, OK

Re: Cumulus to clientrawhour.txt gives zero length file

Postby BigOkie » Wed Sep 18, 2013 11:02 pm

steve wrote:
Dinant wrote:If I replace the space between the webtags by CR+LF (so one web tag on every line).
Is there a trick to concat the lines of the clientrawhour.txt file just before sending to the web?
I have no idea, but someone else might.


Here's a vbscript you might use

Open notepad and copy/paste the following:

Code: Select all

Const ForReading = 1
Const ForWriting = 2

Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objFile = objFSO.OpenTextFile("C:\temp\clientrawday.txt", ForReading)

strText = objFile.ReadAll
objFile.Close
strNewText = Replace(strText, vbCrLf, " ")

Set objFile = objFSO.OpenTextFile("C:\temp\clientrawday.txt", ForWriting)
objFile.WriteLine strNewText
objFile.Close


Obviously you need to modify the two filename variables. In this example, the source file overwrites the original. You invoke it by calling from the command line..

cscript script.vbs (or whatever name you wish to give the VBscript file).

You could also call this from task scheduler.

Dinant
Posts: 34
Joined: Sat Aug 17, 2013 9:11 am
Weather Station: Davis Vantage Pro2
Operating System: Windows 2003
Location: Markelo
Contact:

Re: Cumulus to clientrawhour.txt gives zero length file

Postby Dinant » Thu Sep 19, 2013 4:28 pm

beteljuice wrote:
WU-Graphs v 1.8.0 doesn't work.
... but as I suggested, modify the code to accept the input you are giving. :o


That's a good suggestion and probably the quickest way to solve this problem!

I have examined the WU-Graphs v 1.8.0 php code.
On line 130 of WUG-inc-hour.php it says:
// extract data
$clRawData = @file_get_contents($clientRawHpath.'clientrawhour.txt');
// data to array
$Data = explode(' ', $clRawData);

I have change this into:
// extract data
$clRawData = @file_get_contents($clientRawHpath.'clientrawhour.txt');
// data to array
$Data = explode(chr(10), $clRawData);

Now the hour graphs are shown correctly with a clientrawhour.txt file generated by Cumulus.
See http://www.weerstationmarkelo.nl/grafieken/wu-grafieken

Thanks for your help.

Dinant


Return to “Cumulus 1 BETA versions”

Who is online

Users browsing this forum: Bing [Bot] and 4 guests