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!
Energy saving is not just about insulation but measurement and control. This blog documents a project to explore and utilise the XBee to help understand the energy usage in a typical home. By so doing learn Java and take advantage of the rapidly internet of things!
Friday, 16 May 2014
Tuesday, 6 May 2014
Adding XBee command processing to the logging software
The software so far is pretty much usable. That is, it receives data from XBee nodes and logs it to a file. However, at the moment, my test node sends data every second which is too frequent and I need an easy way of controlling this behaviour.
One way would be to physically plug it into an XBee Explorer and configure it directly. However, this is a bit of a clumsy time consuming thing to do and also risks damaging these little devices. Sending commands via wireless would be much better so that's what I'm now working on. Of course, when I've done that I've then got not just a logging system but a control system as well!
The work is nearly finished and the commands seem to be accepted by the local XBee software for transmission. What I must do now is include a means of confirming that the commands have been acknowledged by the remote node.
One way would be to physically plug it into an XBee Explorer and configure it directly. However, this is a bit of a clumsy time consuming thing to do and also risks damaging these little devices. Sending commands via wireless would be much better so that's what I'm now working on. Of course, when I've done that I've then got not just a logging system but a control system as well!
The work is nearly finished and the commands seem to be accepted by the local XBee software for transmission. What I must do now is include a means of confirming that the commands have been acknowledged by the remote node.
Subscribe to:
Comments (Atom)