Welcome to the Cumulus Support forum.

Latest Cumulus MX release v3.3.0 build 3063 - 10 January 2020.
    Legacy Cumulus 1 release v1.9.4 (build 1099) - 28 November 2014

    See the Wiki for downloading either version.

    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: 61
    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 » Tue 17 Sep 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: 2806
    Joined: Tue 09 Dec 2008 1:37 pm
    Weather Station: None !
    Operating System: ex XP SP3 - now W10 laptop grr
    Location: Dudley, West Midlands, UK

    Re: Cumulus to clientrawhour.txt gives zero length file

    Post by beteljuice » Tue 17 Sep 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: 26717
    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 » Wed 18 Sep 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

    User avatar
    beteljuice
    Posts: 2806
    Joined: Tue 09 Dec 2008 1:37 pm
    Weather Station: None !
    Operating System: ex XP SP3 - now W10 laptop grr
    Location: Dudley, West Midlands, UK

    Re: Cumulus to clientrawhour.txt gives zero length file

    Post by beteljuice » Wed 18 Sep 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: 5923
    Joined: Thu 07 Jan 2010 9:44 pm
    Weather Station: Davis VP2
    Operating System: Stretch Lite rPi
    Location: Wilmslow, Cheshire, UK
    Contact:

    Re: Cumulus to clientrawhour.txt gives zero length file

    Post by mcrossley » Wed 18 Sep 2013 2:48 pm

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

    User avatar
    nitrx
    Posts: 1299
    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 » Wed 18 Sep 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: 61
    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 » Wed 18 Sep 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: 61
    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 » Wed 18 Sep 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: 5923
    Joined: Thu 07 Jan 2010 9:44 pm
    Weather Station: Davis VP2
    Operating System: Stretch Lite rPi
    Location: Wilmslow, Cheshire, UK
    Contact:

    Re: Cumulus to clientrawhour.txt gives zero length file

    Post by mcrossley » Wed 18 Sep 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: 61
    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 » Wed 18 Sep 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: 26717
    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 » Wed 18 Sep 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

    User avatar
    beteljuice
    Posts: 2806
    Joined: Tue 09 Dec 2008 1:37 pm
    Weather Station: None !
    Operating System: ex XP SP3 - now W10 laptop grr
    Location: Dudley, West Midlands, UK

    Re: Cumulus to clientrawhour.txt gives zero length file

    Post by beteljuice » Wed 18 Sep 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: 213
    Joined: Tue 28 May 2013 1:06 am
    Weather Station: Davis VP2
    Operating System: Raspian Jessie
    Location: Tulsa, OK

    Re: Cumulus to clientrawhour.txt gives zero length file

    Post by BigOkie » Wed 18 Sep 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: 61
    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 » Thu 19 Sep 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

    Locked