Friday, 16 May 2014

Command processing now added to data logger

The software is now able to receive data from any number of XBee nodes and log it to file. However, it was realised that the software would require to be able to program the nodes as well. For example, to adjust the sleep, wake and sampling intervals. This has also now been achieved.

Configuration of the software is accomplished through a configuration file rather than a user interface. The reason being that it will enable the simplest of equipment requirements to run it. The objective being to use a RaspberryPi and without a keyboard and display. Just a USB memory stick to configure and write data to.

So that said here's a sample of what the configuration file looks like.

# loginterval units are seconds
loginterval=30
node1=0013a200409029a5
0013a200409029a5.command1=NI
0013a200409029a5.interface1
0013a200409029a5.interface1.index=0
0013a200409029a5.interface1.conversion=TMP36
0013a200409029a5.interface1.nickname=kitchen

As can be seen the log interval is configurable. The software works by listening for incoming data which is then saved but not written to file. That's because it will be coming in all the time so it's the function of the logging process to rationalise this and bring it all together in one record written each loginterval seconds.

The next entries define the nodes from which data will be accepted for logging. The value 0013a200409029a5 is the 64 bit node address. The succession of commands following the node1=0013a200409029a5 entry define the interfaces in use and such things as the conversion routine to apply. For example, interface1 is an analogue interface with a TMP36 temperature sensor attached and so it reports in millivolts. Therefore, the conversion converts to Celsius before logging.

So now I've got a data logger and can once more start thinking about measuring where my energy is being used! Well, not quite! I've now got the problem of packaging the nodes so they can be left around the house. Always another challenge!


No comments:

Post a Comment