Category:Cumulus MX: Difference between revisions

m
Line 793: Line 793:


*5. ''Realtime.txt upload''
*5. ''Realtime.txt upload''
** This feature allows you to upload the file that Cumulus recreates on the most frequent basis. MX does not use the realtime.txt file in any of its supplied components, so that file by default is not available on your web server.  
** Cumulus MX can be set to recreate a file called [[Realtime.txt]] on a very frequent basis. The real time interval defines the time from the end of doing one real time update until the start of the next real time update. The file is recreated, in that unlike other log files, MX does not add new rows in each update, the file only ever contains a single line of values.
**There is an option elsewhere (Internet Settings screen) to upload this log file.
***MX does not use this realtime.txt file in any of its supplied components, so that file by default is not available on your web server.  
**This option is an alternative to having that log file on your web server, instead MX updates a database table. In this option MX will put into a database table row, the same values it can put into that log file on recreation.
***There is the ability elsewhere (Internet Settings screen) to upload this log file to your web server, should you wish to use it. The most common use is as a source for Ajax (JavaScript based) updating of web pages on the same very frequent basis.
#If you don't have a table in your database for this upload, first
**The option being described here is an alternative to having that log file on your web server, instead MX in this option MX updates a database table, adding a new row at the same very frequent interval.  
***In this standard option, where you cannot specify which columns to include, MX will put into a database table row, the same set of values it would put into that log file on recreation.
***It is important to stress, this database table has rows added, so it is not equivalent to the uploaded file that contains a single line.
#If you don't already have a table in your database with the right columns for this upload, first
#* Choose Table name - the default table name is "Realtime", but you can choose any other name
#* Choose Table name - the default table name is "Realtime", but you can choose any other name
#*Now move down the screen and click the '''Save''' button, and wait for MX to pop up '''Settings Saved''' message
#*Now move down the screen and click the '''Save''' button, and wait for MX to pop up '''Settings Saved''' message
Line 810: Line 813:


*6. ''Custom upload - seconds interval''
*6. ''Custom upload - seconds interval''
** This feature allows you to specify your own SQL for an upload to be repeated every NN seconds. This caters for when you want something like the values in "realtime.txt" but want to specify your own schema (set of column names) or own interval between updates. Like the other custom options, this might be because you have extra sensors or do not have sensors for all items in standard log file.  
** This feature allows you to specify your own SQL for an upload to be repeated every NN seconds. This caters for when you want something like the values in "realtime.txt" but want to specify your own schema (set of column names) or your own interval between updates (independent of what has been selected for real-time interval). Like the other custom options, this might be because you have extra sensors or do not have sensors for all items in standard log file.  
**Apart from the Save button below all options, there are 3 items specifically for this option:
**Apart from the Save button below all options, there are 3 items specifically for this option:
**# A tick box to enable or disable this upload (so you can leave the SQL recorded, but stop running it when you like.
**# A tick box to enable or disable this upload (so you can leave the SQL recorded in Cumulus.ini for when you want to use it again, but start/stop running it as and when you like).
**# The SQL you want to run, it should include INSERT IGNORE (or REPLACE or UPDATE) to insert a row, the name of the table, the columns to be updated and the values you include in your SQL are expressed as web tags. You can have more than one SQL statement in this box (end each with semi-colon) so you might want to add a delete "DELETE FROM YourTableName WHERE LogDateTime < DATE_SUB(NOW(), INTERVAL 7 DAY);" after your update/insert command to replicate the retention option of the previous feature, in this case deleting rows over a week old.
**# The SQL you want to run, it should include INSERT IGNORE (or REPLACE or UPDATE) to insert a row, the name of the table, the columns to be updated and the values you include in your SQL are expressed as web tags. You can have more than one SQL statement in this box (end each with semi-colon) so you might want to add a delete "DELETE FROM YourTableName WHERE LogDateTime < DATE_SUB(NOW(), INTERVAL 7 DAY);" after your update/insert command to replicate the retention option of the previous feature, in this case deleting rows over a week old.
**# The number of seconds between runs, the default is 10, but if your weather station updates less frequently, maybe you will choose 40 or 60 as the interval. In theory the number of seconds specified here might represent anything between how frequently your weather station reports readings and several hours.
**# The number of seconds between runs, the default is 10, but if your weather station updates less frequently, maybe you will choose 40 or 60 as the interval. In theory the number of seconds specified here might represent anything between how frequently your weather station reports readings and several hours.
5,838

edits