Wednesday, 29 January 2014

Planning

I'm not sure how far I'll be taking this project but it's smooth development requires a degree of planning. Hence the delay in publishing the next version of code. This approach saves an awful lot of wasted time writing, rewriting and debugging code. It's tempting to do the latter but  planning first is more satisfying and efficient.

Wednesday, 15 January 2014

Eclipse version published

Latest Eclipse version available

The latest version of the code is now available here (Code05).

The code you will find at the link above is not pretty but it performs most of the important functions to move forward again. (For some reason the event logger, log4j, has stopped working). I've published it warts and all because the purpose of the blog is to document the journey made, and this version of the code marks a big leap.

Review of functionality so far

Basically the functionality is as follows
  • Listens for incoming data from any connected XBee node
  • Records the data and resumes listening
  • Waits a set time before writing the data to a file
  • The file name is constructed from the date. As the date changes a new file is created.
On reflection the migration from Processing to Eclipse was a bold move but looks worthwhile. It was getting confusing identifying features of the programming that were specific to Processing rather than Java. And with the future looking like embracing Raspberry Pi or even Android as a platform it seemed that the move would be needed sooner or later. (Although to be fair Processing also supports these environments)

As with all programming it's not just about writing the code. There is the steep learning curve associated with the development environment and Eclipse is no exception. It's obviously a powerful development environment. NetBeans was considered but primarily Eclipse was chosen for its established popularity and the fact that it is used as part of the Android app development environment. This could be useful in the future.

Next Steps

As said Code05 is rough and ready and just proof of concept. The next step is to include features for configuring the code and controlling it's operation. Importantly the objective is not to get bogged down in creating a user interface. That's always time consuming and probably assumes use of a graphical screen. The requirement is simplicity and really low cost so the intention is to use a configuration file.Luckily Java has this functionality as standard and can be seen in the log4j section of the code.

With regards to control i.e. starting and stopping the logging then the intention is to use an XBee node as the user interface. By using one of the inputs it should be possible to signal to the code whether logging should be on or off and a led connected to an output pin could signal if logging is active.And overall the code will be a background process running on a host (Windows PC or Raspberry Pi) requiring minimal or no peripherals. The configuration and log file being stored on a USB memory stick and prepared independently.

Enough for now. Back to work.

Monday, 13 January 2014

Moved Development from Processing to Eclipse IDE

It's been a few weeks since the last post. That's because I've been migrating my work from the Processing environment to Eclipse. Why have I done this when the objective of Processing is to make software development easier? Well, software development using the XBee's contains a broad range of technical concepts. The internet research results for which is invariably explained in the context of pure Java and so using the Processing environment was proving a little confusing. Also, an IDE such as Eclipse contains facilities to make software development and learning so much easier. For example, it's so easy to explore objects; Eclipse error checks the code and suggests correction options.

So the new code version has now almost been migrated and will be published soon.