skip to main |
skip to sidebar
Progress Report 24/02
- Did some intensive investigation into why match data wasn't being given out properly over the serial port. I had a dig around with the FlashViewer application and it turned out that the match data wasn't even being stored in flash properly! Spent a long time trying to figure out why before giving in and posting to the TinyOS support mailing list. A guy called David Moss from Rincon replied and told me that the modules I was using for flash access - BlockRead and BlockWrite, were riddled with problems and suggested I use his replacement for flash access - FlashBridge. Seemed like a good idea.
- Spent a long time getting FlashBridge working. Since the distribution of TinyOS that is supplied with my motes (Boomerang) was based on an old version of TinyOS and FlashBridge was written for a later version, FlashBridge was not happy at all. After a day of fiddling around creating some horrible hybrid version of TinyOS that didn't really work at all, I discovered that there's a compiler flag for FlashBridge for Boomerang users. Doh. Once I started using that everything seemed to work fine...
- ... Except the match details were still being stored incorrectly! Luckily I quickly realised that during all my playing around I had moved the code to store matches into the event handler for receiving the radio message. This is bad because on TMote Sky modules the radio and external flash share a bus. The problem was fixed by moving the code to write a match back out into a task and posting the task, so that the system scheduler could run it when the bus was free.
- The hardware side of things is nearly complete now, and it's certainly functional enough for me to get on with writing the rest of the system. There are a few more things I'd like to do to it though:
- Stop the flash being erased each time a unit is powered up. At the moment this is because I have no easy way of storing the number of matches held in flash. Shouldn't be too hard to simply read in the records from flash one by one on startup and count them all up.
- Add a message so that the current battery level can be queried over USB.
- Make the device go into an error state if it is not bound to a user account. At the moment it still sends out notification messages on the radio with user ID and device ID of 0.
- Now that I have working hardware and a library to interface with it via the USB port, I started work on the device dock application. Hopefully this should prove to be a fairly simple part of the project. Indeed, I was able to make a decent start with around an hour's work. The application searches through all available COM ports and queries to see if there's a finder device attached to any of them. It then displays the device ID and user ID of any devices it finds in a table. It also looks really pretty: screenshot.
No comments:
Post a Comment