I have made some progress porting my MeterServ application (http://meterserv.webhop.net) to openWRT. I have managed to work out how the openWRT makefile system works enough to add it to the build system and produce an openWRT package for the MeterServ application.
To do the improvements that I want to make to the application though, it needs more work. In particular I don't like Perl, so want to convert the web interface part of it to Python. Rather than go for a completely DIY web framework, I have adopted webpy (http://webpy.org) - this seems like a simplified version of django - you define URLs that you want the application to work with, then point it to a python class that does the processing associated with the user requesting a particular URL.
I have started a seperate google code project for meterserv, because a couple of people expressed an interest in it. I have put the latest version of the software in its repository too - see http://code.google.com/p/meterserv.
A record of me trying to fathom out how to do a few nerdy things - hopefully this will help me remember how I made things work when I have forgotten...
Showing posts with label MeterServ. Show all posts
Showing posts with label MeterServ. Show all posts
Sunday, 13 February 2011
Saturday, 29 January 2011
Utility Meter Monitor
I have had a simple utility meter monitoring system working in my parents and my house for a few years. It uses an NSLU2 single board computer connected to a simple USB input/output interface, as described at http://meterserv.webhop.net.
It worked fine for at least 3 years, but started to misbehave recently. I have not been able to determine if it is a hardware or software fault - I suspect that I may have worn out the USB memory sticks that I used for the root filesystems.
We have gone for a hardware change to see if that is the problem, but I want to develop the software a bit more too.
Future developments include:
It worked fine for at least 3 years, but started to misbehave recently. I have not been able to determine if it is a hardware or software fault - I suspect that I may have worn out the USB memory sticks that I used for the root filesystems.
We have gone for a hardware change to see if that is the problem, but I want to develop the software a bit more too.
Future developments include:
- Add support for cheap electricity meters (e.g. OWL USB energy monitors).
- Add support for temperature sensing.
- Better web interface (the current one uses perl based CGI scripts, which are awful to maintain).
- A simple (end user friendly) software upgrade process.
I want to get rid of the perl cgi scripts because I don't really speak perl, so they are hard to follow - will change them for an ajax based front end with python server side scripts.
The first stage is to get a sofware development environment working. The original version used the nslu2-linux slugos operating system. This has been changed quite a bit since I used it, so I decided that as I will need to do a complete re-build, I will standardise and use OpenWRT for all my little embedded system projects.
Compiling OpenWRT for the nslu2 was nice and easy - in the menuconfig just select the processor as an ixp4xxx and the sub-type as nslu2.
Edit target/linux/ixp4xxx/base_files/etc/config/network to give a default network configuration that will work on your system (the openwrt default ip address is 192.168.1.1, which clashes with my router....).
This creates a file called bin/ixp4xxx/openwrt-nslu2-squashfs.bin which can be flashed onto the nslu2 as follows:
- Put the NSLU2 into upgrade mode by switching off, then powering on while holding in the reset button for about 10 seconds. When the status LED changes colour (at about 10 sec), release the reset button. The status LED now flashes different colours (very subtly different colours if you are colour blind like me!).
- Use upslug2 (sudo apt-get install upslug2 on Ubuntu) to upgrade the NSLU2 using: upslug2 -d wlan0 --image=openwrt-nslu2-squashfs.bin
- The NSLU2 will re-boot, but then take a while (a few minutes) to set up a writeable overlay file system before being accessible over the network.
This showed that I could build software for the NSLU2 using openwrt, but now I need to port meterserv to OpenWRT, which will be a separate post....
Subscribe to:
Posts (Atom)