Tuesday, September 27, 2011

Process of continual improvement

So, Elmo has been installed and running for about three weeks now. This has allowed time to see how it really behaves when used in anger. Technically it has been generally working well, with just a couple of glitches to do with booting Ubuntu, however there are a number of "issues" - not really problems - that diminish its usefulness.

The biggest problem is latency. I've noticed that reconnecting to the server after you've initially powered up is actually taking quite a tangible amount of time. This is probably because the iPhone has to get back onto the WiFi network and then reconnect to the server. The upshot is that when you've been watching TV for a few minutes and decide to change channel, its not as good and experience as I'd hoped, there is a noticable delay. I have a few ideas about how to improve this, mainly around trying to predict when the user is about to press a button - I'm thinking of when the phone is unlocked as one trigger - although that probably won't give me enough time - or possibly using the accelerometer to detect when the phone is picked up.

An associated problem is that when you want to change between different items of equipment the phone has to download the new screen layout from the server. This again takes time and makes the process clunky. The simple solution is to store all of the screen layouts on the phone - only refreshing them at startup. This should be reasonably straightforward.

The screen layouts definitely need attention because the main screen is far too busy and the channel change lists aren't really useable. Because the iOS picker control basically selects an item when you stop scrolling, it means that the channel picker always comes up with a number of different channels before you get to the one you want. As each channel takes around a second to be selected by the server (3 digits transmitted over IR), this ends up being a bit tedious.

The IR transmitter is also very sensitive to positioning. I've found that changing the TV angle by about 10 degrees so the face of the TV is more closely aligned with the server helps greatly in the reliability of the signal transmission. On the whole the IR is pretty reliable now, but it still seems to go through patches where it struggles. Probably some more work is needed on the low-level IR capture. There are a small number of codes that have stopped working altogether as well.

Although there are a number of issues here, none of them are major. I intend to try to work to correct these over the next few weeks and see how sweetly I can get Elmo to sing. First step is to cache the screen layouts (because it should be simple) and then look into the connection latency issues.

Monday, September 5, 2011

Tantrums

Elmo has been throwing a few tantrums.
I left the system set up this week and encouraged my wife to use it in my absence. It wasn't entirely successful because she moved the IR transmitter which stopped the whole thing from working at all!
However, I've also noticed that the iPhone quite often loses connection to the server and won't reconnect. There is also a threading problem in the server which shouldn't be critical, but needs sorting out.
So, with all these things combined, I managed to grab some time this weekend to rework a lot of the network connection process and make it more robust. The new system relies on the responses from the server to let it know it's connected. If the responses don't arrive the iPhone starts a reconnection process. This all seems to make the whole thing far more reliable - although I did find some nasty differences between the Ubuntu and Windows implementations of the socket layer - which caused a fair bit of consternation and wasted a load of time.
While I was at it, I also added the capability to shut down the Elmo server from the iPhone - because the FitPC box runs so hot, I don't like to leave it on all the time.
It took more time than I hoped, but the results are very encouraging - both the server and iPhone now manage their socket connections in a much better way and the iPhone will queue up commands until it reconnects to the server.
I also took the opportunity to tweak a few of the IR codes - basically making the sequence longer, which is equivalent to holding the remote control button down for more time. I've done this to try to improve the reliability of turning equipment on and off.

Elmo is once again installed in the living room and we will see if this week is more successful.