iPod Serial wake up!
Wednesday, 14 April 2010
In my talk last night I had my easy button rig hooked up to an iPod Photo, rather than the iPod Touch I built it for, and used with in my car for months. A couple of times it stopped working and I didn’t know what had happened.
I did some digging tonight and the iPod Photo will respond to the remote just fine until the iPod goes to sleep — either explicitly via the “Sleep” menu item, or implicitly because it times out after sitting unplaying for a while. After walking it up, it will no longer respond to the remote. Disconnecting and reconnecting the remote doesn’t help; resetting the Arduino doesn’t help either. Resetting the iPod does cause it to start responding to the remote again — without doing anything at all to the remote or its connection.
As I mentioned, I used this remote for months, but only with an iPod Touch. I don’t have the iPod Touch any more, but I do have an iPhone. I cannot reproduce this behavior on the iPhone. There’s no real equivalent to the older iPod’s sleep, but if I press the button on the top of the iPhone, which shuts off the display and causes the lock screen to appear when the main button is next pressed, the remote continues to work just fine.
So that was with the SimpleRemote_with_Bounce example sketch. I then tried the SimpleRemote_ethernet sketch, since that lets me try other Simple Remote commands interactively. I put the iPod to sleep via its menu and tried sending “play” via my telnet connection to the Arduino running SimpleRemote_ethernet. Again it ignored me, just like it ignored the easy button. I then sent it the Simple Remote “iPod on” command, and voila! It woke right back up and started responding to me again.
So then I modified the SimpleRemote_with_Bounce sketch so it would send “iPod On” just before sending “Play” and it worked! I can no longer reproduce the unresponsiveness after the iPod has gone to sleep.
If you have been using the SimpleRemote or SimpleRemote_with_Bounce example sketches, please consider using the new SimpleRemote_with_Bounce_and_wake instead (yeah, I have no imagination when it comes to titles, but I wanted to rename it). I’ve deleted SimpleRemote and SimpleRemote_with_Bounce from the library on github to avoid confusion.
If you try this and it works — or doesn’t — for you, please let me know.
I did some digging tonight and the iPod Photo will respond to the remote just fine until the iPod goes to sleep — either explicitly via the “Sleep” menu item, or implicitly because it times out after sitting unplaying for a while. After walking it up, it will no longer respond to the remote. Disconnecting and reconnecting the remote doesn’t help; resetting the Arduino doesn’t help either. Resetting the iPod does cause it to start responding to the remote again — without doing anything at all to the remote or its connection.
As I mentioned, I used this remote for months, but only with an iPod Touch. I don’t have the iPod Touch any more, but I do have an iPhone. I cannot reproduce this behavior on the iPhone. There’s no real equivalent to the older iPod’s sleep, but if I press the button on the top of the iPhone, which shuts off the display and causes the lock screen to appear when the main button is next pressed, the remote continues to work just fine.
So that was with the SimpleRemote_with_Bounce example sketch. I then tried the SimpleRemote_ethernet sketch, since that lets me try other Simple Remote commands interactively. I put the iPod to sleep via its menu and tried sending “play” via my telnet connection to the Arduino running SimpleRemote_ethernet. Again it ignored me, just like it ignored the easy button. I then sent it the Simple Remote “iPod on” command, and voila! It woke right back up and started responding to me again.
So then I modified the SimpleRemote_with_Bounce sketch so it would send “iPod On” just before sending “Play” and it worked! I can no longer reproduce the unresponsiveness after the iPod has gone to sleep.
If you have been using the SimpleRemote or SimpleRemote_with_Bounce example sketches, please consider using the new SimpleRemote_with_Bounce_and_wake instead (yeah, I have no imagination when it comes to titles, but I wanted to rename it). I’ve deleted SimpleRemote and SimpleRemote_with_Bounce from the library on github to avoid confusion.
If you try this and it works — or doesn’t — for you, please let me know.