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
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
BT's Sager PHP Script V2 - For Cumulus
Moderator: daj
-
- Posts: 118
- Joined: Mon 16 Mar 2020 3:23 am
- Weather Station: Davis
- Operating System: Windows 10
- Contact:
Re: BT's Sager PHP Script V2 - For Cumulus
Thanks Mark,
This is the line (below) the writes the Sager forecast to the Index.htm page. Can I write the same Sager output to the "currentconditions.txt" file at the same time?
<a href = "bt-sager.php" style = "text-decoration:none;" target = "_blank"><script src = "bt-sager-wc.php" type="text/javascript"></script></a>
This is the line (below) the writes the Sager forecast to the Index.htm page. Can I write the same Sager output to the "currentconditions.txt" file at the same time?
<a href = "bt-sager.php" style = "text-decoration:none;" target = "_blank"><script src = "bt-sager-wc.php" type="text/javascript"></script></a>
- 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: BT's Sager PHP Script V2 - For Cumulus
No, you would need to call it separately and either have some PHP code to save to file or pipe the output to file. I hope someone can chip in with a solution to that?
- ConligWX
- Posts: 1635
- Joined: Mon 19 May 2014 10:45 pm
- Weather Station: Davis vPro2+ w/DFARS + AirLink
- Operating System: Ubuntu 24.04 LTS
- Location: Bangor, NI
- Contact:
Re: BT's Sager PHP Script V2 - For Cumulus
I have mine written to a forecast on the main screen but had some help from the late @betlejuice in coding it since my setup seemed to have issues with the standard script in the index file. I'll see if I can dig it all out...
hmm seems to drawn a blank. maybe I overwrote some time ago, I'm no using the forecast from my Davis VP2 console.
hmm seems to drawn a blank. maybe I overwrote some time ago, I'm no using the forecast from my Davis VP2 console.
Regards Simon
https://www.conligwx.org - @conligwx
Davis Vantage Pro2 Plus with Daytime FARS • WeatherLink Live • Davis AirLink • PurpleAir • CumulusMX v4.0.0
https://www.conligwx.org - @conligwx
Davis Vantage Pro2 Plus with Daytime FARS • WeatherLink Live • Davis AirLink • PurpleAir • CumulusMX v4.0.0
- ConligWX
- Posts: 1635
- Joined: Mon 19 May 2014 10:45 pm
- Weather Station: Davis vPro2+ w/DFARS + AirLink
- Operating System: Ubuntu 24.04 LTS
- Location: Bangor, NI
- Contact:
Re: BT's Sager PHP Script V2 - For Cumulus
I do call bt-sager within my main saratoga templates (nearly all php files)
code is like so:
code for my forecast in the cmx template is calling for a file called consoleforecast.txt
not sure if any of that helps.
code is like so:
Code: Select all
<td style="width: 510px;" class="data1"><?php echo "<b>Sager Forecast: </b>"; ?><?php include('./bt-sager-wc.php') ;?><?php echo "<br /><br />" ; ?></td>
Code: Select all
<p><strong>Forecast:</strong> <?php echo file_get_contents('consoleforecast.txt') ?></p>
Regards Simon
https://www.conligwx.org - @conligwx
Davis Vantage Pro2 Plus with Daytime FARS • WeatherLink Live • Davis AirLink • PurpleAir • CumulusMX v4.0.0
https://www.conligwx.org - @conligwx
Davis Vantage Pro2 Plus with Daytime FARS • WeatherLink Live • Davis AirLink • PurpleAir • CumulusMX v4.0.0
- ConligWX
- Posts: 1635
- Joined: Mon 19 May 2014 10:45 pm
- Weather Station: Davis vPro2+ w/DFARS + AirLink
- Operating System: Ubuntu 24.04 LTS
- Location: Bangor, NI
- Contact:
Re: BT's Sager PHP Script V2 - For Cumulus
I maybe mistaken but current conditions I think was this script: viewtopic.php?t=12831
Regards Simon
https://www.conligwx.org - @conligwx
Davis Vantage Pro2 Plus with Daytime FARS • WeatherLink Live • Davis AirLink • PurpleAir • CumulusMX v4.0.0
https://www.conligwx.org - @conligwx
Davis Vantage Pro2 Plus with Daytime FARS • WeatherLink Live • Davis AirLink • PurpleAir • CumulusMX v4.0.0
-
- Posts: 118
- Joined: Mon 16 Mar 2020 3:23 am
- Weather Station: Davis
- Operating System: Windows 10
- Contact:
Re: BT's Sager PHP Script V2 - For Cumulus
Simon,
Thank you. Where and how did you create/write the contents to consoleforecast.txt file?
Thank you. Where and how did you create/write the contents to consoleforecast.txt file?
- ConligWX
- Posts: 1635
- Joined: Mon 19 May 2014 10:45 pm
- Weather Station: Davis vPro2+ w/DFARS + AirLink
- Operating System: Ubuntu 24.04 LTS
- Location: Bangor, NI
- Contact:
Re: BT's Sager PHP Script V2 - For Cumulus
Thats done by Meteobridge Nano SD plugged into my Davis vPro2 Console. it processes a template which checks the "Console forecast" shown at the bottom of the screen, writes it to a file.
unfortunately I dont think CumulusMX gets the Davis Console forecast from the vPro2 and Vue consoles.
CumulusMX does have webtags however:
Code: Select all
<#forecast> The current forecast
<#forecastenc> The same as <#forecast> but with all reserved HTML characters, and those above character code 159, encoded as HTML entities
<#forecastJsEnc> Available from version 3.11.0; The current forecast encoded for JavaScript
<#forecastnumber> The number relating to the current forecast entry in the strings.ini file. If your station is not providing it's own forecast and Cumulus is not calculating one then 0 (zero) is returned. Note: two negative numbers can be returned by Cumulus: -1 (neg 1) = Exceptional Fine, -26 (neg 26) = Exceptional Bad
<#cumulusforecast> Always gives Cumulus (Zambretti) forecast, even if the <#forecast> tag provides a station forecast
<#cumulusforecastenc> The same as <#cumulusforecast> but with all reserved HTML characters, and those above character code 159, encoded as HTML entities
<#cumulusforecastJsEnc> Available from version 3.11.0; The current Cumulus (Zambretti) forecast encoded for JavaScript
<#wsforecast> Always gives station forecast (if available)
<#wsforecastenc> The same as <#wsforecast> but with all reserved HTML characters, and those above character code 159, encoded as HTML entities
<#wsforecastJsEnc> Available from version 3.11.0; The current station forecast encoded for JavaScript
Regards Simon
https://www.conligwx.org - @conligwx
Davis Vantage Pro2 Plus with Daytime FARS • WeatherLink Live • Davis AirLink • PurpleAir • CumulusMX v4.0.0
https://www.conligwx.org - @conligwx
Davis Vantage Pro2 Plus with Daytime FARS • WeatherLink Live • Davis AirLink • PurpleAir • CumulusMX v4.0.0
- 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: BT's Sager PHP Script V2 - For Cumulus
It does, but we want to get the Sager forecast into the current conditions file. I'd suggest running the Sager script as an hourly Cron job, and piping the output to the current conditions file
-
- Posts: 118
- Joined: Mon 16 Mar 2020 3:23 am
- Weather Station: Davis
- Operating System: Windows 10
- Contact:
Re: BT's Sager PHP Script V2 - For Cumulus
Almost there!
I have the current Sager forecast text now being written to .txt file each time the <website>index.htm file is accessed.
Now familiarizing myself with how the CMX gauges page to see what I need to do to have the Sager forecast .txt file imported and run in the gauges page ‘LCD’ scrolling display.
Bridge
I have the current Sager forecast text now being written to .txt file each time the <website>index.htm file is accessed.
Now familiarizing myself with how the CMX gauges page to see what I need to do to have the Sager forecast .txt file imported and run in the gauges page ‘LCD’ scrolling display.
Bridge
-
- Posts: 118
- Joined: Mon 16 Mar 2020 3:23 am
- Weather Station: Davis
- Operating System: Windows 10
- Contact:
Re: BT's Sager PHP Script V2 - For Cumulus
Appreciate ‘so-ability’ perspective on either or both options.
This will complete the ability of CMX to show the Sager forecast in the ‘Gauges’ webpage LCD display. As noted on my previous post, code is now in place in the bu-sager.PHP file to generate the current Sager forecast text to the file SagerCurrentForecast.txt (on the host server side).
Option 1: replace the “forecast” web tag text value (on the server side) of realtimegauges file with the text contents of the SagerCurrentForecast.txt file (which is updated by sager-bu.php on the server side each time the file is accessed). This would then put the Sager forecast text into the LCD forecast display on the ‘gauges’ web page.
Or
option 2: could the text contents of SagerCurrentForecast.txt be directly imported into the ‘Gauges’ webpage (on the server side) and modify ‘Gauges’ code to use this imported text to display in the LCD forecast display?
Thank you!
Bridge
This will complete the ability of CMX to show the Sager forecast in the ‘Gauges’ webpage LCD display. As noted on my previous post, code is now in place in the bu-sager.PHP file to generate the current Sager forecast text to the file SagerCurrentForecast.txt (on the host server side).
Option 1: replace the “forecast” web tag text value (on the server side) of realtimegauges file with the text contents of the SagerCurrentForecast.txt file (which is updated by sager-bu.php on the server side each time the file is accessed). This would then put the Sager forecast text into the LCD forecast display on the ‘gauges’ web page.
Or
option 2: could the text contents of SagerCurrentForecast.txt be directly imported into the ‘Gauges’ webpage (on the server side) and modify ‘Gauges’ code to use this imported text to display in the LCD forecast display?
Thank you!
Bridge
-
- Posts: 118
- Joined: Mon 16 Mar 2020 3:23 am
- Weather Station: Davis
- Operating System: Windows 10
- Contact:
Re: BT's Sager PHP Script V2 - For Cumulus
That should read ‘do-ability’ in my msg above
- 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: BT's Sager PHP Script V2 - For Cumulus
Ideally you need the text on the same server as CMX. That is why I suggested a cron job running say once an hour, that either runs the sager script locally, or uses something like curl to get the out from your web server and save it to the current conditions file. Then all you have to do is edit the realtimegaugesT.txt file and replace the forecast tag with currcond.
-
- Posts: 118
- Joined: Mon 16 Mar 2020 3:23 am
- Weather Station: Davis
- Operating System: Windows 10
- Contact:
Re: BT's Sager PHP Script V2 - For Cumulus
Thanks Mark,
All done. All good and running well. Segar forecast now showing in LCD display. It was a great weekend adventure.
Setup of cURL (which is included on Windows 10) was a bit painful. Following examples (on-line) of commands didn’t work. Finally striped the command line sequence to its basics and viola. Updates the website once and hour now.
Bridge
All done. All good and running well. Segar forecast now showing in LCD display. It was a great weekend adventure.
Setup of cURL (which is included on Windows 10) was a bit painful. Following examples (on-line) of commands didn’t work. Finally striped the command line sequence to its basics and viola. Updates the website once and hour now.
Bridge
-
- Posts: 118
- Joined: Mon 16 Mar 2020 3:23 am
- Weather Station: Davis
- Operating System: Windows 10
- Contact:
Re: BT's Sager PHP Script V2 - For Cumulus
Not sure if this anything to do specially with SAGER files..
SAGER files were running OK but now fail at point where a file (PHP) 'require' <filename> command is included. Suspected by running by-sager.php direct and confirmed using the curltest.php.(although this test file says 'cURL is present' it stops at that point) both files stall then they hit this command.
Ideas on this??
Bridge
SAGER files were running OK but now fail at point where a file (PHP) 'require' <filename> command is included. Suspected by running by-sager.php direct and confirmed using the curltest.php.(although this test file says 'cURL is present' it stops at that point) both files stall then they hit this command.
Ideas on this??
Bridge
- ConligWX
- Posts: 1635
- Joined: Mon 19 May 2014 10:45 pm
- Weather Station: Davis vPro2+ w/DFARS + AirLink
- Operating System: Ubuntu 24.04 LTS
- Location: Bangor, NI
- Contact:
Re: BT's Sager PHP Script V2 - For Cumulus
looks like you have a couple of issues on main page... just use "inspect" on your browserTheBridge wrote: ↑Thu 16 Feb 2023 11:29 pm Not sure if this anything to do specially with SAGER files..
SAGER files were running OK but now fail at point where a file (PHP) 'require' <filename> command is included. Suspected by running by-sager.php direct and confirmed using the curltest.php.(although this test file says 'cURL is present' it stops at that point) both files stall then they hit this command.
Ideas on this??
Bridge
You do not have the required permissions to view the files attached to this post.
Regards Simon
https://www.conligwx.org - @conligwx
Davis Vantage Pro2 Plus with Daytime FARS • WeatherLink Live • Davis AirLink • PurpleAir • CumulusMX v4.0.0
https://www.conligwx.org - @conligwx
Davis Vantage Pro2 Plus with Daytime FARS • WeatherLink Live • Davis AirLink • PurpleAir • CumulusMX v4.0.0