Welcome to the Cumulus Support forum.

Latest Cumulus MX V3 release 3.28.6 (build 3283) - 21 March 2024

Cumulus MX V4 beta test release 4.0.0 (build 4019) - 03 April 2024

Legacy Cumulus 1 release 1.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

Realtime.txt and SteelSeries Gauges

Discussion of Mark Crossley's HTML5/Javascript gauges

Moderator: mcrossley

Post Reply
User avatar
Cliff
Posts: 19
Joined: Mon 15 Oct 2012 1:27 am
Weather Station: Davis Vantage Vue
Operating System: Windows 7 SP1
Location: Campbellford, Ontario, Canada
Contact:

Realtime.txt and SteelSeries Gauges

Post by Cliff »

Mark,

My web host doesn't support text files. I've successfully got around that issue with the dayfile.txt by running a service after midnight and running a batch file to copy the txt file as a php file. Then the php file is uploaded to the server and "read" by another css file that processes the data.

I love your gauges and would like to be able to do a similar "trick" but I'm not sure where to start. I know Cumulus has settings to "Enable Realtime", "Enable Realtime FTP" and "Realtime.txt FTP.

I assume that the first two allow you to FTP without including a txt file. I also notice there is an area in External Programs called "Realtime Program". I also assume that "Enable Realtime" modifies the realtime.txt file by the interval specified. Forgive me if my assumptions are incorrect.

Is there a section in your files that specifically looks for the existence of a txt file? Can this be changed or modified to look for a different filename such as "realtime.php"???

Any ideas on how this can be implemented without uploading a text file.

Thanks for any help or suggestions you can offer.

Cliff
User avatar
mcrossley
Posts: 12778
Joined: Thu 07 Jan 2010 9:44 pm
Weather Station: Davis VP2/WLL
Operating System: Bullseye Lite rPi
Location: Wilmslow, Cheshire, UK
Contact:

Re: Realtime.txt and SteelSeries Gauges

Post by mcrossley »

Yep, following the instructions in the readme file, just change the remote file name in Cumulus to whatever you want - eg realtimegauges.php - and then change the gauges.js file to read that file. If you are using v1.x of the gauges, then the line to change is...

g_realTimeURL = "../realtimegauges.txt";

Change it to...

g_realTimeURL = "../realtimegauges.php";
User avatar
Cliff
Posts: 19
Joined: Mon 15 Oct 2012 1:27 am
Weather Station: Davis Vantage Vue
Operating System: Windows 7 SP1
Location: Campbellford, Ontario, Canada
Contact:

Re: Realtime.txt and SteelSeries Gauges

Post by Cliff »

Mark,

I knew it had to be easy and thanks for pointing me in the right direction. I'm looking forward to implementing the gauges.

Regards,
User avatar
Cliff
Posts: 19
Joined: Mon 15 Oct 2012 1:27 am
Weather Station: Davis Vantage Vue
Operating System: Windows 7 SP1
Location: Campbellford, Ontario, Canada
Contact:

Re: Realtime.txt and SteelSeries Gauges

Post by Cliff »

Mark,

One more question. If I leave Cumulus at a Realtime interval of 30 seconds do I have to keep renaming the realtime.txt to realtime.php or can I have my local filename as realtime.txt and the remote filename as realtime.php. Does Cumulus then upload the file as txt and then change it on the remote server to php? If yes that would be great! I would assume that I would check "Process", "Realtime" and "FTP" on the Files page too.

If that is not the case, how is it possible to keep renaming the same file every 20 seconds so that it gets uploaded every 30?

Thanks
User avatar
steve
Cumulus Author
Posts: 26701
Joined: Mon 02 Jun 2008 6:49 pm
Weather Station: None
Operating System: None
Location: Vienne, France
Contact:

Re: Realtime.txt and SteelSeries Gauges

Post by steve »

The name that you put in the 'local' box is not related to the name that you put in the 'remote' box. The 'local' name is the name of a file on your system. Cumulus creates a file on the ftp server using the contents of the 'local' file, and tells the ftp server to give it the specified 'remote' name. The remote name can be anything you want.

So the effect is as you describe, but the details of how it works are slightly different.
Steve
User avatar
Cliff
Posts: 19
Joined: Mon 15 Oct 2012 1:27 am
Weather Station: Davis Vantage Vue
Operating System: Windows 7 SP1
Location: Campbellford, Ontario, Canada
Contact:

Re: Realtime.txt and SteelSeries Gauges

Post by Cliff »

Thanks for the clarification Steve.
I've set everything up as described but for some reason the file on the server is zero bytes.
The local realtimegauges.txttmp is being updated regularly.
Any idea as to why the server file is empty???
You do not have the required permissions to view the files attached to this post.
User avatar
Cliff
Posts: 19
Joined: Mon 15 Oct 2012 1:27 am
Weather Station: Davis Vantage Vue
Operating System: Windows 7 SP1
Location: Campbellford, Ontario, Canada
Contact:

