Sunday, November 25, 2012
Reborn
Has it really been (more than) a year?
Frankly, the FitPC/Iguana driver issues just got the better of me, and I lost all momentum on this project.
Earlier in the year I was given a Raspberry Pi, and I've recently been thinking this might be a good device to try for this very purpose. So I've spent a bit of time thinking and writing some code to get the basic things working.
It was fairly easy to hook up an IR transmitter and receiver to the GPIO ports on the Pi. I'd initally thought I could just poll the port in order to learn the IR codes, but it's proven to be problematic - the resolution just isn't high enough. So, I've resorted to using LIRC again to try to do this.
Today I've downloaded the new Raspbian image for the Pi and am in the process of getting the LIRC drivers compiled for the Kernel. This is somewhat time consuming and probably won't be finished today, but hopefully I'll be able to soon get LIRC up and running and see if I can get any success with receiving and transmitting IR using this new bit of hardware.
This could be a very short rebirth if the drivers don't work.
Wednesday, November 2, 2011
One step forward, two steps back
It's been a while since the last update, mainly because things haven't progressed a great deal.
I reinstalled the previous version of Ubuntu and it did allow the system to run, however, I started encountering problems with the IR driver locking up. There was nothing obviously wrong (and nothing on the manufacturer website) so I decided to start again, Reinstall version 9.10 of Ubuntu again but not apply any updates.
Busy weekends and long working weeks conspired to delay this but I managed to do this last Friday and it appeared to work.
I then spent the weekend implementing (most of) the configuration file system to optimise startup times (in the end I didn't use Boost, but went for a simpler solution - a shame since that was what started all these problems). I also took the opportunity to rework the channel picker control so you now have to press a button to activate the selection. Everything seemed to be working well, but when I disconnected all the development kit and reinstalled the server in the lounge, the IR crash problems started to appear again.
I've managed to do some investigations and found that the daemon appears to lock and refuse to send any IR signals - the only solution is to restart the daemon. More testing revealed this happens quite quickly under some circumstances, but doesn't seem to happen at all at other times. My conculsion is that the way in which I'm interfacing to the driver must be problematic, so I need to revisit that.
So, I need to look at the way I'm driving the IR device through the driver - possibly write some test code to try different techniques of making it work and see which ones are the most reliable. I also need to finish the configuration file mechanism and also do some more optimisations for speed of network connection. Finally, I want to enhance the control layout mechanism so I can test drive some better layouts for controlling devices.
I reinstalled the previous version of Ubuntu and it did allow the system to run, however, I started encountering problems with the IR driver locking up. There was nothing obviously wrong (and nothing on the manufacturer website) so I decided to start again, Reinstall version 9.10 of Ubuntu again but not apply any updates.
Busy weekends and long working weeks conspired to delay this but I managed to do this last Friday and it appeared to work.
I then spent the weekend implementing (most of) the configuration file system to optimise startup times (in the end I didn't use Boost, but went for a simpler solution - a shame since that was what started all these problems). I also took the opportunity to rework the channel picker control so you now have to press a button to activate the selection. Everything seemed to be working well, but when I disconnected all the development kit and reinstalled the server in the lounge, the IR crash problems started to appear again.
I've managed to do some investigations and found that the daemon appears to lock and refuse to send any IR signals - the only solution is to restart the daemon. More testing revealed this happens quite quickly under some circumstances, but doesn't seem to happen at all at other times. My conculsion is that the way in which I'm interfacing to the driver must be problematic, so I need to revisit that.
So, I need to look at the way I'm driving the IR device through the driver - possibly write some test code to try different techniques of making it work and see which ones are the most reliable. I also need to finish the configuration file mechanism and also do some more optimisations for speed of network connection. Finally, I want to enhance the control layout mechanism so I can test drive some better layouts for controlling devices.
Tuesday, October 4, 2011
Error. Redo from start
To help develop the file transfer system I decided was needed for Elmo, I decided to install the C++ Boost library on the server (Boost is particularly useful for cross-platform development).
Since my Ubuntu package manager had been complaining that my version was very old, I decided to upgrade to the new version 10 - Lardy Lumpfish, or whatever it's called.
BIG Mistake.
There are no graphics drivers for my hardware in this version. Having searched all over the place I still can't find a decent solution and the way things are at the moment means I can't boot into the system without getting an error and having to select to rebuild the display config (even when no display is connected). This is pretty hopeless for a system that isn't supposed to have a display.
After much deliberation, I've decided to reinstall from scratch the previous version - Karmic Koala - and reapply all the patches. This does give me the opportunity to document the process, which is probably no bad thing.
Obviously, I can't make any other progress until this is resolved
Since my Ubuntu package manager had been complaining that my version was very old, I decided to upgrade to the new version 10 - Lardy Lumpfish, or whatever it's called.
BIG Mistake.
There are no graphics drivers for my hardware in this version. Having searched all over the place I still can't find a decent solution and the way things are at the moment means I can't boot into the system without getting an error and having to select to rebuild the display config (even when no display is connected). This is pretty hopeless for a system that isn't supposed to have a display.
After much deliberation, I've decided to reinstall from scratch the previous version - Karmic Koala - and reapply all the patches. This does give me the opportunity to document the process, which is probably no bad thing.
Obviously, I can't make any other progress until this is resolved
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.
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.
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.
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.
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.
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.
Subscribe to:
Posts (Atom)