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.

No comments:

Post a Comment