Re: Realtime.txt and SteelSeries Gauges

Post by Cliff »

Further to my last post, I don't know why the file was showing zero bytes because I just checked it again and it shows correctly. However, when I check my "gauges" web page, the scroller indicates the file is corrupt and none of the gauges are active. I've attached a copy of my php file (I had to rename it txt because your server won't allow php files) which the script should be reading (I did remember to change gauges.js to look for the correct filename).

Any ideas???
You do not have the required permissions to view the files attached to this post.
User avatar
mcrossley
Posts: 12778
Joined: Thu 07 Jan 2010 9:44 pm
Weather Station: Davis VP2/WLL
Operating System: Bullseye Lite rPi
Location: Wilmslow, Cheshire, UK
Contact:

Re: Realtime.txt and SteelSeries Gauges

Post by mcrossley »

It is because your website is appending the following Analytics code to the end of your realtime file...

Code: Select all

<!-- Hosting24 Analytics Code -->
<script type="text/javascript" src="http://stats.hosting24.com/count.php"></script>
<!-- End Of Analytics Code -->
User avatar
steve
Cumulus Author
Posts: 26701
Joined: Mon 02 Jun 2008 6:49 pm
Weather Station: None
Operating System: None
Location: Vienne, France
Contact:

Re: Realtime.txt and SteelSeries Gauges

Post by steve »

The web server is adding the following to the end of your data file:

<!-- Hosting24 Analytics Code -->
<script type="text/javascript" src="http://stats.hosting24.com/count.php"></script>
<!-- End Of Analytics Code -->


Perhaps this is confusing the gauges code?

Edit: crossed in the post! :lol:
Steve
User avatar
Cliff
Posts: 19
Joined: Mon 15 Oct 2012 1:27 am
Weather Station: Davis Vantage Vue
Operating System: Windows 7 SP1
Location: Campbellford, Ontario, Canada
Contact:

Re: Realtime.txt and SteelSeries Gauges

Post by Cliff »

Thanks Mark & Steve,

What are the odds of both of you replying at the same time :lol:

Where do you see that code???
If I open the open PHP file or the above txt file I don't see the code you are referring to.

If the server is indeed adding code somehow, do you have any suggestion as to how to avoid that (perhaps renaming the file to htm or another extension). Of course asking them why they are doing it is also an option but I have to have proof it is happening.
User avatar
steve
Cumulus Author
Posts: 26701
Joined: Mon 02 Jun 2008 6:49 pm
Weather Station: None
Operating System: None
Location: Vienne, France
Contact:

Re: Realtime.txt and SteelSeries Gauges

Post by steve »

It's not displayed in the browser because there's nothing for the browser to display. View the source, Luke.

I suspect you can't turn it off. 000webhost.com are listed in the wiki as unsuitable for Cumulus hosting, for reasons that you're discovering.
Steve
User avatar
mcrossley
Posts: 12778
Joined: Thu 07 Jan 2010 9:44 pm
Weather Station: Davis VP2/WLL
Operating System: Bullseye Lite rPi
Location: Wilmslow, Cheshire, UK
Contact:

Re: Realtime.txt and SteelSeries Gauges

Post by mcrossley »

Paste the URL into your browser...

http://trenthillsweather.site11.com/realtimegauges.php

Then "view page source", you will see the code then.

You could try using an non-text file extension, or no file extension at all, and see what happens.
User avatar
Cliff
Posts: 19
Joined: Mon 15 Oct 2012 1:27 am
Weather Station: Davis Vantage Vue
Operating System: Windows 7 SP1
Location: Campbellford, Ontario, Canada
Contact:

Re: Realtime.txt and SteelSeries Gauges

Post by Cliff »

Forgive the ignorance of someone who knows nothing about html or php. :lol:

Yes, if I "view source" on that webpage I can see the code you are referring to at the end of the "page". However, I do not see at the end of the 'realtimegauges.php' file. I just logged in to the server and looked at the above php file and looked fine to me with all of the appropriate data.

Now I'm confused :oops:
User avatar
steve
Cumulus Author
Posts: 26701
Joined: Mon 02 Jun 2008 6:49 pm
Weather Station: None
Operating System: None
Location: Vienne, France
Contact:

Re: Realtime.txt and SteelSeries Gauges

Post by steve »

The server adds the code on the fly when it serves the file.
Steve
User avatar
Cliff
Posts: 19
Joined: Mon 15 Oct 2012 1:27 am
Weather Station: Davis Vantage Vue
Operating System: Windows 7 SP1
Location: Campbellford, Ontario, Canada
Contact:

Re: Realtime.txt and SteelSeries Gauges

Post by Cliff »

You could try using an non-text file extension, or no file extension at all, and see what happens.
Wow is all I can say! It's always the simple things that trip you up. Uploading the file as realtimegauges without the extension did the trick finally.

SteelSeries is now up and running.

Thank you, thank you, thank you!
Post Reply