Fs Series SQL Lite v1 0
Fs Series SQL Lite v1 0
EasyIO FS Series
SQLite (History) User Guide
1
FS Series SQLite v1.0
th
11 Jan 2020
Created for FS Series ONLY.
2
FS Series SQLite v1.0
Disclaimer
Confidentiality Notice
The information contained in this document is confidential information of EasyIO Holdings Pte Ltd. Such
information and the software described herein, is furnished under a license agreement and may be used
only in accordance with that agreement.
The information contained in this document is provided solely for use by EasyIO Holdings Pte Ltd employees,
licensees, and system owners; and, except as permitted under the below copyright notice, is not to be released to,
or reproduced for, anyone else.
While every effort has been made to assure the accuracy of this document, EasyIO Holdings Pte Ltd is not
responsible for damages of any kind, including without limitation consequential damages, arising from the
application of the information contained herein. Information and specifications published here are current as of
the date of this publication and are subject to change without notice. The latest product
specifications can be found by contacting our corporate headquarters or support channel.
Trademark Notice
BACnet and ASHRAE are registered trademarks of American Society of Heating, Refrigerating and Air-
Conditioning Engineers. All other product names and services, mentioned in this publication, that are
known to be trademarks, registered trademarks, or service marks are the property of their respective
owners.
Disclaimer
The material in this manual is for information purposes only. The contents and the product it
describes are subject to change without notice. EasyIO Holdings Pte Ltd makes no
representations or warranties with respect to this manual. In no event shall EasyIO Holdings Pte Ltd be liable for
any damages, direct or incidental, arising out of or related to the use of this manual.
3
FS Series SQLite v1.0
FCC Caution
This device complies with Part 15 of the FCC Rules. Operation is subject to the following two conditions: (1) This
device may not cause harmful interference, and (2) this device must accept any interference received, including
interference that may cause undesired operation.
4
FS Series SQLite v1.0
Table of Contents
Introduction ................................................................................................................................................................... 6
Prerequisites .................................................................................................................................................................. 6
SQL Service Limitation ................................................................................................................................................... 6
Memory Size Calculation ............................................................................................................................................... 6
SQL Lite Service .............................................................................................................................................................. 7
SQL Function Blocks ..................................................................................................................................................... 12
SQL administrator page ............................................................................................................................................... 14
SQL Exporter ................................................................................................................................................................ 15
SQL Exporter with email attachment........................................................................................................................... 19
Generate Authentication Key (Auth_key).................................................................................................................... 22
Data Exporter Troubleshooting ................................................................................................................................... 24
SQL History Chart in CPT graphics................................................................................................................................ 25
Time Zone Appendix .................................................................................................................................................... 29
Technical Support ........................................................................................................................................................ 37
5
FS Series SQLite v1.0
Introduction
EasyIO FS Series comes with a built in SQL Lite engine. The SQL Lite engine is capable of storing historical data in to
tables and columns.
These history is created using easyioFGSQL kit.
Prerequisites
1. CPT Tool dated 6th Dec 2019 or later.
2. For FS Series, firmware has to be V3.0b51b or later.
Number of Table + SQL Number of Points for each Total records for each
Functions objects table (columns) column (rows)
50 32 100,000
If COV history is required, do not configure the COV differential to a low value depending to type of real time
value.
For example, if temperature value is trended, do not set the COV different to 0.1 as this will also overload the CPU.
6
FS Series SQLite v1.0
The architecture of the SQL kit is deployed as shown below in Step 2. The SQL service object can be dropped
anywhere in the Sedona app tree. Our recommendation is to create a separate folder and identified as you require.
SQL Service
SQL Table
**Tech Tips**
It is important to make sure the EasyIO FS controller Real Time Clock (RTC) is sync to local date and time and
time zone before proceeding to configure the SQL service in the EasyIO FG Series controller.
To sync the controller on board RTC, double click the time object in the service folder.
Using the graphical interface set the time.
Make sure the timezone is set accordingly as well.
Another option to perform time sync is using the built in NTP service.
This feature can be access via web browser > Plug In > Date and time config.
If the Time Server is the internet , make sure controller has internet connection.
7
FS Series SQLite v1.0
Step 1
Connect to the controller with CPT Tool.
Default login credentials are as below;
IP address : 192.168.10.12
Username : admin
Password :<no password>
Step 2
Choose easyioFGSQL from library.
Drag & drop the SQLLite3Service into your App. The object can be dropped in the EasyIO folder or a new folder can
be created for the SQL service.
In the example below, the object is dropped into a new folder named “SQL”.
Step 3
Double click the SQLlite3 to access the property sheet.
The database name is auto created. It is “easyio.db” and is not editable.
For FS Series the database is stored in the on board flash memory.
Step 4
Drag and drop the SQLTable object into the SQLlite3 service.
This will create a table in the SQL Lite database.
You can have multiple tables in the SQL database up to 50 tables.
8
FS Series SQLite v1.0
Step 5
Click the table object to access property sheet.
Enable the table.
Configure the record type either Interval or COV. If Interval record type is selected, configure the interval period.
Configure the max record lines. Maximum of 100,000 records can be stored.
Give the table a name. Max character allowed is 31.
***Tips***
DO NOT name the table “history ” to avoid issue in dashboard.
DO NOT use SPACE. You can use camelCase as word separator.
Step 6
Drag and drop the SQL object (column object) to create a column in the table.
There are 3 types of SQL object supported which is Boolean, Float and Integer.
Multiple columns can be created in a single table object.
A maximum columns per table is up to 32 columns.
***Note***
You can have up to 50 tables
You can have up to 32 columns (value) in each table
Step 9
Make a link from any object within the Sedona apps to the SQL object t for history trending.
In the exercise below a Ramp object is linked to the SqlFloat object.
Step 10
If the configurations are properly done, the IsReady property of the table will display true.
At the status property it will display error messages if configuration is invalid.
Make the correction according to the error messages.
10
FS Series SQLite v1.0
Step 11
Right click at the table (each table) object > Action > Sync Structure.
The actions will create the table in the SQL database and start the history trending.
The “Table Name” property will display the table name given if update table is successful.
Current record property will display a number =>0 instead of -1 if trending has started.
Step 12
The SQL Service will start to trend into the SQL Database.
11
FS Series SQLite v1.0
In later easyioFGSQL kit it has an object called SQLFunc. This object is a very powerful object where it runs a
handful of SQL query into the SQL database.
The architecture of the SQL functions is part of the SQL Service object. It has to be a child of the SQL Service.
An error message will display if the object is dropped under an invalid parent.
SQL Service
Assuming the SQL configurations are done according to above “Configuring the SQL” to run the SQL query is
simple as drag and drop the SQLFunc object under the SQL service object.
Step 1
Drag and drop the SQLFunc object under the SQL service object.
Users can have multiple SQLFunc object under the SQL service parent.
A limit of 50 SQLFunc objects are allowed including the SQL table objects.
Step2
Click at the SqlFunc object and configure the property of the query.
Enable the object by setting to true.
Debug property is for internal use. Leave it as false.
The “Is Ready” property will display as true if the object is ready for query.
12
FS Series SQLite v1.0
Step 3
Configure the Table name and Column name. These properties are case sensitive. It has to exactly the same as
what been created previously in configuring the SQL object.
The tableName and columnName is the actual name in the SQL db itself. It is not the Sedona object name.
Step 4
Configure the query time period.
Last Read property displays the most recent query execution time.
Interval is the time period for the object to execute the query. A 15 minutes interval means that the object will
execute the query every 15mins. If interval is selected weekStartDay, startDate, startTime and other properties
has no meaning. They will be ignored.
Step 5
Choose the SQL function from the drop down menu.
Function Remarks
Total Summation of all the data according to time period selection
Average Average of all the data according to the time period selection
Count Total records count according to the time period selection
Min Minimum Value according to the time period selection
Max Maximum Value according to the time period selection
Delta Difference between the first data and the last data according to the time period selection
Step 6
The SQL function object will start to execute the query once all the properties are set correctly.
13
FS Series SQLite v1.0
Launch the web browser and put in the below URL at the address bar.
http://DEVICE_IP/sdcard/phpliteadmin.php
username : admin
password : hellocpt
**Tech Tips**
By default the password for the SQL admin page is hellocpt.
The SQL admin page is using the CPT web graphics admin user password.
If you have change the CPT graphics admin user password please use that password.
If CPT 27th Feb 2017 is being used to perform a full deployment, you can access the SQL Lite administrator page via
the CPT graphics utilities shortcut menu.
14
FS Series SQLite v1.0
SQL Exporter
Every EasyIO FS series come built in with a SQL database exporter.
Data exporter is a tool for user to extract data from the SQL database.
Users can run the query directly in any web browser or creating a macro in an excel sheet.
General script
http://DEVICE_IP/sdcard/cpt/app/data_exporter.php?table=TableNameHere&PARAM=VALUE&auth_key=xxxx
Where;
columns Data column name that is created under the SQL table object.
Case sensitive.
If not specify will return all data (all columns).
save_to_local Specify the file name, exporter will trigger an automatic download process and
save the file into the EasyIO FG micro SD card.
Example : last_n_row=100
Gives you the last 100 records from the time the query is called.
dt_tz Exporter will return the data according to the time zone specify.
15
FS Series SQLite v1.0
Refer to appendix for all time zone format. Copy the time zone required and paste
into the query.
Example : dt_tz=Asia/Kuala_Lumpur
Exporter will return the date time column to match with the time zone Asia Kuala
Lumpur , GMT +8.
If not specify, exporter will return UTC time zone.
dt_period Exporter will only export data within the specify time period.
Options are as tabulated below.
1. today
2. yesterday
3. last_24hr
4. week_to_date
5. last week
6. month_to_date
7. last_month
8. year_to_date
9. last_year
If not specify exporter will return all data.
dt_after Exporter will only export data after the specify time (including) to the last latest
record.
Where
YYYY = year , 4 digits.
MM = month , range between 1 to 12
DD = date , range between 1 to 31
hh = hour , range between 00 to 23 (24 hours format)
mm = minute , range between 00 to 59
ss = second , range between 00 to 59
dt_before Exporter will only export data before the specify time (including) to the last oldest
record.
Where
YYYY = year , 4 digits.
MM = month , range between 1 to 12
DD = date , range between 1 to 31
hh = hour , range between 00 to 23 (24 hours format)
mm = minute , range between 00 to 59
ss = second , range between 00 to 59
example : true_text= On
16
FS Series SQLite v1.0
this parameter will search for any value that is true and will replace with On when
displaying the results.
false_text replace any boolean column in FALSE value with given text
TRUE value by default is 0
Example 01
http://192.168.10.11/sdcard/cpt/app/data_exporter.php?table=Test&auth_key=abcdef12345
This command line when entered in the browser will return all the data from the table Test.
If table consist of 6 columns, it will return 6 columns and data are from oldest to newest.
Time zone is UTC time zone.
Example 02
http://192.168.10.11/sdcard/cpt/app/data_exporter.php?table=Test&column=Float&auth_key=abcdef12345
This command line will return all the data from the table Test but only 1 column which is the Float column.
Data are from oldest to newest.
Time zone is UTC time zone.
Example 03
http://192.168.10.11/sdcard/cpt/app/data_exporter.php?table=Test&columns=dt,Float&auth_key=abcdef1234
5
This command line will return all the data from the table Test with 2 columns which is the dt (dateTime) column
and Float column (data column).
Data are from the oldest to newest.
Time zone is UTC time zone.
Example 04
http://192.168.10.11/sdcard/cpt/app/data_exporter.php?table=Test&columns=dt,Float&dt_period=yesterday&
auth_key=abcdef12345
This command line will return all the data from the table Test with 2 columns which is the dt (dateTime) column
and Float column (data column).
Data period is yesterday 0000 hrs to 2359 hrs.
17
FS Series SQLite v1.0
Example 06
http://192.168.10.11/sdcard/cpt/app/data_exporter.php?table=Test&columns=dt,Float&dt_period=yesterday&
dt_tz=Asia/Kuala_Lumpur&format=csv&file=true&auth_key=abcdef12345
This command line will return all the data from the table Test with 2 columns which is the dt (dateTime) column
and Float column (data column).
Data period is yesterday 0000 hrs to 2359 hrs.
Time zone is Kuala Lumpur time zone. The exporter will automatically convert the UTC time and display the time
zone selected.
The exporter will trigger an automatic download the query results and convert it to comma separated value (csv)
file.
The CSV file will be named “data_20140529.csv” displaying the date, 29th May 2014.
18
FS Series SQLite v1.0
Step 1
Make sure the email service is configured according to the EasyIO FG Series Email service use guide.
Make sure the firmware (build 51b firmware or later) and the easyioFGMail kit (1.0.45.51.33 or later) is installed.
Step 2
Drag and drop attachment object into the Sedona apps.
The object can live freely within the apps.
The object is not necessary to be in the same folder as the SMTP service.
Step 3
Configure the attachment object with the export criteria.
Each attachment object will only perform successfully if the exporter URL is correct.
The exporter URL is simplified for this object.
The minimum requirement for the attachment to work is as below, where an auth_key and save_to_local and
format=csv is compulsory.
auth_key=abcdefghi&save_to_local=abc&format=csv¶m1=value¶m2=value
Additional parameters can be added to specify table, column or date and time to the string above.
Below is an example of the URL used in an attachment object.
19
FS Series SQLite v1.0
Note that only partial of the query is required as compare to web browser URL query.
In the example above the URL will perform a CSV file download to the SD card storage containing data from
Table01 with only the last 30 records.
**Tech Tip**
To make sure the email with attachment works properly, it is best to test the URL query in web browser so that it
triggers a save of csv file format.
If the URL works in web browser, then it will work in email attachment object.
20
FS Series SQLite v1.0
Step 4
User can either choose the trigger option from Trigger only, Daily, Weekly or Monthly.
Trigger Only This option is triggered with the Trigger property or action trigger.
Step 5
The comma separated value file is saved to the SD card. The file will be overwritten every time this query is
perform.
Optionally user can customized the email body at the emailMsg property.
Step 6
The attachment email will be in a XXX.csv.gz where XXX.csv is the file name and the extension is a linux zip file
*.gz.
Use any extractor to extract the data.
21
FS Series SQLite v1.0
Step 1
Make sure latest CPT is used to perform a full deploy the graphics.
Minimum version of CPT required is 16th Dec 2016 release.
Step 2
Assuming the CPT graphics are deployed, login to the controller via browser with the controller IP address.
If the default IP address is used then it should be 192.168.10.11
Step 3
At the login page, put in username = admin and password = hellocpt
Only admin user can create or edit the key strings.
This is for security purpose.
Step 4
Once login go to manage account.
Step 5
Click manage at the AuthKey column at the pop up window.
22
FS Series SQLite v1.0
Step 6
Select the expiry date and put a note to your new Auth Key for reference purpose.
Click create. The system will automatically generate a 16 characters consist of alphabet and number key.
This key is unique and cannot be used across other controller.
Step 7
Copy the key generated to be used with the SQL data exporter query.
http://192.168.10.12/sdcard/cpt/app/data_exporter.php?table=Test&auth_key=abcdef12345
where
***Notes***
Auth_key is COMPULSORY when graphics is deploy with 16th Dec 2016 or later CPT Tools.
23
FS Series SQLite v1.0
The help guide is also a reference table tabulating all query parameters supported.
24
FS Series SQLite v1.0
Step 1
Make sure all the SQL tables and columns are configure properly according to above chapter.
Step 2
In the CPT graphic page drag and drop a historyLineChart widget.
Step 3
Click the history line chart widget to display the properties.
Put in the table name and column name.
**Note that the table name property is the SQL table name and NOT the table object name. **
**Note that the colNameOfLine1 property is the SQL column name and NOT the column object name. **
25
FS Series SQLite v1.0
Step 4
Remember to perform a full deploy or deploy for every changes made.
26
FS Series SQLite v1.0
Step 5
To view the History Chart login to the controller web.
X-axis scale is automatically scaled according data min and max value.
Y-axis scale is automatically scaled according to the date time filter option.
Several time range options are provided for filtering purpose.
27
FS Series SQLite v1.0
Step 6
The chart can be zoom in by click and drag the require time range.
28
FS Series SQLite v1.0
http://192.168.10.11/sdcard/cpt/app/data_exporter.php?table=Test&columns=dt,Float&dt_period=yesterday&dt
_tz=Africa/Abidjan
29
FS Series SQLite v1.0
30
FS Series SQLite v1.0
Time
America/Detroit EST EST -05:00:00
America/Dominica AST AST -04:00:00
America/Edmonton MST MST -07:00:00
America/Eirunepe ACT ACT -05:00:00
America/El_Salvador CST CST -06:00:00
America/Fortaleza BRT BRT -03:00:00
America/Glace_Bay AST AST -04:00:00
America/Godthab WGT WGT -03:00:00
America/Goose_Bay AST AST -04:00:00
America/Grand_Turk EST EST -05:00:00
America/Grenada AST AST -04:00:00
America/Guadeloupe AST AST -04:00:00
America/Guatemala CST CST -06:00:00
America/Guayaquil ECT ECT -05:00:00
America/Guyana GYT GYT -04:00:00
America/Halifax AST AST -04:00:00
America/Havana CST CST -05:00:00
America/Hermosillo MST MST -07:00:00
America/Indiana/Indianapolis EST EST -05:00:00
America/Indiana/Knox EST EST -05:00:00
America/Indiana/Marengo EST EST -05:00:00
America/Indiana/Vevay EST EST -05:00:00
America/Indianapolis EST EST -05:00:00
America/Inuvik MST MST -07:00:00
America/Iqaluit EST EST -05:00:00
America/Jamaica EST EST -05:00:00
America/Jujuy ART ART -03:00:00
America/Juneau AKST AKST -09:00:00
America/Kentucky/Louisville EST EST -05:00:00
America/Kentucky/Monticello EST EST -05:00:00
America/La_Paz BOT BOT -04:00:00
America/Lima PET PET -05:00:00
America/Los_Angeles PST Pacific Standard -08:00:00
Time
America/Louisville EST EST -05:00:00
America/Maceio BRT BRT -03:00:00
America/Managua CST CST -06:00:00
America/Manaus AMT AMT -04:00:00
America/Martinique AST AST -04:00:00
America/Mazatlan MST MST -07:00:00
America/Mendoza ART ART -03:00:00
America/Menominee CST CST -06:00:00
America/Merida CST CST -06:00:00
America/Mexico_City CST CST -06:00:00
America/Miquelon PMST PMST -03:00:00
31
FS Series SQLite v1.0
32
FS Series SQLite v1.0
Technical Support
37