Software and CumulusUtils: Difference between pages

From Cumulus Wiki
(Difference between pages)
Jump to navigationJump to search
 
 
Line 1: Line 1:
{|align=right
[[Category:Cumulus MX]] This Wiki page has been created for those who use Cumulus MX. It lists all standard utilities as well as MX itself.
|__TOC__
|}


== Introduction ==
= What is Cumulus MX? =
This is the first page of the CumulusUtils Wiki. From here you should be able to find everything you need to know for this tool.


If needed you can always go to the CumulusUtils Category page (see bottom of this page).
: a cross platform version of Cumulus software that runs on Microsoft Windows, all varieties of UNIX and Linux (including the Raspberry Pi Operating System), and Mac OS X.


== Prerequisites ==
This paragraph describes what is required to use CumuluUtils (To be modified/extended by user experience).
#A working CumulusMX environment on Windows, Linux (RPi) or MacOS
##On Linux (and probably MacOS too) the user must verify whether [[SysInfo#Introduction|the application ''lshw'' has been installed]].
##NOTE: no experience by the author on MacOS exists so be prepared to communicate
#<s>At least 32 days of data</s> This requirement has been dropped.
#For the ''[[Charts_-_Misc_charts|Miscellaneous Charts]]'' more data - a year starting on jan 1 - is required
#For the logfiles:
##<s>A consistent date format, mixed date formats in logfiles are not accepted by CumulusUtils</s> From CMX v4 onwards this is enforced by CMX
##<s>Consistent data and separator use</s> See above
##<s>If a legal date format in a logfile is used which is not implemented, just request it</s> See above
#For longer data series check your locale creates consistent logfile entries and it will be useful to run the [[Software#Create_Missing|CMX supporting application ''CreateMissing.exe'']] beforehand.


== Goals ==
==CumulusMX.exe Usage Restriction==
The goal of ''CumulusUtils'' (abbr: ''Cutils'' or ''CUtils'') is to facilitate website creation for users of CumulusMX without exposure to coding in e.g. PHP or javascript. Having a meteo-website should not be privileged to users with great IT-skills. Making charts should not be demanding for programming skills in SQL or making it otherwise impossible to create charts without diving deep into the technique involved in CumulusMX (which actually is also the case with SQL). Note that this does not mean you can't use IT skills: the user configurable menu offers an opening to expand as far as you wish.


