tenWare Software

Database Logger for Brultech ECM-12xx

tenEcmDbLogger is a windows program that writes hourly energy consumption data from a Brultech ECM-1220 or ECM-1240 power monitor to an SQLite database. tenEcmDbLogger receives real-time data from the tenEcmServer program, accumulates power data from all ECM-12xx channels, and writes a record to an SQLite database each hour.  tenEcmDbLogger does not have to run on the same computer as tenEcmServer.  The server broadcasts the real-time data in UDP packets that are received by tenEcmDbLogger across your LAN.  The database must reside on the same computer as the tenEcmDbLogger program.

The tenEcmDbLogger program, the database, and all of the database management programs are included free of charge in the installation package.  SQLite was selected as the database because it is freely distributable, requires zero administration from the user, and is small and fast. More information about the SQLite product can be found here

The tenEcmCharts program can be used to display real-time and historic energy consumption reports and charts.  tenEcmCharts uses the data archived by tenEcmDbLogger, and is also distributed free of charge.  tenEcmCharts can access the tenEcmDbLogger database across your LAN, so you could run tenEcmServer, tenEcmDbLogger (and its database), and tenEcmCharts on three different computers on your network  (and the tenHsEcm12xx HomeSeer plugin on a fourth).  In a typical scenario, you might run tenEcmServer and tenEcmDbLogger on the same computer, and run copies of tenEcmCharts on every computer on your network.

tenEcmDbLogger should be running 24/7 in order to capture complete energy consumption data.  You should place a shortcut to the tenEcmDbLogger program in your windows Startup folder.  The program is designed such that no data accumulation is lost when it is stopped and restarted as long as it is running during the transition from one hour to another at the top of the hour.

Installation

Download and run the installation program found later on this page.  To run tenEcmDbLogger for the first time, select the windows menu item: Programs/tenWare/tenEcmServer/tenEcmDbLogger.  The following dialog will be displayed:

tenEcmDbLogger Dialog

The dialog displays where the database resides, which UDP port and interface are being used, and information about the data being received, accumulated and written to the database.  If the database did not exist when tenEcmDbLogger started, an empty database was created.  When you close the dialog, tenEcmDbLogger continues to run, displaying its icon in the system notification area.  Right-click the icon to display the following menu:

tenEcmDbLogger Menu

Select Restore to open the dialog, Exit to terminate the program, or Options to display the following dialog:

tenEcmDbLogger Options

Specify a Timeout value that is significantly higher than the time between expected ECM-12xx transmissions. If you change any of these options, tenEcmDbLogger will terminate.  Restart the program to begin using the new values.

 

Accessing the Database

Although most users will access the database using the tenEcmCharts program, you can easily access the data stored in the database for your own queries or custom developed reports and charts.  The database consists of a single table:  HourlyDataClick here for a description of the columns in table HourlyData.  I would also recommend a shareware tool that simplifies building queries and extracting data, SQLite2009 Pro Enterprise Manager. Here is a .net code snippet that selects and prints the average hourly energy consumption for each hour of the day:

Code Snippet

 

Downloads

 tenEcmDbLogger Version 2.2  4/1/2011

Production release of Version 2

Now supports up to five ECMs

An existing database will be expanded to include columns for 5 ECMs

UI has been completely redesigned

tenEcmServer packets are now queued as received and processed on a separate thread.  Fewer dropped packets.

Requires tenEcmServer version 7.0 or later (recommend installing most recent version)

tenEcmCharts has not yet been updated to support more than one ECM, but it will continue to work properly with the most current versions of tenEcmServer and tenEcmDbLogger.

 tenEcmDbLogger Version 2.1  3/27/2011

Beta release.  Back up your data before installing!

Support added for up to 5 ECMs.  You need to also install the most current version of tenEcmServer.  When this version is first run, new columns will be added to the database and all existing data will be retained. 

 tenEcmDbLogger Version 1.13  11/22/2009

Added option to specify the location (folder and filename) of the database file

 tenEcmDbLogger Version 1.12  7/25/2009

Bug fix:  Should now run on Vista-64

 tenEcmDbLogger Version 1.11  7/18/2009

Bug fix:  When the ECM accumulators reach their max values (1,099,511,627,775 for Ch1/Ch2 and 4,294,976,295 for Auxn, and 16,777,215 for Seconds) they wrap back around through zero. tenEcmDbLogger  was not handling the rollover properly.

 tenEcmDbLogger Version 1.10  6/15/2009

This version will ignore broadcast records for ECM 02  --  will only process records from ECM 01.  This is an interim release to support version 6.2 of tenEcmServer that now supports two ECMs.  Future releases of tenEcmDbLogger will process broadcast records from both ECMs.

You can now double-click the tray icon to restore the dialog.

 tenEcmDbLogger Version 1.9  5/29.2009

tenEcmServer packet validity checking improved

Added debugging log.  Include debug on the command line when starting tenEcmDbLogger.  Log file is written to the desktop.  Command line parameter is NOT case sensitive.

Dropped packets are now logged.

A restart of tenEcmServer is detected and logged.

You can now select Any for the network interface

 tenEcmDbLogger Version 1.6  5/9/2009

Added option to select specific network interface to use.  Defaults if only one nic present.  Some users were receiving multiple packets if there were multiple nics active.

Improved network error recovery.  Added option to specify timeout (in seconds) before the network interface is re-initialized.  Defaults to 60 seconds.  Should be well higher than expected transmissions from ECM-12xx.

 tenEcmDbLogger Version 1.4  5/8/2009

Added message display

 tenEcmDbLogger Version 1.3  5/7/2009 

Minor cosmetic changes

 tenEcmDbLogger Version 1.2  4/29/2009

Initial beta test release