image_alt_text

27

Jan/10

Windows 7 Monitor Power Test

Wednesday, January 27th, 2010

There is a report generator in Microsoft Windows 7 which can help you track down what is being used in terms of power. The report tells you what is stopping the computer going into sleep mode (if sleep mode is turned on) as well as devices that do not “suspend”.

Go to the command line as an administrator. This can be achived by going to Start Menu and typing cmd in the search bar. Search for cmd.exe under Programs, hold Shift key and right click on cmd.exe. At this point you can let go of the shift key and select Run as administrator.

A dialogue box may warn you when starting the the program but OK it to start the program. Type:
powercfg -energy
and press enter to start it. The program will monitor your computer for 1 minute. In this time do what you wish.

Once it has finished it will print out the location of the report which is in a HTML (web page) format. You may need to copy to a suitable folder for your browser to open it.

Tekzilla Daily Tip #511

6

Dec/09

energy@home Project Update v0.4a

Sunday, December 6th, 2009

It’s been a while since I have mentioned the project energy@home I have been working on so I thought I’d share the latest picture of what it looks like.

energy@home 0.4a

I will soon be tagging and release a new version with the major difference form 0.3 is triggers. Triggers allows data only to be captured if certain conditions are met or exceeded. This saves saving data which has not changed much.

Next step is to get pre-triggering working where if a trigger condition is met then the data leading up to the trigger event gets logged and certain amount of data is stored after the trigger. This allows a user to view data leading up to the event, the event itself which caused the trigger and the leading data after the event.

Improvements to the UI is needed to. I would like the graph settings to be more customizable and get the data table to work so users can inspect the raw values for themselves.

Special thanks goes to Chris Noon for data acquisition techniques which lead me to using triggers.

energy@home project page

10

Oct/09

energy@home Mention On GNC#518

Saturday, October 10th, 2009

I sent in an Email to Todd on the Geek News Central Podcast and he kindly linked my project in his show notes which can be found here. You can hear the recording on episode 518 around 1 hour 13 minutes in.

8

Sep/09

Energy@Home Released On Google Code

Tuesday, September 8th, 2009

I have formally uploaded and started using Google Code to host my energy monitor I’m using / developing.

It has been released under the GPL license so feel free to take a look at my messy code and leave some constructive criticism.

http://code.google.com/p/energyathome/

16

Aug/09

Recording CurrentCost Data & Viewing It On The Web

Sunday, August 16th, 2009

Overview

I have (finally) got my project to a working stage so I thought I’d write a bit about it. After buying a CurrentCost CC128 device I was not happy with the software on the Internet for extracting the data. The FDI chip used on the USB cable to the device did not support 64 bit Windows 7 so it crashed on me and the Linux alternatives were basic and look fairly complicated to set up.

Planning

Architecture Diagram

I want the data to be accessed via a web page. I decided to use JavaScript to implement the graphing and AJAX to do a client – server architecture. Also it’s the most popular way of generating dynamic web page which I hope the graph would be done in near real time.

I have not decided what technology for the server side script which would handle the AJAX requests but I ended up using PHP. The PHP script retrieves data from the database, formats it and sends it back to the web page to be graphed.

I have a LAMP stack configuration so I’m using an Apache web server with a MySQL database. All the device data will be stored in the database by a another script which I wanted to use Python for.

The Python script listened for the XML strings sent via a USB cable from the CurrentCost device. The script would then extract the data from XML and store it into the database.

From the start I wanted my software to run on a Linux based system because I want a server at home running on Linux 24/7. This would allow my other devices to be freely turn it self off etc. Also most of other services were on Linux.

Implementation

The FDI chip from the USB cable takes care of the USB to Serial conversion which makes reading data a lot easier but also it uses an up to date connection. Using a terminal and example XML documents found on the web I could see what the XML format looks like. All data is sent every 6 seconds over USB to a serial port. Ever 1 minutes past the hour e.g 15:01 historical data is sent over the cable or by pressing a button on the device.

Once received the Python script parses the XML, extracts data it needs and inserts it into the database.

When a user views the web page, an asynchronous request is sent to the PHP server side script, gets the data from the database and returns it to the web page. The web page then formats it correctly to be parsed into a JavaScript Graph. The web page is currently set to refresh every 10 seconds but this may change depending on how the server holds up.

Graph

Problems

At the moment there are loads of problems and improvements that can be done. This is just a brief post of what I have so far. The Python script can’t handle the historical data and falls over so it won’t run longer than 1 hour.

The AJAX response returns a formatted string. I want to convert this to an XML response so it’s easier / cleaner to retrieve multiple data.

I want to limit the data by date / time because the graph will look tiny / there would be a lot of information being sent back and forth every 10 seconds refresh.

I’m not happy with the scaling of the graphs. It’s using dual axis for energy and temperature.

Some sort of statistics besides a graph like total engery consumed for x days/months/years, etc.

Eventually the Python script will become a Linux Daemon but this is only once it’s stable enough.

Twitter Integration would be nice. I would use the Python script to post a tweet every hour with a simple message. The profile will be protected so that only I can see what it says.

Summary

Still got ways to go but it’s getting there. It’s nice to finally see something from my days of work. Especially if I have never used Python or PHP from scratch before.


CurrentCost previous post

CurrentCost Website

CurrentCost XML Specification

Dale Lane’s Blog on how to get data from a CurrentCost device