Page 1 of 2

Can not find the realtime.log file in realtimehighcharts

Posted: Tue 01 Jul 2014 6:45 pm
by burgert
I managed to gather the necessary components/modules to compile a private weather station. I am using Cumulus 1.9.4 (1095) together with Toolbox (v1), Highcharts and Realtimehighcharts. As a reseller I host my own website.
Because I am new to this level of coding I struggled quite a bit to get everything sorted out - thanks to this forum!!
My last hurdle is to get my realtimehighcharts working. I followed the instructions of Mark Crossley (http://wiki.sandaysoft.com/a/Highcharts_-_Realtime). I get my chart showing the realtime data from the realtime.txt file - however, there is no realtime.log to accumulate the data. As soon as I refresh the screen it starts then anew and don't show any older data. I am not sure where this realtime.log file must be and how it is generated? Must I define one? Linked to this problem might be my non understanding of the GNU Utilities as specified. I am not sure what the realtimelog.bat file is suppose to do (especially the tail.exe description) In my error log I get the following:
[27-Jun-2014 ...] PHP Warning: Cannot modify header information - headers already sent by (output started at xxx/weather/realtimehighcharts/realtimeLogParser.php:88) in xxx/weather/realtimehighcharts/realtimeLogParser.php on line 155.
This also indicates (line 88) that it cannot open the log file (echo "Failed to open log file.";)
Is there anybody that have experience with this part of the system? Please, any help will be highly appreciated.

Re: Can not find the realtime.log file in realtimehighcharts

Posted: Tue 01 Jul 2014 11:41 pm
by water01
The realtimelog.bat file is a set of DOS commands run in Command Prompt window that produces the realtime.log file that is the basis of the data that Highcharts uses to produce the graph. It uses the tail command to truncate the file to 2 hrs worth of data.

Code: Select all

:start
copy /b realtime.log+realtime.txt realtime.tmp
tail --quiet --lines=120 realtime.tmp > realtime.log
choice /C N /T 59 /D N /M "Wait for timeout..."
goto start
The first line is just a label.
The second line copies the realtime.log, appending the realtime.txt produced by cumulus and putting the output in realtime.tmp.
The third line uses the tail command copy the last 120 lines (2hrs worth of data) from realtime.tmp to realtime.log which should be uploaded via Toolbox to your server so the graph can be produced.
The fourth line makes the .bat job pause for 59 seconds and when that point is reached line five returns to the Start label for the loop to start again.
My guess would be that you are failing to upload the realtime.log file to your server at least once per minute in Toolbox.

Re: Can not find the realtime.log file in realtimehighcharts

Posted: Wed 02 Jul 2014 7:28 pm
by burgert
Thank you water1.
I now have a better understanding of the .bat file and managed to get the realtime graph to display my realtimelog.txt values - but, it does not automatically update on the specified times. I can see the graph refreshes (it blinks) but no change in data. Only once I refresh the whole page (browser refresh) then the graph also updates. I had it to work for a short while but with all my fiddeling something was changed that causes this problem - if I only know what?
Can anybody give me some pointers to explore? Thanks

Re: Can not find the realtime.log file in realtimehighcharts

Posted: Wed 02 Jul 2014 11:38 pm
by water01
Could you post the url of your site so we can take a look and see if we can diagnose the problem?

Re: Can not find the realtime.log file in realtimehighcharts

Posted: Sat 05 Jul 2014 6:27 pm
by burgert
Hi Water01.
My setup is still very tempory and Cumulus is not supplying data 24/7. I only link for testing purposes.
Will post again when system is up and running. Thanks.

Re: Can not find the realtime.log file in realtimehighcharts

Posted: Tue 16 Aug 2016 10:08 am
by happyweather123
Hello, i am new here and want to finish my highcharts graphs that i use on Cumulus 1.9.4. I am again using Toolbox, i've already uploaded highcharts to my webserver. I made realtimelog.txt via Toolbox and i'm uploading it to my webserver every minute and have a purge selected for every day. I didn't use GNU Utility.
Everything there is very clever, but things get complicated, when i want to show up graphs on my webpage. Should i copy script code from realtimeCumulus.js to my website and what scripts do i need to write (<script src="........"></script>) to make highcharts graphs online. Or do i have to upload realtimeCumulus.js and realtimeCumulus.htm to my webserver, beacuse i tried to do that and i opened realtimeCumulus.htm on my webbrowser and it didn't show me a thing.

Can anyone give me more information or guide about that, beacuse i want to finish that graphs as soon as i can, possibly in few days from now, so please reply.

Thanks and hope see you very soon (on replies!)"

Re: Can not find the realtime.log file in realtimehighcharts

Posted: Tue 16 Aug 2016 8:28 pm
by mcrossley
You will need to include the same files as in realtimeCumulus.htm in your web page...

Code: Select all

    <!-- JQuery script -->
    <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js"></script>

    <!-- Basic Highcharts script -->
    <script src="./highcharts/js/highcharts.js"></script>
    <!-- Add some 'styling' -->
    <script src="./highcharts/js/themes/grid.js"></script>

    <!-- Additional files for the Highslide popup effect -->
    <script src="http://www.highcharts.com/highslide/highslide-full.min.js"></script>
    <script src="http://www.highcharts.com/highslide/highslide.config.js"></script>

    <script src="./realtimeCumulus.js"></script>
And the <div> to hold the graph...

Code: Select all

    <div id="container" style="min-width: 400px; height: 400px; margin-left: 10%; margin-right: 10%"></div>
If you put up a test page and provide a link I can take a look and see what is wrong.

Re: Can not find the realtime.log file in realtimehighcharts

Posted: Wed 17 Aug 2016 3:21 pm
by happyweather123
Well it appears like a blank space. Do i need to have the latest version of jquery or what? My website: http://benedikt.vreme-podnebje.si/realtimeGraphs.html
I have realtime.txt, realtimelog.txt, highcharts and also realtime.js i hope that's enough. It looks like there's nothing out there. I copied exactly as you wrote the code.
And i am using html document for sure.

Re: Can not find the realtime.log file in realtimehighcharts

Posted: Wed 17 Aug 2016 7:24 pm
by mcrossley
OK, it is not finding the log parser script. It is trying to use...
http://benedikt.vreme-podnebje.si/realtimeLogParser.php

But that is giving a 'file not found' error.

Re: Can not find the realtime.log file in realtimehighcharts

Posted: Wed 17 Aug 2016 8:54 pm
by happyweather123
So do i need to make that file via batch that was in realtimeGraphs folder and send it to my website and that's fine. So i don't need the .bak or what is this file called to make commands via toolbox, beacuse i am already using toolbox with realtimelog.txt?

I did that and it says: "Failed to open log file.No valid data types supplied"

And i hope that realtimelog.txt won't extend too much, beacuse it has a larger size now.

Re: Can not find the realtime.log file in realtimehighcharts

Posted: Wed 17 Aug 2016 9:29 pm
by mcrossley
You don't need to use the batch file if you are using toolbox.

OK, now you have a log file...
http://benedikt.vreme-podnebje.si/realtimelog.txt

But the log parser cannot find it...
http://benedikt.vreme-podnebje.si/realt ... speed&temp

So what have you configured in realtimeLogParser.php ? The defaults are...

Code: Select all

// The name of your realtime.txt log file
$logfile = 'realtime.log';
// The various delimiters used in your version of realtime.txt
$field_delimiter = ' ';
$date_delimiter = '/';
$time_delimiter = ':';
Yours should be...

Code: Select all

// The name of your realtime.txt log file
$logfile = 'realtimelog.txt';
// The various delimiters used in your version of realtime.txt
$field_delimiter = ' ';
$date_delimiter = '.';
$time_delimiter = ':';

Re: Can not find the realtime.log file in realtimehighcharts

Posted: Wed 17 Aug 2016 9:40 pm
by mcrossley
Ah, I'd forgotten I added view=sce to that script! You have not edited realtimeLogParser.php to change the defaults...
http://benedikt.vreme-podnebje.si/realt ... p?view=sce

Re: Can not find the realtime.log file in realtimehighcharts

Posted: Wed 17 Aug 2016 9:52 pm
by happyweather123
That means i don't have to edit this? I mean realtimelog parser.php? What should i do then to fix that?

Re: Can not find the realtime.log file in realtimehighcharts

Posted: Wed 17 Aug 2016 9:55 pm
by mcrossley
You need to edit realtimeLogParser.php and make the changes I posted above.

Re: Can not find the realtime.log file in realtimehighcharts

Posted: Wed 17 Aug 2016 10:00 pm
by happyweather123
Yes it's working! So does it update automaticaly when i add it to my website?

And i refreshed that page with realtime graph few times and it messed up. Why it shows different data and so?

It just shows one line with temperature and other data and instead of hours i can see years like 1970 and so on to 2016