Recent history: Difference between revisions

4,735 bytes removed ,  30 September 2022
m
 
There are a number of internal calculations, such as calculating [[Average temperature]], [[Heat/cold degree days and Chill hours]], which use the recent history data stored in the Recent History Database for CumulusMX. These data are also used for the standard [[MX_Administrative_Interface#Charts|charts]] and the JSON data for the charts on the standard website and many other websites. See: [[:Category:JSON_Files#Uploading_data_to_a_web_server_outside_MX:|Uploading data to a webserver outside CumulusMX ]] .
 
=What happens when I need to stop and restart Cumulus?=
 
Cumulus software has been designed on the assumption that it is left running constantly. However, in practice users do stop and restart the software.
 
This might be for short periods while they upgrade to a new Cumulus release, or reboot their computer because of some issue (or to prevent a possible issue). Also, computers running Microsoft's operating system are periodically rebooted as part of the mandatory software updates.
 
Other people do not want to leave their computer running all the time, and deliberately switch it off when they are not using it for some other purpose.
 
Earlier, it was described how the data for plotting charts, and (in MX anyway) doing some key internal calculations, is derived from recent history data. When you restart Cumulus, you may be able to see the charts can include data plotted from before Cumulus restarted, but that the resolution has changed.
 
Some weather stations have a memory, or separate logging feature, that allows them to store weather data. Cumulus software, for these weather station types, has the option to read these history records from the weather station in its archive data reading process as the software starts. However, it is rare for the weather station to store data every minute, hence the resolution of archive data might be any period between every ten minutes and every 60 minutes, depending on settings. This explains the change in resolution seen on charts, but obviously also affecting the internal calculations you can't see.
 
The recent history data collected while Cumulus is running is lost when you stop Cumulus, unless you are running release 3.12.0 or later, as explained below. If it is retained, obviously it depends how much time has passed with MX stopped, as to how much lies within the 7 day period and can be used after restart.
 
(There are advantages if the weather station logging uses the same period as is set for the various [[Monthly log files]] that Cumulus can update, and MX does include some optional single use functionality to try to force your weather station to use the same interval).
 
==MX release 3.12.0 (beta build 3134) onwards==
 
The recent history is stored in a SQLite3 database table [[cumulusmx.db#Release 3.12.0 onwards|RecentData]] and therefore if you stop MX, the recent history data up to the time MX stopped has become persistent, and is available when MX starts again. Thus the charts, and internal calculations, mentioned above can make use of recent history data from the previous Cumulus session for the period 7 days ago to the time when MX was stopped.
 
When you do restart MX, some data, for the period since the time when MX was stopped, may be available if your weather station can store historic data. On restarting MX can optionally (depending on setting and depending on weather station type) read in archive data from those historic records for that period. As mentioned in last sub-section, this archive data is at the station logging resolution, normally different to the 1-minute interval available while MX is running.
 
If Cumulus MX is offline for a prolonged period, (and when you first run 3.12.0, as the '''RecentData''' table does not yet exist) then all the data for the previous just over 10 thousand minutes will be at this lower station logging interval resolution, as none will be available from the previous run of MX.
 
==MX 3.0.0 to MX 3.11.4==
 
In this release range, MX holds the recent history values in a [https://cumulus.hosiene.co.uk/viewtopic.php?p=100098#p100098 SQLite database], but the database is held '''in-memory''', not as an external database, so it only exists while Cumulus is running. Therefore, if Cumulus stops, all this high resolution data is lost.
 
When you do restart MX, if your weather station can store historic data, then its logger is read during the restart as archive data for the period from 7 days ago until the time of restart, and obviously only available at the station logging interval resolution of that historic data (be it every 10 minutes, or every 30 minutes or whatever).
 
==Legacy builds at versions 1.9.3 and 1.9.4==
 
The 'recent historical data' is stored in an array stored by the Cumulus code, as explained earlier. This means it is lost when the legacy Cumulus is stopped.
 
The only way that the legacy Cumulus can build up the array for the period before Cumulus is restarted is if your weather station includes a memory that stores historical readings. I believe some builds had a bug relating to reading this data into the array, but such data read from your weather can be incorporated into the array elements for 7 days ago until when Cumulus was restarted.
 
=Which weather values are stored?=