Chumby as an iPod server

From Chumby Wiki
Revision as of 01:22, 29 November 2007 by Tabrez (Talk | contribs)

Jump to: navigation, search

Summary

When an iPod is plugged into a Chumby, the device launches an HTTP daemon on port 8080 (called "chumbipodd") that will serve data about the iPod in XML. The Chumby's Control Panel utilizes this server to provide a simple interface to the iPod's playlists; however, the daemon provides quite a bit more information. The daemon supports a universal crossdomain.xml file, so the services are available to the Chumby widgets.

Protocol

info

Returns basic information about the iPod - number of playlists, tracks, photos, photo albums, and storage statistics

Format:

http://ip.of.the.chumby:8080/info

Response:

<?xml version="1.0" encoding="UTF-8"?>
<info>
  <iPod id='0' mountPoint='/mnt/ipod' trackCount='1170' playlistCount='23' totalSpace='28521' freeSpace='20120' photoCount='2165' photoAlbumCount='29' >
    <name><![CDATA[My iPod]]></name>
  </iPod>
</info>

playlists

Returns a list of the playlists on the device. The "fullTrackCount" attribute includes tracks that cannot be played on the chumby (such as tracks purchased from the iTMS), while the "trackCount" attributes is filtered to include only those tracks that are playable (MP3 and M4A). The standard chumby Control Panel will typically not show playlists with a trackCount of 0.

Format:

http://ip.of.the.chumby:8080/playlists

Response:

<?xml version="1.0" encoding="UTF-8"?>
<playlists>
  <playlist id='0' trackCount='1145' fullTrackCount='1170' >
    <name><![CDATA[My iPod]]></name>
  </playlist>
  <playlist id='1' trackCount='6' fullTrackCount='6' >
    <name><![CDATA[Nighttime Mix]]></name>
  </playlist>
   ...
  <playlist id='22' trackCount='35' fullTrackCount='50' >
    <name><![CDATA[Wedding]]></name>
  </playlist>
</playlists>

playlistIDs

Returns a list of track IDs of the tracks in a playlist - this is a quicker fetch than the more detailed "playlist" fetch and is useful if you don't need all of the track details in one shot.

Format:

http://ip.of.the.chumby:8080/playlistIDs/(id_of_playlist)

Response:

<?xml version="1.0" encoding="UTF-8"?>
<playlistIDs index='1'>
  <name><![CDATA[Nighttime Mix]]></name>
  <trackIDs>1390,1388,1389,1391,1387,1386</trackIDs>
</playlistIDs>

playlist

Returns detailed track information about the tracks in a playlist

Format:

http://ip.of.the.chumby:8080/playlist/(id_of_playlist)

Response:

<?xml version="1.0" encoding="UTF-8"?>
<playlist index='1'>
  <name><![CDATA[Nighttime Mix]]></name>
  <tracks>
    <track id='1390' duration='5:21' path='/mnt/ipod/iPod_Control/Music/F14/THUT.m4a' >
      <artist><![CDATA[Peace Division]]></artist>
      <album><![CDATA[Fabric 28]]></album>
      <title><![CDATA[01 Club Therapy]]></title>
    </track>
    <track id='1388' duration='5:21' path='/mnt/ipod/iPod_Control/Music/F21/BELB.m4a' >
      <artist><![CDATA[Peace Division]]></artist>
      <album><![CDATA[Fabric 28]]></album>
      <title><![CDATA[02 Club Therapy]]></title>
    </track>
    ...
    <track id='1386' duration='5:21' path='/mnt/ipod/iPod_Control/Music/F43/FYWV.m4a' >
      <artist><![CDATA[Peace Division]]></artist>
      <album><![CDATA[Fabric 28]]></album>
      <title><![CDATA[06 Club Therapy]]></title>
    </track>
  </tracks>
</playlist>

track

Returns detailed information about a track

Format:

http://ip.of.the.chumby:8080/track/(id_of_track)

Response:

<?xml version="1.0" encoding="UTF-8"?>
<track id='1390' >
  <title><![CDATA[01 Club Therapy]]></title>
  <artist><![CDATA[Peace Division]]></artist>
  <album><![CDATA[Fabric 28]]></album>
  <year>2006</year>
  <genre><![CDATA[Electronica/Dance]]></genre>
  <tracknum>4</tracknum>
  <trackcount>18</trackcount>
  <path>/mnt/ipod/iPod_Control/Music/F14/THUT.m4a</path>
  <duration>5:21</duration>
  <bitrate>128</bitrate>
  <samplerate>44100</samplerate>
  <filesize>5216001</filesize>
  <artcount>0</artcount>
  <rating>0</rating>
  <playcount>0</playcount>
</track>

trackfile

Returns the audio file for a track

Format:

http://ip.of.the.chumby:8080/trackfile/(id_of_track)

photoalbums

Returns a list of photo albums.

Format:

http://ip.of.the.chumby:8080/photoalbums

Return:

<?xml version="1.0" encoding="UTF-8"?>
<photoalbums>
  <photoalbum id='0' photoCount='2165' >
    <name><![CDATA[Library]]></name>
  </photoalbum>
  <photoalbum id='1' photoCount='37' >
    <name><![CDATA[Last Roll]]></name>
  </photoalbum>
  ...
  <photoalbum id='28' photoCount='15' >
     <name><![CDATA[Slumber party]]></name>
  </photoalbum>
</photoalbums>

photoalbum

Returns the list of photos in a photo album

Format:

http://ip.of.the.chumby:8080/photoalbum/(id_of_photo_album)

Response:

<?xml version="1.0" encoding="UTF-8"?>
<photoalbum index='28'>
  <name><![CDATA[Wedding photos]]></name>
  <photos>
    <photo id='2084' >
      <name><![CDATA[Cutting the cake]]></name>
    </photo>
    <photo id='2114' >
      <name><![CDATA[First dance]]></name>
    </photo>
    ...
    <photo id='2514' >
      <name><![CDATA[Throwing the bouquet]]></name>
    </photo>
  </photos>
</photoalbum>

photo

Return the information about a particular photo. Photos are typically available in several resolutions, which vary across iPod models.

Format:

http://ip.of.the.chumby:8080/photo/(id_of_photo)

Response:

<?xml version="1.0" encoding="UTF-8"?>
<photo id='2085' >
  <name><![CDATA[Cutting the cake]></name>
  <image id='33360' width='720' height='480' />
  <image id='33361' width='130' height='88' />
  <image id='33362' width='320' height='240' />
  <image id='33363' width='50' height='41' />
</photo>

image

(NOTE: due to bugs, this may not be completely functional in software versions 1.2 and earlier)

Returns the JPEG file for a particular image.

Format:

http://ip.of.the.chumby:8080/image/(id_of_image)