Tuesday, August 30, 2011

The Dawn of a New Age

A few days off work has done great things for Elmo.
There was more work left to do than I realised, and lots of small details that all needed to come together to make everything work.
Having got the code support complete, I also had to set up the configuration files to link the IR up with the user interface on the phone. Quite a tedious process but straightforward.
Elmo is now resplendent in the living room and is controlling the AV kit including the amplifier, TV, Bluray and Sky box. I am generally quite pleased with the results and the way the system functions in real life. I have found the angle of the transmitter dongle is quite critical - it seems to have a narrow angle of transmission - and also that reliability suffers when the sun is shining through the window - only to be expected, I guess.
The final insult was that my Provisioning certificate for my development iPhone had expired. This wasn't immediately obvious and I searched high and low for the reason my software wouldn't deploy to the phone before noticing this. It was easy to regenerate the certificate and then everything worked straight away.
I now plan to leave Elmo in-situ and get a real feel for what works well and what doesn't and alsonwhat problems come up - there's nothing like using a system in earnest to shake out all the bugs.
It's very good news, though, because after all the work and setbacks, the system that I envisaged nearly 2 years ago is now a reality.

Monday, August 22, 2011

Channelling

Finally, some good progress to report.
The Status engine is up and running on the server simulator, as is the sequencer. I managed to spend a good bit of time over the weekend working to complete these and also started one other item that I'd forgotten about, namely the channel selector.
I had some rudimentary ideas about how the TV channel was going to be selected but after spending nearly an hour going through all the Sky channels and mapping channel numbers to names, it seemed that the only sensible way to do this was going to be in a list and use a Picker to select the channel. Because there are so many channels, I'll arrange them into groups and use a split Picker control on the iPhone to select first the category and then the channel.
I managed to dig out some sample code from my days of learning from the iPhone book and have got the appropriate Picker view up and running. I also have an XML file listing the channel names, numbers and categories.
Next step is to update the server simulator to serve the channels file and the iPhone app to consume it and link it into the Picker. I then need to decide how to drive the commands to change the channel (since it requires a sequence of button presses) and how to store the selected channel.
I have some time off work this week and hope to spend some of it doing this and also getting the new code running on the real server hardware. Then I'd like to run some actual live tests and see how the system hangs together in use.

Monday, August 15, 2011

A Standpoint of status

Over the weekend I managed to integrate my recent server changes onto the Linux box and get it up and running with the iPhone simulator. That means it should just be a short step to a configurable system running on the real hardware.

I also started looking at the other things needed to get the system up and running in a basic form and the main part of the puzzle missing is a Status engine.

The Status engine remembers the state of various parts of the system it is controlling so, for instance, if you set the TV to external input and the amplifier to DVD, the status engine remembers this and won't set these settings again. This then allows activity based control where you tell the system that you want to watch a DVD rather than selecting the inputs on the different devices manually. It also allows control of things such as Sky TV guide where the controls have different functions depending upon which menu you're in. Initially I intend to use this only in a basic way and then experiment with how far it can take the system.

The final part of the initial system will be the sequencer, which allows a single button press to initiate a number of commands.

I hope to get both the Status engine and sequencer working this week and then perform some testing at the weekend.

Tuesday, August 9, 2011

Fit the Second

I've decided to dub this latest version of Elmo v0.2.
Most of the work I've been doing has been on the iPhone app - generally this is more problematic than the server because of my unfamiliarity of the development system. I've got to a point now where I've separated the raw network protocol from the Elmo specific protocol and the application logic - although it's not a brilliant implementation because the structure has evolved as I've learnt, it is along the right lines and should allow quite a bit of flexibility in what I do.
The low level network component has been stable for some time and most of my work has been on the Elmo protocol - which is now working well in both directions. The View rendering has been rewritten to use the configuration downloaded from the server rather than hard-coded data.
The final piece of the puzzle was in the server and that involved hooking up the commands sent by the iPhone to the actual IR codes that need to be transmitted. I decided to map these because it will make it more flexible later on, so there is a translation file on the server that takes the command from the iPhone and maps it to the device file and IR code that needs to be transmitted.
Last night I ran the whole edifice up on the iPhone and windows server simulators and it all hung together - so I now have fully configurable iPhone screens, command mapping and IR code generation. It looks the same as it did before but under the hood it's far more capable.
Next step is to get the whole lot working on the real server and iPhone and then work out what I need to do to make it into a practical system to do some initial real-life testing.

Tuesday, August 2, 2011

Network Nastiness

It's been very quiet on Elmo recently.
Despite my previous post it's still been difficult getting time to work on it. This hasn't been helped by long, hard days at work which make it more difficult to spend a few hours working on yet more computers in the evening.
However, when I have been able to spend time on Elmo, I've spent a lot of it rather stuck with some network problems. My problem manifested itself when I started to transfer larger amounts of data for m configuration management. It seemed that small numbers of characters were trouble free but anything over a few hundred would cause problems.
Eventually I traced the problem to packetisation - where the transport was splitting things into smaller packets - and so implemented some code to cope with this - rather poorly as it turned out. It took me a week to track down the problems in the packeting code, but once I did I had a reliable transport.
I can now transfer my configuration files from the Elmo server onto the iPhone app and have started to use my homegrown XML parser to pull the information out of these files. This is requiring a fair bit of refactoring of code but it's progressing quite well.
When I finish this part of the work, all the control layouts will be held on the server rather than the iPhone - which is a far more flexible solution.
Next step is to rework the view control render code to pull data from the configuration file.