Program UPDATE
–--------------
Bug fixes.
Check & create sub-directories by itself, no need to create directories manually
Support for db file log of daily kwH using sqlite
Now requires sqlite port
It has now two parts that remains resident, owl.py which write the log files and:
responder.py which responds to email query.
You can send an email (ID as defined in responder.py) with subject "OWL" and from and to dates in 1st & 2nd line of the mail body in the format yyyy-mm-dd as a query. The code will reply with an attached txt file containing statement of usage within dates, total kWH and avg kWH.
Version 1.0.2
Installation Steps:
1. Download and UNzip owl.rar https://dl.dropbox.com/u/2185098/generic/owl.rar
2. You may place all files in /home and rename to .py
2. Edit all .py files, check the comment areas to modify.
3. #chmod +x /home/.py
4. Add Firewall>Virtual IP>IP Alias 224.192.32.20/24 to your local interface
5. Add Firewall Rules>local interface:
Allow UDP * * 224.192.32.19 * * note
Allow IGMP * * * * * none
Allow * 224.192.32.19/24 * * * default none
6. Pfsense>Diagnostic>Backup>Download Backup config.xml
find /system, and add just below:
<shellcmd>python /home/owl.py &</shellcmd>
save the file structure and restore.
7. Pfsense>System>general Setup>NTP time server> change to "pool.ntp.org"
Notes:
to INSTALL python with sqlite port ----
/etc/rc.conf_mount_rw
mkdir /home/tmp
setenv PKG_TMPDIR /home/tmp/
pkg_add -r http://ftp-archive.freebsd.org/pub/FreeBSD-Archive/old-releases/i386/8.1-RELEASE/packages/All/py26-sqlite3-2.6.5_1.tbz
/etc/rc.conf_mount_ro
I would be glad to know if you have used the code or taken any help from it.
EDIT: It seems to be working now, I made responder.py a subprocess of the main scrip instead of trying to start both the scrips using shellcmd.