''CumulusUtils'' positions itself as a configurable application for which the understanding of how to run it and how to configure it is the most important thing to know. For configuration ''CumulusUtils'' uses [[Cumulusutils.ini|''cumulusutils.ini'']] file which resides in the CumulusMX directory. If that file does not exist, it will be created. All other files related to ''CumulusUtils'' are in the utils directory.
Both the mandatory [[MX Administrative Interface|MX Interface]], and the optional [[New Default Web Site Information|default MX web site]], include the [https://www.highcharts.com HighStock] product.


The charts are created using [https://www.highcharts.com/ HighCharts] using their [https://shop.highsoft.com/highsoft/form/noncommercialform non-commercial license]. If you want to use the charts or the [[Website Generator]] of ''CumulusUtils'', please make yourself acquainted with this license.
Are you using MX for a non-profit organisation, personal website, or school project?
Then download MX and start using it with Highcharts today.


== Assumptions ==
Are you representing any commercial organisation running a facility that others use? If so, then you cannot use Cumulus MX to share weather data on behalf of your organisation without buying a licence from the High Charts organisation.
The user is assumed to have basic computer skills and knowledge about the Operating System and directory structure. The user must also be aware of the directory infrastructure of CumulusMX and needs to be aware of the meaning of the terms ''webroot'' and ''FTProot'' and ''Working Directory''. The user should be able to understand and edit the ini files (both from ''CumulusMX'' and ''CumulusUtils''). The user should understand the basic functioning of ''CumulusMX'' which means the correct availability of ''CumulusMX'' is a precondition for using ''CumulusUtils''.


Some output files can be used with ''Cumulus 1'' but the charting possibilities rely on the availability of the JSON datafiles of ''CumulusMX''. Therefore the use of ''CumulusUtils'' in combination with ''Cumulus 1'' is limited. The [[Website Generator|website generator]] in combination with ''Cumulus 1'' is not advised.
'''HighCharts rules for usage of their products are described ''' [https://shop.highcharts.com/ on their licence purchase web page], and ''it is your responsibility to ensure compliance''.


== Output ==
== Help with ‘Stable’ MX releases ==
The output of ''CumulusUtils'' consists of mainly of text files (extension: .txt) which are generated on demand. In Cutils idiom [[modules|''modules'']]. These text files can be incorporated in a website the user has or is making. Ultimately when using the [[Website Generator|website generator]] feature, ''CumulusUtils'' generates a complete website, uploaded to the user domain and extendable through a [[User Defined Menu|user defined menu]]. When using the [[ChartsCompiler|''ChartsCompiler'']], the user can define his own charts and place the output where he wants just like other ''modules''.


All output of CumulusUtils is written [[Encoding_in_CumulusUtils|as UTF8 encoded text files]].
If you need any help with Cumulus MX, please first consult, in this Wiki, [[What_to_do_when_I_have_a_problem_with_MX]].


== Installation ==
It is recommended you check you have complied with any instructions in the announcement for the latest MX release in [https://cumulus.hosiene.co.uk/viewtopic.php?f=40&t=17887 the forum] before seeking help (to see what changes in any release affect you, and what actions you may need to take).


# ''CumulusUtils'' is available in a distribution which can be downloaded from the [https://cumulus.hosiene.co.uk/viewtopic.php?f=44&t=17998 forum]. In the CumulusMX directory the user must create a directory utils (case dependent) and must copy the files of the distribution (including the subdirectories) to that directory.
If you wish to research the documentation on MX to try to resolve your problem yourself, use the entry point of the [[:Category:Cumulus MX]] page for pointers to other Wiki pages connected with MX that may help.
# Then, on the domain for the website, the user needs to make two directories in the webroot: 'lib' and 'css'. In addition the distribution directory CUicons must be copied as a whole - with contents - to the webroot.
# Updating ''CumulusUtils'' is done by completely overwriting the contents of the installation directory utils as if it were an installation. If you want to save the old installation, make a copy of the utils directory.
# NOTE a seemingly important issue: the datafiles (the naming and the contents) are dependent for their format on the locale / country setting of your machine. If you install and run from scratch and do not bother CMX will take the country setting from the settings of the computer. You may also give the country setting on the commandline when starting CMX. However, it is important to know that CumulusUtils does not handle datafiles with mixed languages and produces lots of errors. When starting with a new install this is not a big deal. But if you have years of old data which you wish to analyse as well you must consider carefully which country setting of CMX is required. Note that the language setting of CumulusUtils is for display/language handling only and does not affect the reading of the data in any way apart for the monthly log file name. If you use a different locale than the one you use for CMX, the please fill in the parameter ''MonthsOfMiracleAndWonder'' (section [General]) with the abbreviated filenames of the locale you use for CMX.


When installed you are ready to run. The first run after an install or an update MUST be without [[Thrifty - Cutils Command Qualifier|Thrifty]].
If you cannot answer your questions from information in this Wiki (and MX changes so quickly any information here can be very out of date), then use the [https://cumulus.hosiene.co.uk/viewforum.php?f=40 correct MX support forum] and the developer or Cumulus community will offer assistance.


So after installing you have:


The directory structure for utils on the CumulusMX machine is:
== Current Release ==
utils (contents in the distribution)
|--- bin (in the distribution (from 4.7.0 and up))
|--- utilslog (Created by CumulusUtils)


The directory structure for utils on the Website is:
There are ''inter-dependencies between different files'' in the MX release distribution:
* ''Therefore you must always install into your MX folders, every file included in the download zip''.
* If you customise any file that is in the distribution, either give the new file a new name (perhaps add a prefix of "_" in front of files you edit) or place your tailored version in a different folder
** Either approach will ensure your tailored files are not overwritten by files from the download, and let you compare your tailored file with the new file in any future download to see if you need to tweak your tailored file
* When upgrading, it is strongly recommended that you install all files in the download for a new release of MX directly over your existing installation.
** You can take a back-up of any existing installation before you copy in any new files, that will provide you with the ability to regress to the earlier release, if the new release does cause you an issue
** You may end up with some files no longer needed by the new release, left over from older release, but this is better than risking missing some vital files
** You need a good understanding of the use of each file, before considering deleting any file that you think might be obsolete, because not all files that Cumulus uses are contained within the release zip, some are created as it runs.


WebRoot (Content uploaded by CumulusUtils)
|--- lib (JavaScript libraries, uploaded by CumulusUtils during a run)
|--- css (css files, uploaded by CumulusUtils during a run)
|--- CUicons (required to be manually copied once)


===Latest build distribution download===
=== Updating CumulusUtils ===
Updating CumulusUtils is done by completely overwriting the contents of the installation directory utils as if it were an installation. If you want to save the old installation, make a copy of the utils directory. The first run after an install or an update MUST be without [[Thrifty - Cutils Command Qualifier|Thrifty]].


=== Informational files ===
'''IMPORTANT:''' Before installing Cumulus MX v4.0 for the first time, please study and understand [https://cumulus.hosiene.co.uk/viewtopic.php?t=22051 this installation guide]
In the distribution there are some files which are examples or defaults. When used, rename them (and possibly copy manually to the webroot).
<br>
No automatic copying of these files is done by CumulusUtils.
~ Download [https://github.com/cumulusmx/CumulusMX/releases/download/b4023/CumulusMXDist4023a.zip Cumulus MX v4.0.1 build 4023, 16-May-2024]


Beside the libraries the distribution contains:
===Latest MX Source Code===
#CUserAbout-example.txt : as an example of the user about file - when used rename to ''CUserAbout.txt''
#CutilsMenu-example-for-use.def : as an example of the menu structure - when used rename to ''CutilsMenu.def''
#CutilsCharts-default-for-use.def : when used rename to ''CutilsCharts.def''
#CutilsCharts-examples.def : not intended for direct use, contains some more elaborate examples of the [[ChartsCompiler]] possibilities


To avoid confusion it is left to the user to edit and maintain the files for use either on the website or on the CumulusMX machine.
~ View/download [https://github.com/cumulusmx/CumulusMX Cumulus MX Current Source Code]


=== Manually installing without FTP ===
This source code base is updated for all releases resulting from development by M Crossley, it includes some contributions from other developers.
NOTE: Not using the automatic upload system is disadvised. Because CumulusUtils is datadriven it requires the JSON files and the realtime.txt and realtimegauges.txt from CMX. Besides those, if you are using the UserAskedData feature of CumulusUtils there will be additional JSON files required for the server and without the upload module your will need a way to get them there. There is no copy feature like CMX has as CumulusUtils is designed as a website tool and an upload method is implicitely assumed present. However, manual handling can be done but is not advised.


All required installation and generated files are present in the utils directory and copied with ''FTP'' or ''PHP upload'' to the server during a run of CumulusUtils.
===Raspberry Pi Image===


If you don't use ''FTP'' or ''PHP upload'' you will have to copy manually.
~ Download 32 bit image: [//{{SERVERNAME}}/Downloads/rpi-CumulusMX-lite-3.28.0.zip Raspberry Pi Image for Cumulus MX 3.28.0 x32]
~ Download 64 bit image: [//{{SERVERNAME}}/Downloads/rpi-CumulusMX-lite-3.28.0_X64.zip Raspberry Pi Image for Cumulus MX 3.28.0 x64]


=== Files involved ===
As at April 2022, the image includes Raspberry Pi. O. S. 11 "Bullseye" version of Linux.
The list of installation files required and their destination is below. The generated Javascript files are included in the table:


{| class="wikitable"
<br>
|-
! Distribution File !! Destination !! Remark
|-
| index.html || <webroot>
|-
| CUgauges.js || <webroot>/lib || Despite the same name this file is very different from the one in CMX
|-
| CUlanguage.js || <webroot>/lib
|-
| HighchartsDefaults.js || <webroot>/lib
|-
| suncalc.js || <webroot>/lib
|-
| CUtween.min.js || <webroot>/lib
|-
| CUsteelseries.min.js || <webroot>/lib
|-
| CURGraph.rose.js || <webroot>/lib
|-
| CURGraph.common.core.js || <webroot>/lib
|-
| CUgauges-ss.css || <webroot>/css
|-
! Generated File !! Destination !! Remark
|-
| cumulusutils.js || <webroot>/lib
|-
| HighchartsLanguage.js || <webroot>/lib
|-
| *.txt || <webroot>
|-
| airlinkdataIn2p5.json || <webroot>
|-
| airlinkdataIn10.json || <webroot>
|-
| airlinkdataOut2p5.json || <webroot>
|-
| airlinkdataOut10.json || <webroot>
|-
| extrasensorsdata.json || <webroot>
|-
| customlogsRecentdata.json || <webroot>
|-
| customlogsDailydata.json || <webroot>
|-
| CUserdataRECENT.json || <webroot>
|-
| CUserdataDAILY.json || <webroot>
|-
| CUserdataALL.json || <webroot>
|-
! Realtime Files !! Destination !! Remark
|-
| realtime.txt || <webroot> || Served by CMX [1]
|-
| realtimegauges.txt || <webroot> || Served by CMX [1]
|-
| airlinkrealtime.txt || <webroot> || When the AirLink device is configured [2]
|-
| extrasensorsrealtime.txt || <webroot> || When Extra Sensor devices are configured [2]
|-
| customlogsrealtime.txt || <webroot> || When Extra Sensor devices are configured [2]
|-
| meteocamrealtime.txt || <webroot> || When Extra Sensor devices are configured [2]
|}
[1] : These files may be served by CMX in another directory (just like the CMX JSON data files). In that case the relative location is specified in the inifile parameter ''CumulusRealTimeLocation''.<br/>
[2] : these files are generated in the utils directory and need to be configured as Extra Webfiles in CMX with the ticks: Realtime, Process and FTP. Note that the generated file has the webtags and remains local, the processed files contains the values and must be send to the <webroot>.


== Running CumulusUtils ==
# This is a pre-built disk image file for your first installation onto a Raspberry Pi computer.
# Do read the instructions for using this image on the [[Raspberry_Pi_Image|Raspberry Pi Image]] page to see what is in the image and how to use it
# It is of course possible that sometimes the image provided may have issues for you,
#* it is set up so that MX starts running as a service immediately you boot up your Raspberry Pi, rather than letting you first run MX interactively (see [[MX_on_Linux#Running_MX]]);
#* it is produced with a Raspberry Pi model 3, so with other models you may need to replace the Mono software included in image, and consider what updating rates your model can support;
#* it is produced using a GB locale and GB time-zone, so that automatically started MX may not initially be running correctly for your locale (however as you need to restart MX after changing settings you should be okay when MX starts recording data).


CumulusUtils is - up to v6.x.y - a [https://www.mono-project.com/ ''mono''] executable.
: Please note, this image may not always contain latest MX release, but once you have installed a release of MX on your Raspberry Pi, [[Updating MX to new version|upgrading]] is done using main software download link, as none of the other components in the image need to be upgraded (unless the release announcement states that the new release needs a specific version of Mono).
From v7.0.0 and up it runs under [https://dotnet.microsoft.com/en-us/ ''dotnet (.NET 8)''].


Both environments are very different and not interchangeable. However running CumulusUtils is pretty similar on both environment and mono and dotnet can co-exist on the same machine. See the CMX installation on how to install either mono or dotnet. CumulusUtils assumes the correct installation of either environment.
==Upgrading==


Mono is an open source implementation of Microsoft's .NET Framework based on the ECMA standards for C# and the Common Language Runtime.
: There is an [[Updating_MX_to_new_version#Installer_Option|installer utility]] available to help with upgrading.
''CumulusUtils'' runs on any operating system CumulusMX runs on and it '''MUST''' run in the CumulusMX directory (as ''working directory'').
Running ''CumulusUtils'' is done from the commandline in a command window (under any OS).


''CumulusUtils'' takes one or more commandline parameters (in short: commands) and must be like (see NOTE 1 below; square brackets means ''optional'' so DON'T TYPE THEM):
We strongly advise [[Updating_MX_to_new_version#Introduction_to_upgrading_MX|upgrading]] to the latest release:
* The main developer can most easily offer support if you are using the most familiar recently released build.
* You may wish to wait a few days after a new release comes out, just in case a new release has some bugs
** MX is extremely complex, the developers work on MX edits in their spare time, have settings that suit them, and do not have the full set of sensors that MX can support, so pre-release testing is never perfect
* By switching to latest release, you gain any extra functionality it may offer (although it may not be useful to you), but more importantly you gain fixes of bugs your existing release may have


''utils/bin/cumulusutils.exe [command]'' (the ''mono'' syntax - this assumes mono is already active)


''dotnet utils/bin/cumulusutils.dll [command]'' (the ''.NET'' syntax - ''dotnet'' is obligatory on the commandline. Note the '''dll''')
*Important, please read all of the release notes (in the [https://cumulus.hosiene.co.uk/viewtopic.php?f=40&t=17887 appropriate forum announcement] threads) for the builds since the version you are upgrading from, especially noting when there are references to necessary once-off actions.
*If you have never upgraded before, or you are currently running a fairly old release of MX, you are advised to read the [[Updating MX to new version]] page in this Wiki,
** you may be recommended to upgrade in stages, as certain releases do essential one off actions that are missed if you skip that release; e.g. rewriting [[Cumulus.ini]] or changes to columns in database tables
** overwriting an existing installation will add any new files, but it won't remove obsolete files, and sometimes [[MX_Basic_info#Library_software|replacement files]] have different names to their predecessors so don't overwrite the old files
*If you are upgrading from a previous version of the legacy Cumulus 1, then you might want to read [[Migrating from Cumulus 1 to MX]] page; and if you need more justification read [[Compare_C1_and_MX|Compare legacy Cumulus and MX]] page
** However, it is likely that information on those pages was written for earlier MX releases, and might be out of date, so like many other people you might want to ask in the [https://cumulus.hosiene.co.uk/viewforum.php?f=40 correct MX support forum] to see if others have more up-to-date advice.


Below is described for ''mono'', when using .NET, please change the command as above. Note you will have to carry this on in scripts as well. Using the dotnet command in crontab requires using the explicit path to the dotnet command or defining the PATH environment variable in the crontab script which does not know the environment (a bit awkward).
Note by Steve Loft: you may find that anti-virus software flag a new release of Cumulus as a ‘threat’, for a few days or weeks after a new version has been released, even though it does not actually contain a virus of any kind. This is due to a system they call ‘reputation’ where they automatically block any versions of software that have recently been released. You may want to consider complaining to the provider of your anti-virus software about this ridiculous system, or better still, use some better anti-virus software.


If no commands are given the application responds with:
==Older releases==


''CumulusUtils : No Arguments nothing to do. Exiting. See Manual.
It is always possible that a new release introduces a bug, and you decide to regress to an earlier release.
CumulusUtils Usage : utils/bin/cumulusutils.exe [args] (args case independent):
utils/bin/cumulusutils.exe
[ [[SysInfo]] ] [ [[Forecast]] ] [ [[StationMap]] ] [ [[UserReports]] ] [ [[MeteoCam]] ]
[ [[pwsFWI]] ][ [[Records - Top10|Top10]] ][ [[Graphs]] ][ [[Yadr]] ][ [[Records]] ]
[ [[NOAA]] ][ [[Records - DayRecords|DayRecords]] ][ [[AirLink]] ][ [[UserAskedData]] ]
[ [[ChartsCompiler|CompileOnly]] ] [ [[Extra Sensors|ExtraSensors]] ] [ [[Custom Logs|CustomLogs]] ] [ [[CumulusUtils Runtime Library|CUlib]] ]
| [ [[Thrifty - Cutils Command Qualifier|Thrifty]] ]


OR (in case you use the website generator):
Find link to earlier MX release distributions [https://github.com/cumulusmx/CumulusMX/releases here].
utils/bin/cumulusutils.exe [ [[Thrifty - Cutils Command Qualifier|Thrifty]] ] [[Website Generator|Website]]


All ''modules'' mentioned in the command will be described in their own pages here on the wiki and when available will be linked from here.
(You can search using the history tab on this Wiki page to see which past builds were made available as Raspberry Pi images, as these are not created for all releases, but there is no way to tell if the old filenames can still be downloaded. Generally, it is easiest to download a different normal MX release distribution over whatever MX release was in the image you downloaded.)


The commands represent the ''modules'' the user is asking for to be generated. The output is generated to the utils directory in the ''CumulusMX'' directory. When asking for the generation of the website, the user not only gets all ''modules'' available but also an ''index.html'' file accompanied with some javascript infrastructure. Everything together then is the website which, when copied to the webroot, is ready for use.
= Other utilities =


Commands to CumulusUtils - the module names - are case independent but the author prefers [https://en.wikipedia.org/wiki/Camel_case Upper Camel Case] (or Pascal Case).
==By Mark Crossley==


Copying to the webroot can also be done automatically through the FTP account of the user, much like ''CumulusMX'' itself copies e.g. the realtime.txt or the datafiles to the webroot. The FTP account and domain used are the same as present in the [[Cumulus.ini]] configuration. The PHP upload as exists in CMX can also be used with CUtils and it works exactly the same.
The utilities listed here are only for use with MX, they may be included in the [[#Latest build distribution download|MX release zip]], but links to latest releases without the ''*.dll'' files ("software libraries") needed to run the respective utility, are provided below.


=== Considerations with CMX configuration ===
The "software libraries" are provided in the MX release zip that is stated alongside download link. The different utilities vary with regard to which software libraries they require, and those with technical understanding can check the code sources.
Please note that CumulusUtils requires live data from CumulusMX to display what you expect. To accomplish that you need to configure CMX as follows:


The things it is looking for are realtime.txt and realtimegauges.txt. Those are sent by CMX to the directory you configure in ''Settings=>Web/Upload Site''.
If you are using an earlier MX release than that stated beside a utility download below, upgrade MX to bring in the new "*.dll" files needed, because the utility will not work with the versions of "software libraries" included with earlier MX releases.


In ''Settings=>Internet Settings=>Interval Configuration=>Normal Interval Settings'': Tick both options and set the interval time to enable interval Upload
If you are using a later MX release than that stated, check [https://cumulus.hosiene.co.uk/viewtopic.php?t=17887 the MX release announcements] for all releases since that stated below to see if the "software libraries" have been upgraded, if they have then the respective utility because it has been compiled with older versions of the respective .dll files will probably not work. (Sometimes the names of new .dll files are different to the names of the old .dll files, so an upgrade of MX done by copying files over an existing installation will leave the old files there, in that case the utility might still work by picking up old names).
In ''Settings=>Internet Settings=>Interval Configuration=>Standard File settings'': Disable both options (for CumulusUtils, if you have websites which use those, leave it enabled)
In ''Settings=>Internet Settings=>Interval Configuration=>Graph File Settings'': Enable all (only ''Upload'', use ''Create Local'' only when needed) except the following:
''availabledata.json'', ''dailyrain.json'', ''dailytemp.json'', ''sunhours.json'', ''airquality.json'', ''extra*.json'', ''soil*.json'', ''user*.json'',''co2*.json'' and ''leaf*.json''


In ''Settings=>Internet Settings=>Interval Configuration=>Daily Graph File Settings'': Enable all except ''alldailydegreedaydata.json'' and ''alltempsumdata.json''
=== Migrate Data v3 to v4 ===


In ''Settings=>Internet Settings=>Interval Configuration=>Real time Interval Settings'': Tick both and set interval time to enable realtime Upload
~ The MigrateDatav3to4 ''v1.0.1'' download dated 27 May 2024 [https://github.com/cumulusmx/MigrateData3to4/releases/download/v1.0.1/MigrateData3to4v1.0.1.zip is here].
In ''Settings=>Internet Settings=>Interval Configuration=>Real time Interval Settings'': Tick both ''realtime.txt'' and ''realtimegauges.txt'' for Upload, use ''Create Local'' only when needed.


In ''Settings=>Web/Upload Site=>General Settings'': Tick ''UTF-8 encoding''
A utility to migrate your data files from Cumulus MX v3 format to v4 format.
Read [https://cumulus.hosiene.co.uk/viewtopic.php?t=22051 Cumulus MX Version 4 - IMPORTANT Additional Information] for information on how to use this utility.
=== Create Missing ===


And if you use the ''[[ChartsCompiler]]'' (or plan to use, you may be more selective later when understanding what and how):
~ The CreateMissing ''v1.4.3'' download dated 05 February 2024 (works with MX release of 3.20.0 onwards) [https://github.com/cumulusmx/CreateMissing/releases/download/v1.4.3/CreateMissing-v1.4.3.zip is here].


After selecting the required tables you need to select the variables they may contain:
Check compatibility with the MX release you have running as per notes above. (Although earlier releases of "Create Missing" exist on "github.com/cumulusmx/CreateMissing/releases", their software bugs imply they should not be used). Install into same directory as "CumulusMX.exe".


In Settings=>Station Settings=>Graphs=>Data Series Visibility: Tick all
This MX utility, affects [[Category:Files with Comma Separated Values|Cumulus CSV files]]:
# It will create a new [[dayfile.txt|daily summary (dayfile.txt)]]. If you already have a "dayfile.txt", that is renamed, the new file should include individual fields, and lines, missing from your old file.
# It will read, and where appropriate update, your [[Standard log files|month by month (MMMyylog.txt)]] files.
#* The utility reads the [[Calculate_Missing_Values#Source_value|source values]] in as input values. This utility has the ability to calculate many of the [[Calculate_Missing_Values#Derived_value|derived fields]], so will add any missing derived values to your month by month files as it proceeds.
#* Therefore the utility should be used to add the [[Standard_log_files#Number_of_fields_per_line_varies_by_release|extra fields]] for those months where the input file was produced by Cumulus 1 or an earlier release of MX (which might have populated fewer fields or used a [[Feels_Like#How_to_express_Feels_Like_for_highest_temperatures|different calculation]]).


'''NOTE: You may disable some fields later when you are more acquainted with the system. Disabling tables and field can be especially useful when you are worried about size of transfer and provider limits.'''


If you start using the ''[[ChartsCompiler]]'', you may need the ''[[UserAskedData]]'' command to CumulusUtils. See the [[ChartsCompiler]].
Usage information by the author of the utility can be [https://github.com/cumulusmx/CreateMissing/blob/master/README.md found here.]
* Learn more about this utility by reading the [[Calculate_Missing_Values#CreateMissing.exe|calculate missing]] page in this Wiki.
** Elsewhere on that same page learn when this utility might be useful, and what else you can try.
* Check in the support forum for information about status of bugs in this utility, at time of last updating this paragraph there was an outstanding issue concerning storing the line in dayfile.txt for the first of some months if your rollover time is not midnight.
* For full information about solving problems with your '''dayfile.txt''' file read the [[Amending dayfile|amending daily summary file]] page.


You may want to read about and understand the [[Website_Generator#CumulusRealTimeLocation|''CumulusRealTimeLocation'']]
=== Create Records ===


=== When and why to run ===
~ The CreateRecords ''v0.1.1'' download dated 13 December 2023 [https://github.com/cumulusmx/CreateRecords/releases/download/v0.1.1/CreateRecords-v0.1.1.zip is here].
Running CumulusUtils results in output which represents a static view of the data in a table or graphic format for display on your website (it may even create a complete website). The fact that the output is a static view requires the output to be regenerated when new data is available. Rerunning CumulusUtils is also required when you change anything in the configuration and can't wait to see that change reflected on the site. In general: changes in data and configuration require a rerun.


Reruns for changes of data are typically once per day, just after rollover time. In that sense it is like running a new query.
A utility to create, or recreate, missing [[Correcting_Extremes|extreme records]] from Cumulus MX by parsing your [[dayfile.txt|daily summary (dayfile.txt)]].


There are some exceptions to the daily rule: Sysinfo and [[UserAskedData]]
See the [https://github.com/cumulusmx/CreateRecords#readme Readme on githib]
#Sysinfo: a rerun with Sysinfo is required when you wish to update the system information which can be a requirement from every 10 minutes to once per day
#[[UserAskedData]]: provides data for charts which are otherwise not available. Again this is at a user desired frequency which is recommended to be the FTP frequency defined in Cumulus.ini (parameter ''UpdateInterval'' in section [FTP site])


=== Export ''To'' MySQL ===
==== RPi: Using crontab ====
Automating the run of CumulusUtils on the Raspberry Pi is typically done through [https://man7.org/linux/man-pages/man5/crontab.5.html ''crontab'']. Below is the crontab of the author of CumulusUtils to be used as an '''example'''!


===== For dotnet =====
~ The ExportToMySQL ''v1.10.0'' download dated 07 January 2024 (works with release of MX 3.28.1 or later) [https://github.com/cumulusmx/ExportToMySQL/releases/download/v1.10.0/ExportToMySQL-v1.10.0.zip is here.]
05 1 * * * cd /home/CumulusMX; /usr/share/dotnet/dotnet utils/bin/cumulusutils.dll thrifty website
1-51/10 * * * * cd /home/CumulusMX; /usr/share/dotnet/dotnet utils/bin/cumulusutils.dll sysinfo UserAskedData UserReports


===== For mono =====
Check compatibility with the MX release you have running as per notes above. Note that compatibility is needed both with the .dll files and with the columns present in the database table to be updated.
15 1 * * * cd /home/CumulusMX; utils/bin/cumulusutils.exe thrifty website
1-51/10 * * * * cd /home/CumulusMX; utils/bin/cumulusutils.exe sysinfo UserAskedData UserReport


==== Windows: Using the scheduler ====
If you are not using the MX release named above, then other release zips (and source code) for this utility are available at [https://github.com/cumulusmx/ExportToMySQL/releases ExportToMySQL/releases] and each release there is labelled as to which MX release creates default tables with correct columns.
===== How to create a scheduled task =====
Prior to doing this we need to also create the script that the task will use.
Open notepad or your favourite text editor (preferred use: Notepad++).


You can copy paste the below and save as cumulusutils.bat
This utility reads [[MySqlConnect|Settings]] that are also used by "CumulusMX.exe". Parameters supplied to this utility enable it to do ''one of the following actions'' affecting rows not already present on a [[Your Own Server|MySQL, or MariaDB, database server]]:
(It can be a filename of choice but must have extension of .bat, if using windows notepad, underneath the File name: option, will need to set Save as type: option to All Files (*.*). This way when the File name: is set as cumulusutils.bat it will save it as that and not cumulusutils.bat.txt)
# The parameter used is "dayfile", will insert missing rows into a database table that is called "dayfile" (by default, the user can change the name of that table) that (as minimum) has columns named as per the MX default for that table (at CumulusMX.exe release quoted for which the download applies) from the contents of [[dayfile.txt|daily summary (dayfile.txt)]] file
====== Batch file code of cumulusutils.bat ======
# Insert missing rows into a database table that is called "Monthly" (by default, the user can change the name of that table) that (as minimum) has columns named as per the MX default for that table (at CumulusMX.exe release quoted for which the download applies) from the contents of the single file of [[Standard log files|month by month (MMMyylog.txt)]] whose relative path "data/..." is named in the parameter
'''''For v6 and below (running under mono):'''''<br/><br/>
# The parameter used is "monthly", will insert missing rows into a database table that is called "Monthly" (by default, the user can change the name of that table) that (as minimum) has columns named as per the MX default for that table (at CumulusMX.exe release quoted for which the download applies) reading data from the contents of all files of type [[Standard log files|month by month (MMMyylog.txt)]] found in the [[Data folder|data sub-folder]].
REM This batch file script checks for the process CumulusMX.exe is running, if yes, then runs the "cumulusutils.exe", otherwise exit</br>
REM Set the current working session to the folder C:\CumulusMX</br>
cd\</br>
cd C:\CumulusMX</br>
REM Check for CumulusMX.exe is running, if yes goto :runutils, otherwise goto :end</br>
tasklist /FI "IMAGENAME eq CumulusMX.exe" 2>NUL | find /I /N "CumulusMX.exe">NUL</br>
if "%ERRORLEVEL%"=="0" GOTO runutils</br>
GOTO end</br>
REM Set as working directory C:\CumulusMX and run cumulusutils.exe in folder C:\CumulusMX\utils\bin, with the desired command or commands as per the wiki</br>
:runutils</br>
START /D C:\CumulusMX C:\CumulusMX\utils\bin\cumulusutils.exe Website</br>
:end</br>
exit</br>


NOTE: The command shown here is ''Website''. The user can put any command he likes in here (with or without ''Thrifty'') depending on what he wants to achieve. Possibly he has to create multiple tasks (e.g. UserAskedData specifically runs on a higher frequency than website). These commands then require their own batch files.
Installation and usage information by the author of the utility can be [https://github.com/cumulusmx/ExportToMySQL/blob/main/README.md found here.]


'''''For v7 and up (running under dotnet):'''''<br/><br/>
''This new utility replaces the "ExportMySQL.exe" (no "To" in that name) utility included by Steve Loft in his MX beta distributions.'' That is not compatible with any recent MX releases.
REM This batch file script checks for the process CumulusMX.exe is running, if yes, then runs the "cumulusutils.exe", otherwise exit<br/>
REM Set the current working session to the folder C:\CumulusMX<br/>
cd\<br/>
cd C:\CumulusMX<br/>
REM Check for CumulusMX.exe is running, if yes goto :runutils, otherwise goto :end<br/>
tasklist /FI "IMAGENAME eq CumulusMX.exe" 2>NUL | find /I /N "CumulusMX.exe">NUL<br/>
if "%ERRORLEVEL%"=="0" GOTO runutils<br/>
GOTO end<br/>
REM Set as working directory C:\CumulusMX and run cumulusutils.exe in folder C:\CumulusMX\utils\bin, with the desired command or commands as per the wiki<br/>
:runutils<br/>
START /D C:\CumulusMX dotnet C:\CumulusMX\utils\bin\cumulusutils.dll Website<br/>
:end<br/>
exit<br/>


===== Task creation process =====
==By Steve Loft==
Within the Task Scheduler Library
#Create “New Task…” (actions pane), or right click middle pane and choose “Create New Task” (not Create Basic Task).
##On the General tab of the new task (General information about the task).
##Set desired name for the Task (Example name CumulusUtils, can also set description if desired).
##Click “Change User or Group…”.
##Type in here the word system (click on “Check Names” if desired, to confirm it is correct and it should then display as SYSTEM in capitals).
##Click OK to use this user account.
##Note in Security options part of the new task creation process it should now state under. When running the task, use the following user account: NT AUTHORITY\SYSTEM <br/>(Convenient reason for this is that when the task runs, it runs is running as system account and so is not seen popping up on screen when it is running.)
##“Configure for:” not required to be changed, can be changed to version of operating system.
#On the Triggers tab of the new task (Setting when and how often the task runs).
##Click on “New”, to create a new launch time and frequency of the task.
##Begin the task: option should default to “On a schedule”, this is the desired option.
##Under the settings section choose “Daily” option.
##Start: date can be left as is, set the desired start time of the task. Set to “12:00:15 am”.</br>(Reason for this setting with 15 second delay is trying not to compete with CumulusMX upload tasks).
##In the advanced part, enable Repeat task every: and choose desired interval.</br>With the option for a duration of: default setting of “1 day” is used.
##Set Stop task if it runs longer than: to “30 minutes” (if the task runs longer than the time set, it is stopped. This applies to the individually triggered task, and not the overall routine of this scheduled task, with it’s repeating trigger times).
##Confirm that the Enabled options is ticked to make active this trigger routine.
#On the Actions tab (Setting what the task is to do).
##Click on “New…” to create a new action.
##Action: should default to “Start a program” this is correct.
##In the Program/Script: part, type the path to the program to run, or click “Browse” to navigate and select the program to run. (example C:\CumulusMX\batch_files\cumulusutils.bat).
#On the Conditions tab (setting other conditions).
##Under Power, untick Start the task only if the computer us on AC power</br>(This then enables the task to start and run even if on battery. It will automatically untick Stop if the computers switches to batter power.)
#On the Settings tab (additional other settings for the task).
##Confirm ticked for Allow task to be run on demand.
##By default Stop the task if it runs longer than: is already ticket and set as 3 days.Change to 1 hour (the behaviour here is the same as instruction 3.f.)
##Confirm ticked for If the running ask does not end when requested, for it to stop.
##Default setting of “Do not start a new instance” Is OK.
#Click on OK down the bottom to complete and commit the creation of this new task.


===== Customisation =====
Source code for these utilities are not available, therefore they cannot be altered or upgraded.
One can also customise/fine tune the task further by exporting it, default export format is XML. Then can edit in favourite text editor and reimport when done. May be useful in particular for fine tuning the repetition times of the task.


== Additional remarks ==
=== Utility for Fine Offset Stations ===


#(on NOT Windows) When mono is already active (as daemon or from command line in another process) you can start any mono executable without having it prepended by the mono command. As normally (if you did not uninstall it) xsp4 is running as a daemon, mono is always available so you can run mono executables as normal linux executables. You won't notice the difference. However if you don't have the x bit set, you get access refused when trying to execute. Without the x bit set you have to prepend mono as in: ''mono utils/bin/cumulusutils.exe''. Then it executes without the x bit set because then it is an argument to the mono command.
*[//{{SERVERNAME}}/Downloads/SetLogger.zip Set Logger Interval] A utility by Steve Loft to adjust the internal logging interval on Fine Offset stations
#CumulusUtils is written in C#, HTML and javascript. All HTML and javascript is embedded in the C# code and generated on execution of ''CumulusUtils''. The cumuluscharts.txt charts library was based on the cumuluscharts.js originally distributed with ''CumulusMX'', probably the version a bit before April 2020 and has been modified since. With the appearance of the [[ChartsCompiler]] the name cumuluscharts.txt has been preserved but the technique of creating the charts has been changed.
#As CumulusUtils itself runs in the Cumulus directory, the data directory (data) is one level below. CumulusUtils currently uses - a copy of - dayfile.txt, the monthly logfiles and incidentally the alltime.ini file. It also takes information from Cumulus.ini. All output is written to the utils/ subdirectory. All logs are created in the utils/utilslog/ subdirectory. It also uses the AirLink.log and the ExtraLog files in a similar way when the user has such devices.
#The output of CumulusUtils consists of UTF8 encoded text files. They can be brought to your website manually through some ftp tool (e.g. WinSCP) or by using the Extra Web Files functionality in the setting of Cumulus (deprecated) or by using the [[FTP facility]].
#CumulusUtils can output for many languages. See the specific page on [[Language in CumulusUtils|language in CumulusUtils]].
#Development of CumulusUtils started in 9<sup>th</sup> of August 2019 with an initial commit of the Top10 written in C. Development changed rapidly to C# with an initial commit of Top10 on November 19 2019 of version 0.7.0. The rest of the history can be read in the [[Release Notes|release notes]].
#Users can present themselves on the CumulusUtils [[Map - Users of CumulusUtils|usermap]]. Although optional for modules users, the author sees it as payment for the usage of the tool, so please put yourself on the map. For website users it is automatic and obligatory.
#In case of problems there exists [[Errorlogging]].
#''CumulusUtils'' is &copy; Hans Rottier and can be used under the [https://creativecommons.org/licenses/by/4.0/ Creative Commons Attribution License]. At some point the code will be in the public domain under a different license.


'''NOTE''': comments to this series of articles is welcome either by using the Talk feature of the Wiki for that page, direct edit of the article (request an account) or by contacting the author of CumulusUtils [https://cumulus.hosiene.co.uk/memberlist.php?mode=viewprofile&u=9016 HansR] on the [https://cumulus.hosiene.co.uk/viewtopic.php?f=44 forum] or through PM.


[[Category:WebTools]][[Category:User Contributions]][[Category:CumulusUtils]]
=== Weather Display Converter ===

This utility was provided by Steve to convert '''Weather Display''' log files to legacy Cumulus 1 format, download it [https://cumuluswiki.org/a/File:WDconverter.zip here].

Please carefully read the '''readme''' file in the zip. There is a [https://cumulus.hosiene.co.uk/viewtopic.php?f=4&t=10118 forum thread about using this converter with the legacy Cumulus here].

Remember this utility will not support all fields used by MX. It is advised you use [[#Create Missing]] (see above) after using this utility to populate the other fields. If you do find this utility does not work with your MX release, you may need to manually recreate records, etc. using Cumulus 1 formats, and then [[Migrating from Cumulus 1 to MX|Migrate all your files from Cumulus 1 to MX]].

=== WeatherLink Converter ===

This utility was provided by Steve to convert Davis '''WeatherLink''' log files to Cumulus format, download it [https://cumuluswiki.org/a/File:WLconverter.zip here]. Please carefully read the '''readme''' file in the zip to understand how to use this utility.

NOTE: this has nothing to do with Davis ''Weather Link Live'' despite confusing similarity in name.

Basically, this converter utility reads '''.wlk''' files, it creates a folder called '''converted''' into which it places [[Standard log files]] and [[dayfile.txt]] files as used by Cumulus software. You need to be able to manually merge (using a text file editor) the newly created files with any files of same name in your Cumulus [[data folder|'''data''' folder]]. You might also want to read (although not directly related to this converter utility) [[Amending_dayfile#Importing_data_not_recorded_by_Cumulus|Importing_data_not_recorded_by_Cumulus]].

A search on the support forum will reveal various posts on use of this converter. The key topics are:
* [https://cumulus.hosiene.co.uk/viewtopic.php?f=6&t=20017 forum topic about using this converter with MX here]
* [https://cumulus.hosiene.co.uk/viewtopic.php?t=11349 forum topic about using this converter with the legacy Cumulus here].

== Third Party Contributions by other Cumulus Users ==

For files, and add-on's, contributed by Cumulus users, see these Categories (where third party authors may have mentioned what they offer):
# [[:Category:3rd Party Apps]] - contributions for various devices,
# [[:Category:AddOns]] - adding extra functionality,
# [[:Category:WebTools]] - for your web server, and
# [[:Category:User_Contributions]] - key contributions from the user community


=Current MX Developed from =

Cumulus 3 (MX) software was developed as a beta with limited functionality by Steve Loft.
* Steve Loft previously developed Cumulus 2 (where he tested using the C# language, now used for MX)
* Steve Loft created the original Cumulus software (now known as legacy cumulus 1) just for his use, before making it generally available, he then developed it over the next decade to include requirements suggested by thousands of users.
* Steve Loft, the author of Cumulus/Cumulus MX has since fully retired, and stopped providing support, or updates, to any of his software.

==Steve's final beta MX==

You can download below the final Cumulus 3 beta release, as made available by Steve Loft, and also his ''subsequent'' final source code.

If you are able to understand his source code (linked below), and compare it to the latest source code (linked above), you can appreciate the transformation that has taken place in recent years.

*[//{{SERVERNAME}}/Downloads/CumulusMXDist3043.zip Cumulus MX v3.0.0 beta build 3043, 20-Jan-2017] Cumulus MX, a cross platform version of Cumulus 3 which runs on Windows, Linux (including the Raspberry Pi) and Mac OS X (Steve Loft - final release), single zip that includes both "CumulusMX.exe" and "ExportMySQL.exe".
*[//{{SERVERNAME}}/Downloads/CumulusMXSource.zip subsequent updated Cumulus MX Source Code] from Steve Loft. He made the following comments, as he handed the project over to "the community":
**This version of the code is post the last release I made at build 3043 as it includes some extra changes that I have not finalised.
**My source code is offered as my parting gift, completely '''without support''', in the hope that it might be useful to future developers.
**My source code is very badly structured due to the 'Frankenstein' way I cobbled it together from various places. Some of it is a machine translation of parts of Cumulus 1.

= Legacy releases =

See [[Downloads| downloads page]] for full details.

== Cumulus 1 ==

Cumulus 1 software was popular, when it went public in 2004, and its [[Cumulus_Users|usage]] grew very rapidly in the subsequent decade until final 2014 release. Even now (in mid-2022) some people are still using the final release version (and a quite substantial number of public viewable weather sites are still driven by earlier builds).

Be aware, the longer you wait before swapping from legacy to Cumulus MX software; the more that MX will have developed away from the legacy. MX's development has effectively abandoned its former focus on compatibility, so you might encounter more difficulty with [[Migrating from Cumulus 1 to MX|transferring your data files when you migrate]].

In all months of 2020, (when the year selection drop-down provided in all releases of original software reached its limit, and MX gained a substantial increase in functionality), and continuing into mid-2021, there was an avalanche of people who used to use the legacy software successfully swapping to MX. As of mid-2022, the usage of this legacy software is in fast decline, implying fewer people can offer assistance.

The '''installer for the FINAL release of the legacy Cumulus 1''' is available here:
#[//{{SERVERNAME}}/Downloads/CumulusSetup.exe Cumulus 1099 installer] Full set of files within an installer.
#* On the "this period" type, and snow index, screens you can still manually enter any year,but you have to over-type with the full year yourself, outside range 2008 to 2020.
#* You cannot manually regenerate NOAA reports after 2020, but there is no problem with automatic generation.
#[//{{SERVERNAME}}/Downloads/cumulus.1099.2.zip Cumulus 1.9.4 build 1099.2 patch] Patched version of one file (cumulus.exe) to replace that file from above installer
#* Note this is not the full installation package, just one file to replace in the suite of files created by the installer.
#* This patch modifies the drop-down year selectors, (on "this period" screens, for NOAA reports, and for Snow Index) making it easier to choose date entries (patch version 1099.2 was released 28 Jan 2020) up to the year 2030.

=== Legacy Cumulus 1 Resources ===

*[//{{SERVERNAME}}/Downloads/Cumulus%20basic%20installation%20guide.pdf Cumulus installation guide] Instructions for installing Cumulus 1
*[//{{SERVERNAME}}/Downloads/readme.txt Cumulus readme.txt] Please read this before installing or updating Cumulus
*[//{{SERVERNAME}}/Downloads/Cumulus.chm Cumulus help file] The Cumulus 1 help file (this also gets installed when Cumulus is installed)
*[//{{SERVERNAME}}/Downloads/CumulusFR.chm Cumulus help file in French] The Cumulus 1 help file translated into French
*[//{{SERVERNAME}}/Downloads/CumulusRealtime.zip Cumulus Realtime] An obsolete Silverlight (Silverlight is no longer developed or supported by Microsoft) application for displaying 2 extra dials showing real time wind data on the standard Cumulus gauges page (with temperature and rainfall in histogram style) for a web site

=== Special Variants ===

It is '''STRONGLY RECOMMENDED''' that users of Cumulus '''1.9.4 variants''' migrate to Cumulus MX, which has ongoing support by Mark Crossley. The baud rate can be selected within MX as a configuration setting.

*[//{{SERVERNAME}}/Downloads/CumulusSetup1100.zip Cumulus 1.9.4 build 1100 setup] '''Use ONLY if you are an Instromet user''', and your logger operates at 115200 baud, you should use build 1100
*[//{{SERVERNAME}}/Downloads/CumulusSetup1101.zip Cumulus 1.9.4 build 1101 setup] '''Use ONLY if you are an Instromet user''', and your logger operates at 19200 baud, you should use build 1101
*'''NOTE:''' '''These Cumulus 1.9.4 variants will not have any updates in the future.'''
* The patch for Cumulus.exe, cannot be used with these variants
* The menu items with year drop-down selectors will not display years beyond 2020.
**For example, this will happen on manual generation of NOAA-style reports.
**This does not affect any automatic generation of NOAA reports, but does prevent re-generation.

== Cumulus 2 ==

The software for Cumulus 2 alpha release is no longer available.

Revision as of 06:05, 27 June 2024

Introduction

This is the first page of the CumulusUtils Wiki. From here you should be able to find everything you need to know for this tool.

If needed you can always go to the CumulusUtils Category page (see bottom of this page).

Prerequisites

This paragraph describes what is required to use CumuluUtils (To be modified/extended by user experience).

  1. A working CumulusMX environment on Windows, Linux (RPi) or MacOS
    1. On Linux (and probably MacOS too) the user must verify whether the application lshw has been installed.
    2. NOTE: no experience by the author on MacOS exists so be prepared to communicate
  2. At least 32 days of data This requirement has been dropped.
  3. For the Miscellaneous Charts more data - a year starting on jan 1 - is required
  4. For the logfiles:
    1. A consistent date format, mixed date formats in logfiles are not accepted by CumulusUtils From CMX v4 onwards this is enforced by CMX
    2. Consistent data and separator use See above
    3. If a legal date format in a logfile is used which is not implemented, just request it See above
  5. For longer data series check your locale creates consistent logfile entries and it will be useful to run the CMX supporting application CreateMissing.exe beforehand.

Goals

The goal of CumulusUtils (abbr: Cutils or CUtils) is to facilitate website creation for users of CumulusMX without exposure to coding in e.g. PHP or javascript. Having a meteo-website should not be privileged to users with great IT-skills. Making charts should not be demanding for programming skills in SQL or making it otherwise impossible to create charts without diving deep into the technique involved in CumulusMX (which actually is also the case with SQL). Note that this does not mean you can't use IT skills: the user configurable menu offers an opening to expand as far as you wish.

CumulusUtils positions itself as a configurable application for which the understanding of how to run it and how to configure it is the most important thing to know. For configuration CumulusUtils uses cumulusutils.ini file which resides in the CumulusMX directory. If that file does not exist, it will be created. All other files related to CumulusUtils are in the utils directory.

The charts are created using HighCharts using their non-commercial license. If you want to use the charts or the Website Generator of CumulusUtils, please make yourself acquainted with this license.

Assumptions

The user is assumed to have basic computer skills and knowledge about the Operating System and directory structure. The user must also be aware of the directory infrastructure of CumulusMX and needs to be aware of the meaning of the terms webroot and FTProot and Working Directory. The user should be able to understand and edit the ini files (both from CumulusMX and CumulusUtils). The user should understand the basic functioning of CumulusMX which means the correct availability of CumulusMX is a precondition for using CumulusUtils.

Some output files can be used with Cumulus 1 but the charting possibilities rely on the availability of the JSON datafiles of CumulusMX. Therefore the use of CumulusUtils in combination with Cumulus 1 is limited. The website generator in combination with Cumulus 1 is not advised.

Output

The output of CumulusUtils consists of mainly of text files (extension: .txt) which are generated on demand. In Cutils idiom modules. These text files can be incorporated in a website the user has or is making. Ultimately when using the website generator feature, CumulusUtils generates a complete website, uploaded to the user domain and extendable through a user defined menu. When using the ChartsCompiler, the user can define his own charts and place the output where he wants just like other modules.

All output of CumulusUtils is written as UTF8 encoded text files.

Installation

  1. CumulusUtils is available in a distribution which can be downloaded from the forum. In the CumulusMX directory the user must create a directory utils (case dependent) and must copy the files of the distribution (including the subdirectories) to that directory.
  2. Then, on the domain for the website, the user needs to make two directories in the webroot: 'lib' and 'css'. In addition the distribution directory CUicons must be copied as a whole - with contents - to the webroot.
  3. Updating CumulusUtils is done by completely overwriting the contents of the installation directory utils as if it were an installation. If you want to save the old installation, make a copy of the utils directory.
  4. NOTE a seemingly important issue: the datafiles (the naming and the contents) are dependent for their format on the locale / country setting of your machine. If you install and run from scratch and do not bother CMX will take the country setting from the settings of the computer. You may also give the country setting on the commandline when starting CMX. However, it is important to know that CumulusUtils does not handle datafiles with mixed languages and produces lots of errors. When starting with a new install this is not a big deal. But if you have years of old data which you wish to analyse as well you must consider carefully which country setting of CMX is required. Note that the language setting of CumulusUtils is for display/language handling only and does not affect the reading of the data in any way apart for the monthly log file name. If you use a different locale than the one you use for CMX, the please fill in the parameter MonthsOfMiracleAndWonder (section [General]) with the abbreviated filenames of the locale you use for CMX.

When installed you are ready to run. The first run after an install or an update MUST be without Thrifty.

So after installing you have:

The directory structure for utils on the CumulusMX machine is:

 utils			(contents in the distribution)
   |--- bin		(in the distribution (from 4.7.0 and up))
   |--- utilslog	(Created by CumulusUtils)

The directory structure for utils on the Website is:

 WebRoot		(Content uploaded by CumulusUtils)
   |--- lib		(JavaScript libraries, uploaded by CumulusUtils during a run)
   |--- css		(css files, uploaded by CumulusUtils during a run)
   |--- CUicons        (required to be manually copied once)

Updating CumulusUtils

Updating CumulusUtils is done by completely overwriting the contents of the installation directory utils as if it were an installation. If you want to save the old installation, make a copy of the utils directory. The first run after an install or an update MUST be without Thrifty.

Informational files

In the distribution there are some files which are examples or defaults. When used, rename them (and possibly copy manually to the webroot). No automatic copying of these files is done by CumulusUtils.

Beside the libraries the distribution contains:

  1. CUserAbout-example.txt : as an example of the user about file - when used rename to CUserAbout.txt
  2. CutilsMenu-example-for-use.def : as an example of the menu structure - when used rename to CutilsMenu.def
  3. CutilsCharts-default-for-use.def : when used rename to CutilsCharts.def
  4. CutilsCharts-examples.def : not intended for direct use, contains some more elaborate examples of the ChartsCompiler possibilities

To avoid confusion it is left to the user to edit and maintain the files for use either on the website or on the CumulusMX machine.

Manually installing without FTP

NOTE: Not using the automatic upload system is disadvised. Because CumulusUtils is datadriven it requires the JSON files and the realtime.txt and realtimegauges.txt from CMX. Besides those, if you are using the UserAskedData feature of CumulusUtils there will be additional JSON files required for the server and without the upload module your will need a way to get them there. There is no copy feature like CMX has as CumulusUtils is designed as a website tool and an upload method is implicitely assumed present. However, manual handling can be done but is not advised.

All required installation and generated files are present in the utils directory and copied with FTP or PHP upload to the server during a run of CumulusUtils.

If you don't use FTP or PHP upload you will have to copy manually.

Files involved

The list of installation files required and their destination is below. The generated Javascript files are included in the table:

Distribution File Destination Remark
index.html <webroot>
CUgauges.js <webroot>/lib Despite the same name this file is very different from the one in CMX
CUlanguage.js <webroot>/lib
HighchartsDefaults.js <webroot>/lib
suncalc.js <webroot>/lib
CUtween.min.js <webroot>/lib
CUsteelseries.min.js <webroot>/lib
CURGraph.rose.js <webroot>/lib
CURGraph.common.core.js <webroot>/lib
CUgauges-ss.css <webroot>/css
Generated File Destination Remark
cumulusutils.js <webroot>/lib
HighchartsLanguage.js <webroot>/lib
*.txt <webroot>
airlinkdataIn2p5.json <webroot>
airlinkdataIn10.json <webroot>
airlinkdataOut2p5.json <webroot>
airlinkdataOut10.json <webroot>
extrasensorsdata.json <webroot>
customlogsRecentdata.json <webroot>
customlogsDailydata.json <webroot>
CUserdataRECENT.json <webroot>
CUserdataDAILY.json <webroot>
CUserdataALL.json <webroot>
Realtime Files Destination Remark
realtime.txt <webroot> Served by CMX [1]
realtimegauges.txt <webroot> Served by CMX [1]
airlinkrealtime.txt <webroot> When the AirLink device is configured [2]
extrasensorsrealtime.txt <webroot> When Extra Sensor devices are configured [2]
customlogsrealtime.txt <webroot> When Extra Sensor devices are configured [2]
meteocamrealtime.txt <webroot> When Extra Sensor devices are configured [2]

[1] : These files may be served by CMX in another directory (just like the CMX JSON data files). In that case the relative location is specified in the inifile parameter CumulusRealTimeLocation.
[2] : these files are generated in the utils directory and need to be configured as Extra Webfiles in CMX with the ticks: Realtime, Process and FTP. Note that the generated file has the webtags and remains local, the processed files contains the values and must be send to the <webroot>.

Running CumulusUtils

CumulusUtils is - up to v6.x.y - a mono executable. From v7.0.0 and up it runs under dotnet (.NET 8).

Both environments are very different and not interchangeable. However running CumulusUtils is pretty similar on both environment and mono and dotnet can co-exist on the same machine. See the CMX installation on how to install either mono or dotnet. CumulusUtils assumes the correct installation of either environment.

Mono is an open source implementation of Microsoft's .NET Framework based on the ECMA standards for C# and the Common Language Runtime. CumulusUtils runs on any operating system CumulusMX runs on and it MUST run in the CumulusMX directory (as working directory). Running CumulusUtils is done from the commandline in a command window (under any OS).

CumulusUtils takes one or more commandline parameters (in short: commands) and must be like (see NOTE 1 below; square brackets means optional so DON'T TYPE THEM):

               utils/bin/cumulusutils.exe [command]  (the mono syntax - this assumes mono is already active)
               dotnet utils/bin/cumulusutils.dll [command]  (the .NET syntax - dotnet is obligatory on the commandline. Note the dll)

Below is described for mono, when using .NET, please change the command as above. Note you will have to carry this on in scripts as well. Using the dotnet command in crontab requires using the explicit path to the dotnet command or defining the PATH environment variable in the crontab script which does not know the environment (a bit awkward).

If no commands are given the application responds with:

               CumulusUtils : No Arguments nothing to do. Exiting. See Manual.
               CumulusUtils Usage : utils/bin/cumulusutils.exe [args] (args case independent):
                 utils/bin/cumulusutils.exe
                     [ SysInfo ] [ Forecast ] [ StationMap ] [ UserReports ] [ MeteoCam ]
                     [ pwsFWI ][ Top10 ][ Graphs ][ Yadr ][ Records ]
                     [ NOAA ][ DayRecords ][ AirLink ][ UserAskedData ]
                     [ CompileOnly ] [ ExtraSensors ] [ CustomLogs ] [ CUlib ]
                     | [ Thrifty ] 
               OR (in case you use the website generator):
                  utils/bin/cumulusutils.exe [ Thrifty ] Website

All modules mentioned in the command will be described in their own pages here on the wiki and when available will be linked from here.

The commands represent the modules the user is asking for to be generated. The output is generated to the utils directory in the CumulusMX directory. When asking for the generation of the website, the user not only gets all modules available but also an index.html file accompanied with some javascript infrastructure. Everything together then is the website which, when copied to the webroot, is ready for use.

Commands to CumulusUtils - the module names - are case independent but the author prefers Upper Camel Case (or Pascal Case).

Copying to the webroot can also be done automatically through the FTP account of the user, much like CumulusMX itself copies e.g. the realtime.txt or the datafiles to the webroot. The FTP account and domain used are the same as present in the Cumulus.ini configuration. The PHP upload as exists in CMX can also be used with CUtils and it works exactly the same.

Considerations with CMX configuration

Please note that CumulusUtils requires live data from CumulusMX to display what you expect. To accomplish that you need to configure CMX as follows:

The things it is looking for are realtime.txt and realtimegauges.txt. Those are sent by CMX to the directory you configure in Settings=>Web/Upload Site.

In Settings=>Internet Settings=>Interval Configuration=>Normal Interval Settings: Tick both options and set the interval time to enable interval Upload
In Settings=>Internet Settings=>Interval Configuration=>Standard File settings: Disable both options (for CumulusUtils, if you have websites which use those, leave it enabled)
In Settings=>Internet Settings=>Interval Configuration=>Graph File Settings: Enable all (only Upload, use Create Local only when needed) except the following:
  availabledata.json, dailyrain.json, dailytemp.json, sunhours.json, airquality.json, extra*.json, soil*.json, user*.json,co2*.json and leaf*.json
In Settings=>Internet Settings=>Interval Configuration=>Daily Graph File Settings: Enable all except alldailydegreedaydata.json and alltempsumdata.json
In Settings=>Internet Settings=>Interval Configuration=>Real time Interval Settings: Tick both and set interval time to enable realtime Upload
In Settings=>Internet Settings=>Interval Configuration=>Real time Interval Settings: Tick both realtime.txt and realtimegauges.txt for Upload, use Create Local only when needed.
In Settings=>Web/Upload Site=>General Settings: Tick UTF-8 encoding

And if you use the ChartsCompiler (or plan to use, you may be more selective later when understanding what and how):

After selecting the required tables you need to select the variables they may contain:

In Settings=>Station Settings=>Graphs=>Data Series Visibility: Tick all

NOTE: You may disable some fields later when you are more acquainted with the system. Disabling tables and field can be especially useful when you are worried about size of transfer and provider limits.

If you start using the ChartsCompiler, you may need the UserAskedData command to CumulusUtils. See the ChartsCompiler.

You may want to read about and understand the CumulusRealTimeLocation

When and why to run

Running CumulusUtils results in output which represents a static view of the data in a table or graphic format for display on your website (it may even create a complete website). The fact that the output is a static view requires the output to be regenerated when new data is available. Rerunning CumulusUtils is also required when you change anything in the configuration and can't wait to see that change reflected on the site. In general: changes in data and configuration require a rerun.

Reruns for changes of data are typically once per day, just after rollover time. In that sense it is like running a new query.

There are some exceptions to the daily rule: Sysinfo and UserAskedData

  1. Sysinfo: a rerun with Sysinfo is required when you wish to update the system information which can be a requirement from every 10 minutes to once per day
  2. UserAskedData: provides data for charts which are otherwise not available. Again this is at a user desired frequency which is recommended to be the FTP frequency defined in Cumulus.ini (parameter UpdateInterval in section [FTP site])

RPi: Using crontab

Automating the run of CumulusUtils on the Raspberry Pi is typically done through crontab. Below is the crontab of the author of CumulusUtils to be used as an example!

For dotnet
 05 1 * * *  cd /home/CumulusMX; /usr/share/dotnet/dotnet utils/bin/cumulusutils.dll thrifty website
 1-51/10 * * * *  cd /home/CumulusMX; /usr/share/dotnet/dotnet utils/bin/cumulusutils.dll sysinfo UserAskedData UserReports
For mono
 15 1 * * *  cd /home/CumulusMX; utils/bin/cumulusutils.exe thrifty website
 1-51/10 * * * *  cd /home/CumulusMX; utils/bin/cumulusutils.exe sysinfo UserAskedData UserReport

Windows: Using the scheduler

How to create a scheduled task

Prior to doing this we need to also create the script that the task will use. Open notepad or your favourite text editor (preferred use: Notepad++).

You can copy paste the below and save as cumulusutils.bat (It can be a filename of choice but must have extension of .bat, if using windows notepad, underneath the File name: option, will need to set Save as type: option to All Files (*.*). This way when the File name: is set as cumulusutils.bat it will save it as that and not cumulusutils.bat.txt)

Batch file code of cumulusutils.bat

For v6 and below (running under mono):

REM This batch file script checks for the process CumulusMX.exe is running, if yes, then runs the "cumulusutils.exe", otherwise exit
REM Set the current working session to the folder C:\CumulusMX
cd\
cd C:\CumulusMX
REM Check for CumulusMX.exe is running, if yes goto :runutils, otherwise goto :end
tasklist /FI "IMAGENAME eq CumulusMX.exe" 2>NUL | find /I /N "CumulusMX.exe">NUL
if "%ERRORLEVEL%"=="0" GOTO runutils
GOTO end
REM Set as working directory C:\CumulusMX and run cumulusutils.exe in folder C:\CumulusMX\utils\bin, with the desired command or commands as per the wiki
:runutils
START /D C:\CumulusMX C:\CumulusMX\utils\bin\cumulusutils.exe Website
:end
exit

NOTE: The command shown here is Website. The user can put any command he likes in here (with or without Thrifty) depending on what he wants to achieve. Possibly he has to create multiple tasks (e.g. UserAskedData specifically runs on a higher frequency than website). These commands then require their own batch files.

For v7 and up (running under dotnet):

REM This batch file script checks for the process CumulusMX.exe is running, if yes, then runs the "cumulusutils.exe", otherwise exit
REM Set the current working session to the folder C:\CumulusMX
cd\
cd C:\CumulusMX
REM Check for CumulusMX.exe is running, if yes goto :runutils, otherwise goto :end
tasklist /FI "IMAGENAME eq CumulusMX.exe" 2>NUL | find /I /N "CumulusMX.exe">NUL
if "%ERRORLEVEL%"=="0" GOTO runutils
GOTO end
REM Set as working directory C:\CumulusMX and run cumulusutils.exe in folder C:\CumulusMX\utils\bin, with the desired command or commands as per the wiki
:runutils
START /D C:\CumulusMX dotnet C:\CumulusMX\utils\bin\cumulusutils.dll Website
:end
exit
Task creation process

Within the Task Scheduler Library

  1. Create “New Task…” (actions pane), or right click middle pane and choose “Create New Task” (not Create Basic Task).
    1. On the General tab of the new task (General information about the task).
    2. Set desired name for the Task (Example name CumulusUtils, can also set description if desired).
    3. Click “Change User or Group…”.
    4. Type in here the word system (click on “Check Names” if desired, to confirm it is correct and it should then display as SYSTEM in capitals).
    5. Click OK to use this user account.
    6. Note in Security options part of the new task creation process it should now state under. When running the task, use the following user account: NT AUTHORITY\SYSTEM
      (Convenient reason for this is that when the task runs, it runs is running as system account and so is not seen popping up on screen when it is running.)
    7. “Configure for:” not required to be changed, can be changed to version of operating system.
  2. On the Triggers tab of the new task (Setting when and how often the task runs).
    1. Click on “New”, to create a new launch time and frequency of the task.
    2. Begin the task: option should default to “On a schedule”, this is the desired option.
    3. Under the settings section choose “Daily” option.
    4. Start: date can be left as is, set the desired start time of the task. Set to “12:00:15 am”.
      (Reason for this setting with 15 second delay is trying not to compete with CumulusMX upload tasks).
    5. In the advanced part, enable Repeat task every: and choose desired interval.
      With the option for a duration of: default setting of “1 day” is used.
    6. Set Stop task if it runs longer than: to “30 minutes” (if the task runs longer than the time set, it is stopped. This applies to the individually triggered task, and not the overall routine of this scheduled task, with it’s repeating trigger times).
    7. Confirm that the Enabled options is ticked to make active this trigger routine.
  3. On the Actions tab (Setting what the task is to do).
    1. Click on “New…” to create a new action.
    2. Action: should default to “Start a program” this is correct.
    3. In the Program/Script: part, type the path to the program to run, or click “Browse” to navigate and select the program to run. (example C:\CumulusMX\batch_files\cumulusutils.bat).
  4. On the Conditions tab (setting other conditions).
    1. Under Power, untick Start the task only if the computer us on AC power
      (This then enables the task to start and run even if on battery. It will automatically untick Stop if the computers switches to batter power.)
  5. On the Settings tab (additional other settings for the task).
    1. Confirm ticked for Allow task to be run on demand.
    2. By default Stop the task if it runs longer than: is already ticket and set as 3 days.Change to 1 hour (the behaviour here is the same as instruction 3.f.)
    3. Confirm ticked for If the running ask does not end when requested, for it to stop.
    4. Default setting of “Do not start a new instance” Is OK.
  6. Click on OK down the bottom to complete and commit the creation of this new task.
Customisation

One can also customise/fine tune the task further by exporting it, default export format is XML. Then can edit in favourite text editor and reimport when done. May be useful in particular for fine tuning the repetition times of the task.

Additional remarks

  1. (on NOT Windows) When mono is already active (as daemon or from command line in another process) you can start any mono executable without having it prepended by the mono command. As normally (if you did not uninstall it) xsp4 is running as a daemon, mono is always available so you can run mono executables as normal linux executables. You won't notice the difference. However if you don't have the x bit set, you get access refused when trying to execute. Without the x bit set you have to prepend mono as in: mono utils/bin/cumulusutils.exe. Then it executes without the x bit set because then it is an argument to the mono command.
  2. CumulusUtils is written in C#, HTML and javascript. All HTML and javascript is embedded in the C# code and generated on execution of CumulusUtils. The cumuluscharts.txt charts library was based on the cumuluscharts.js originally distributed with CumulusMX, probably the version a bit before April 2020 and has been modified since. With the appearance of the ChartsCompiler the name cumuluscharts.txt has been preserved but the technique of creating the charts has been changed.
  3. As CumulusUtils itself runs in the Cumulus directory, the data directory (data) is one level below. CumulusUtils currently uses - a copy of - dayfile.txt, the monthly logfiles and incidentally the alltime.ini file. It also takes information from Cumulus.ini. All output is written to the utils/ subdirectory. All logs are created in the utils/utilslog/ subdirectory. It also uses the AirLink.log and the ExtraLog files in a similar way when the user has such devices.
  4. The output of CumulusUtils consists of UTF8 encoded text files. They can be brought to your website manually through some ftp tool (e.g. WinSCP) or by using the Extra Web Files functionality in the setting of Cumulus (deprecated) or by using the FTP facility.
  5. CumulusUtils can output for many languages. See the specific page on language in CumulusUtils.
  6. Development of CumulusUtils started in 9th of August 2019 with an initial commit of the Top10 written in C. Development changed rapidly to C# with an initial commit of Top10 on November 19 2019 of version 0.7.0. The rest of the history can be read in the release notes.
  7. Users can present themselves on the CumulusUtils usermap. Although optional for modules users, the author sees it as payment for the usage of the tool, so please put yourself on the map. For website users it is automatic and obligatory.
  8. In case of problems there exists Errorlogging.
  9. CumulusUtils is © Hans Rottier and can be used under the Creative Commons Attribution License. At some point the code will be in the public domain under a different license.

NOTE: comments to this series of articles is welcome either by using the Talk feature of the Wiki for that page, direct edit of the article (request an account) or by contacting the author of CumulusUtils HansR on the forum or through PM.