Welcome to the Cumulus Support forum.

Latest Cumulus MX V3 release 3.28.5 (build 3282) - 23 February 2024

Cumulus MX V4 beta test release 4.0.0 (build 4017) - 17 March 2024

Legacy Cumulus 1 release v1.9.4 (build 1099) - 28 November 2014 (a patch is available for 1.9.4 build 1099 that extends the date range of drop-down menus to 2030)

Download the Software (Cumulus MX / Cumulus 1 and other related items) from the Wiki

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.
Locked
Dinant
Posts: 78
Joined: Sat 17 Aug 2013 9:11 am
Weather Station: Davis Vantage Pro2
Operating System: Windows 2012 R2
Location: Markelo
Contact:

Cumulus to clientrawhour.txt gives zero length file

Post by Dinant »

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: 3292
Joined: Tue 09 Dec 2008 1:37 pm
Weather Station: None !
Operating System: W10 - Threadripper 16core, etc
Location: Dudley, West Midlands, UK

Re: Cumulus to clientrawhour.txt gives zero length file

Post by beteljuice »

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: 26702
Joined: Mon 02 Jun 2008 6:49 pm
Weather Station: None
Operating System: None
Location: Vienne, France
Contact:

Re: Cumulus to clientrawhour.txt gives zero length file

Post by steve »

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
User avatar
beteljuice
Posts: 3292
Joined: Tue 09 Dec 2008 1:37 pm
Weather Station: None !
Operating System: W10 - Threadripper 16core, etc
Location: Dudley, West Midlands, UK

Re: Cumulus to clientrawhour.txt gives zero length file

Post by beteljuice »

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: 12641
Joined: Thu 07 Jan 2010 9:44 pm
Weather Station: Davis VP2/WLL
Operating System: Bullseye Lite rPi
Location: Wilmslow, Cheshire, UK
Contact:

Re: Cumulus to clientrawhour.txt gives zero length file

Post by mcrossley »

The realtimegaugesT.txt file worked OK with a single line slightly smaller than 2K characters.
User avatar
nitrx
Posts: 1297
Joined: Sun 13 Dec 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

Post by nitrx »

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: 78
Joined: Sat 17 Aug 2013 9:11 am
Weather Station: Davis Vantage Pro2
Operating System: Windows 2012 R2
Location: Markelo
Contact:

Re: Cumulus to clientrawhour.txt gives zero length file

Post by Dinant »

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: 78
Joined: Sat 17 Aug 2013 9:11 am
Weather Station: Davis Vantage Pro2
Operating System: Windows 2012 R2
Location: Markelo
Contact:

Re: Cumulus to clientrawhour.txt gives zero length file

Post by Dinant »

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: 12641
Joined: Thu 07 Jan 2010 9:44 pm
Weather Station: Davis VP2/WLL
Operating System: Bullseye Lite rPi
Location: Wilmslow, Cheshire, UK
Contact:

Re: Cumulus to clientrawhour.txt gives zero length file

Post by mcrossley »

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: 78
Joined: Sat 17 Aug 2013 9:11 am
Weather Station: Davis Vantage Pro2
Operating System: Windows 2012 R2
Location: Markelo
Contact:

Re: Cumulus to clientrawhour.txt gives zero length file

Post by Dinant »

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: 26702
Joined: Mon 02 Jun 2008 6:49 pm
Weather Station: None
Operating System: None
Location: Vienne, France
Contact:

Re: Cumulus to clientrawhour.txt gives zero length file

Post by steve »

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
User avatar
beteljuice
Posts: 3292
Joined: Tue 09 Dec 2008 1:37 pm
Weather Station: None !
Operating System: W10 - Threadripper 16core, etc
Location: Dudley, West Midlands, UK

Re: Cumulus to clientrawhour.txt gives zero length file

Post by beteljuice »

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: 272
Joined: Tue 28 May 2013 1:06 am
Weather Station: Davis VP2 Plus
Operating System: Raspian Buster (RPi 3b)
Location: Tulsa, OK

Re: Cumulus to clientrawhour.txt gives zero length file

Post by BigOkie »

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: 78
Joined: Sat 17 Aug 2013 9:11 am
Weather Station: Davis Vantage Pro2
Operating System: Windows 2012 R2
Location: Markelo
Contact:

Re: Cumulus to clientrawhour.txt gives zero length file

Post by Dinant »

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
Locked