Monthly log files: Difference between revisions

From Cumulus Wiki
Jump to navigationJump to search
1,809 bytes added ,  15:59, 2 November 2018
m
Text replacement - "http://sandaysoft.com/forum/" to "https://cumulus.hosiene.co.uk/"
m (→‎Viewing monthly log files: added location of header file)
m (Text replacement - "http://sandaysoft.com/forum/" to "https://cumulus.hosiene.co.uk/")
(One intermediate revision by one other user not shown)
Line 1: Line 1:
Files are automatically created with names in the form <Month><Year>log.txt (for example, the file for August 2009 is called <tt>Aug09log.txt</tt>); an entry is made to the current month's file every ''ten'' (default value; you can change this on the station settings screen) minutes, recording the current sensor values. The file is in comma-separated format with one line per entry.
This article is about the log file that contains the values at whatever interval you have set for Cumulus to keep detailed logging. The main files are automatically created with names in the form <Month><Year>log.txt (for example, the file for August 2009 is called <tt>Aug09log.txt</tt>); an entry is made to the current month's file every ''ten'' (default value; you can change this on the station settings screen) minutes, recording the current sensor values. The file is in comma-separated format with one line per entry.


Times in these files are in the form hh:mm using the 24 hour clock and local time (system time).  All data is logged in the units which which have been selected by the user on the station configuration screen. Note that 'comma-separated' does not necessarily mean that a comma is used to separate the values! If your PC uses a semicolon for the list separator, that will be used in these files. Similarly, decimals use the Windows decimal separator.
See [[speciallog.txt]] for the equivalent log file for detailed logging of internal temperature and humidity.
 
Times in these files are in the form hh:mm (Cumulus will not be able to understand the file if you edit the time to a format that includes seconds) using the 24 hour clock and local time (system time).  All data is logged in the units which which have been selected by the user on the station configuration screen. Note that 'comma-separated' does not necessarily mean that a comma is used to separate the values! If your PC uses a semicolon for the list separator, that will be used in these files. Similarly, decimals use the Windows decimal separator.  


For ''more information'' on these files see in the '''Cumulus help''' file, in the section “The Data log file”.  
For ''more information'' on these files see in the '''Cumulus help''' file, in the section “The Data log file”.  
Line 16: Line 18:
==How can Monthly log files be used within Cumulus?==
==How can Monthly log files be used within Cumulus?==
===Uploading current log to your website===
===Uploading current log to your website===
The current monthly log can be updated at your usual website update interval using ''<currentlogfile>'' on the '''Files''' tab of the ''Internet Settings'' screen off the '''Configuration''' menu (or by specifying the parameter 'ExtraLocal[0-99]=<currentlogfile>' in [[Cumulus.ini#Section:_FTP_Site]]).  You can also use <currentlogfile> as part of the remote file path, as explained in the Cumulus '''Help'''.  It is recommended that your remote file is local so the updating can use copy and you do not have FTP ticked to avoid conflict with logging - see [http://sandaysoft.com/forum/viewtopic.php?f=4&t=12721&p=99793#p9979 support forum here] for a suggested method.
The current monthly log can be updated at your usual website update interval using ''<currentlogfile>'' on the '''Files''' tab of the ''Internet Settings'' screen off the '''Configuration''' menu (or by specifying the parameter 'ExtraLocal[0-99]=<currentlogfile>' in [[Cumulus.ini#Section:_FTP_Site]]).  You can also use <currentlogfile> as part of the remote file path, as explained in the Cumulus '''Help'''.  It is recommended that your remote file is local so the updating can use copy and you do not have FTP ticked to avoid conflict with logging - see [https://cumulus.hosiene.co.uk/viewtopic.php?f=4&t=12721&p=99793#p9979 support forum here] for a suggested method.


A script can then read the file into a database (see [[ImportCumulusFile]]), or an array, for further processing.
A script can then read the file into a database (see [[ImportCumulusFile]]), or an array, for further processing.


CAUTION: Be aware if you tick FTP to upload this file to a remote server, there can be conflict between the thread that Cumulus uses to run FTP and the independent thread that Cumulus uses to log the latest observations into this file.  There is a danger that a FTP in progress still has exclusive access and the logging therefore fails e.g. if the interval between FTP is too small or, it is not near the start of the month so, the file is big; see [[FAQ#I_am_getting_I.2FO_error_32_or_I.2FO_error_103]]. An alterative approach is to upload this file just once a day, at a quiet period such as an odd number of seconds after quarter-past midnight using a process scheduled outside Cumulus.
CAUTION: Be aware if you tick FTP to upload this file to a remote server, there can be conflict between the thread that Cumulus uses to run FTP and the independent thread that Cumulus uses to log the latest observations into this file.  There is a danger that a FTP in progress still has exclusive access and the logging therefore fails e.g. if the interval between FTP is too small or, it is not near the start of the month so, the file is big; see [[FAQ#I_am_getting_I.2FO_error_32_or_I.2FO_error_103]]. An alterative approach is to upload this file just once a day, at a quiet period such as an odd number of seconds after quarter-past midnight using a process scheduled outside Cumulus.
== Editing the log file ==
* You can't edit the current log file while Cumulus is running, because Cumulus needs exclusive write access. You can edit the log file for a past month, unless you are looking at past months using Cumulus editors.
* You can't edit any log file with a word processor, as they add control characters and other information that Cumulus cannot understand.
* You can use either a specialised comma separated value file editor or a text editor.
* Text editors designed for programmers will allow you to select the encoding (Cumulus will be confused by any Byte Order Mark, so select the encoding type without BOM).
* If you choose to use a spreadsheet, ensure that all columns are treated as normal text, do not let (don't accept Excel default) the spreadsheet recognise the first field contains a date as it will convert that column into a number (e.g. days since 1900 or days since 1970). For example in Libre Office make sure that "Detect special numbers" is not selected.  Many spreadsheets will offer a CSV option for saving the file (in Libre Office tick "Edit Filter Settings" on "save as ...").
* If you amend a field, ensure that replacement is same format as original (same decimal separator if not integer).
* Ensure no blank lines, and if you have added in the column headings then remove that heading line when saving ready for Cumulus.
You can see [[#Manipulation outside Cumulus]] below for more information.


===After you have edited (or created any missing) Monthly log files, you can:===
===After you have edited (or created any missing) Monthly log files, you can:===

Navigation menu