PDA

View Full Version : Ipod ReFresh Project, Where is Serial #


AaronCooper
08-05-2006, 06:59 PM
I have a need to setup a project where I have a Interface that allow our Students to hook up iPods and wipe the files, (Refreshing the Ipod)

I do not want to use the Ipod Update / Restore tools. It would require nameing etc...

So my Idea is to see if I can Id the iPod by it's serial Number. To confirm the iPod we are getting back is ours, as a check and balance.

I plan to use Xplay as it allows you to see and wipe the audio tracks.

SO anyone know how I may be able to read the Serial of the iPod so I can check it aganist our Inventory?

Suggestion?

Intrigued
08-05-2006, 08:52 PM
The serial number can be viewed by turning over the iPod and checking the metal casing. Angle it against a light source to see it.

AaronCooper
08-05-2006, 09:31 PM
The serial number can be viewed by turning over the iPod and checking the metal casing. Angle it against a light source to see it.

:lol :lol
Well we will be using hard or soft case covers, I was looking for a electronic method.

I could look at the HD serial as a Option. just did a test with my 2 iPods.
I also am looking at a method of tagging flash cards that will be used in Digital cameras we will loan out.

I was thinking of builing a single interface that will wipe / refresh the iPods and Flash cards.

Intrigued
08-05-2006, 09:34 PM
I believe you can also check the iPod serial via the About page in the unit. (or via iTunes you can view it)

Come to think of it I thought there was a "hold these buttons down" to get the serial, as well.

AaronCooper
08-05-2006, 09:56 PM
I believe you can also check the iPod serial via the About page in the unit. (or via iTunes you can view it)

Come to think of it I thought there was a "hold these buttons down" to get the serial, as well.

True, just trying to automate it. Hook it up, push the button on the interface, it return this is iPod #12, do you wish to wipe, yes - no

or Not a know iPod, etc...

I would have a ADMIN login, which would allow me to add new Flash or iPods to the check list.

Intrigued
08-05-2006, 11:04 PM
Okay, first off. I have a working example for you. Now, this was created and tested against my Gen. 5 iPod. It may not work on all iPods (try it out).

Next, this is actually a ruff way of doing this (proof of concept). It should be "Bullet proofed" for sure! Try a different String Action for example.

Also, let me know what you come up with and on what generation.

Gen. 1 and 2 are the ones I really want to know about (but 3 and 4 too).

You should see multiple reportings. Again, I was just goofing around.

Here's the code (note: plug in your ipod, no iTunes needed) and then open AMS and put this code in say the On Preload or On Show and then Preview it (F5):

tblDrives = Drive.Enumerate()

for i,v in tblDrives do

strDriveType = Drive.GetType(v)

if strDriveType == DRIVE_REMOVABLE then

tblInfo = Drive.GetInformation(v)

tbliPodInfo = TextFile.ReadToTable(v.."\\iPod_Control\\Device\\SysInfo")
s = TextFile.ReadToString(v.."\\iPod_Control\\Device\\SysInfo")

Dialog.Message("", s)

a = String.Mid(s, 40, 11)

Dialog.Message("", a)

for i, v in tbliPodInfo do
Debug.ShowWindow(true)
Debug.Print(v.."\r\n")
end
end

end

Intrigued
08-05-2006, 11:17 PM
If anyone wants to help us out here.

Just download the .exe I made in AMS. There is one Dialog.Message() that should show your iPod's Serial Number. Check that number against the one on the back, metal plate of your iPod. The same? Let us know and what Generation your iPod is. Thanks.

Here's the .exe that will show you your number:

Make sure your iPod is connected to your computer and turned on!

http://www.amsuser.com/ams/examples/iPodSerialNumber-AMS6-Intrigued.exe

AaronCooper
08-05-2006, 11:24 PM
If anyone wants to help us out here.

Just download the .exe I made in AMS. There is one Dialog.Message() that should show your iPod's Serial Number. Check that number against the one on the back, metal plate of your iPod. The same? Let us know and what Generation your iPod is. Thanks.

Here's the .exe that will show you your number:

Make sure your iPod is connected to your computer and turned on!

http://www.amsuser.com/ams/examples/iPodSerialNumber-AMS6-Intrigued.exe


It seems to fail, right after scanning the Floppy drive, Looking at a way to skip Drive A and B

Intrigued
08-05-2006, 11:27 PM
It may be the name displayed in My Computer.

For example, my Gen. 5 is defaulted to "IPOD" (all upper-case).

And yours is?

Intrigued
08-05-2006, 11:33 PM
Try this "work in progress" code chunk: (we PM'ed by the way folks and he stated that when he disabled drives A: and B: in the Device Manager, that this solution worked, thus my code below):

tblDrives = Drive.Enumerate()

for i,v in tblDrives do

strDriveType = Drive.GetType(v)

if strDriveType == DRIVE_REMOVABLE and v ~= "A:\\" and v ~= "B:\\" then

tblInfo = Drive.GetInformation(v)

tbliPodInfo = TextFile.ReadToTable(v.."\\iPod_Control\\Device\\SysInfo")
s = TextFile.ReadToString(v.."\\iPod_Control\\Device\\SysInfo")

--Dialog.Message("", s)

a = String.Mid(s, 40, 11)

Dialog.Message("Should be the iPod's Serial Number (check the back, metal plate)", a)

for i, v in tbliPodInfo do
--Debug.ShowWindow(true)
--Debug.Print(v.."\r\n")
end
end

end

AaronCooper
08-05-2006, 11:38 PM
It seems to fail, right after scanning the Floppy drive, Looking at a way to skip Drive A and B


I have confirmed the error is related to Floppy, I disable it via Hardware, device manager. Then tested on both iPod Photo and iPod Video and it work great.

Look like the SysInfo has other info, Firmware, Model , Name

Intrigued
08-05-2006, 11:41 PM
Yes, that is correct, there is more information in that file. If you uncomment the Debugger part (and the other Dialog.Message()). You will see all of what it contains.

:yes

Well, off to bed. I'll see what you have come up with tomorrow. Try that new code chunk if you would and post back.

Laters.

(oh, you iPod 1st, 2nd genners. Post if this works, if you would not mind taking a minute to try this out, thanks).

Crigey! 5,000 posts for me. Not one a waste of time. I enjoyed them all. It's been great so far with I.R. and their (your) products!

AaronCooper
08-05-2006, 11:42 PM
That works with the Floppy drive active, Thanks.

Now I may expand the info return to Name, Firmware, etc...




Try this "work in progress" code chunk: (we PM'ed by the way folks and he stated that when he disabled drives A: and B: in the Device Manager, that this solution worked, thus my code below):

tblDrives = Drive.Enumerate()

for i,v in tblDrives do

strDriveType = Drive.GetType(v)

if strDriveType == DRIVE_REMOVABLE and v ~= "A:\\" and v ~= "B:\\" then

tblInfo = Drive.GetInformation(v)

tbliPodInfo = TextFile.ReadToTable(v.."\\iPod_Control\\Device\\SysInfo")
s = TextFile.ReadToString(v.."\\iPod_Control\\Device\\SysInfo")

--Dialog.Message("", s)

a = String.Mid(s, 40, 11)

Dialog.Message("Should be the iPod's Serial Number (check the back, metal plate)", a)

for i, v in tbliPodInfo do
--Debug.ShowWindow(true)
--Debug.Print(v.."\r\n")
end
end

end

Intrigued
08-05-2006, 11:43 PM
Ah, bottom of the 9th success. Boy, that's almost as good as the All-You-Can-Eat Snow Crabs I had tonight!

:yes

AaronCooper
08-05-2006, 11:46 PM
Thanks, I knew someone here would figure out a way.
I am off to bed myself, I'll see how much I can get done Sunday.

I have about 10 days to get this going, and with this should be fine.

Would love to hear from others that try the code.

Yes, that is correct, there is more information in that file. If you uncomment the Debugger part (and the other Dialog.Message()). You will see all of what it contains.

:yes

Well, off to bed. I'll see what you have come up with tomorrow. Try that new code chunk if you would and post back.

Laters.

(oh, you iPod 1st, 2nd genners. Post if this works, if you would not mind taking a minute to try this out, thanks).

Crigey! 5,000 posts for me. Not one a waste of time. I enjoyed them all. It's been great so far with I.R. and their (your) products!

Intrigued
08-06-2006, 07:26 AM
Here is a breakdown of that code for those not understanding such:

Here is a tip I use to this day when wanting to know what an action or "built-in" does (built-in in AMS is just a static (read: can't change by programming) variable built in by I.R.'s programmers)...
The tip is that when you want to know about one of these two you can just double-click on the Action you want more information about and then click on the blue colored link towards the top of that properties box. (or manually search the online or in AMS help for the built-ins).
I use this still all the time to find out what a variable "returns" (weather a number, string, table), etc.



-- Finds all drives and puts such into a Table. For each drive letter found (ie. "C:\") there is a number. 1 for A:\, 2 for B:\, etc.
blDrives = Drive.Enumerate()

-- Goes through table. It's like saying: for each index (the number assigned, as found, to each drive (1..2..3, etc.) and driver letter (again, from A-Z for example) found, do something
for i,v in tblDrives do

Gets the type of drive. (ie. Fixed or say Removable)
strDriveType = Drive.GetType(v)

-- If the drive is what we are looking for then continue, otherwise exit the loop (if..then..end)
if strDriveType == DRIVE_REMOVABLE and v ~= "A:\\" and v ~= "B:\\" then

-- Gets the drive information. Puts it into a table. If you see an Action getting "information" per se, you can usually be assured it's going to be returned to you as a table.
tblInfo = Drive.GetInformation(v)

-- These two lines get the information from the file and add it to an AMS table and then also reads it to a string (the table ended up having some "extra" spaces to I quickly went to the ReadToTable action for ease of coding (and to get this example working)
tbliPodInfo = TextFile.ReadToTable(v.."\\iPod_Control\\Device\\S ysInfo")
s = TextFile.ReadToString(v.."\\iPod_Control\\Device\\ SysInfo")

--Dialog.Message("", s)

--This below is the part that is really a "hack-on-code" sort of deal. Because the serial code would have to be found at this exact location each time. A String.Find() (experiment) other Action or combination may work better.
a = String.Mid(s, 40, 11)

Dialog.Message("Should be the iPod's Serial Number (check the back, metal plate)", a)

-- Again, we are "itterating" (going through, index (number) by index) of the table, so that we can print out the table contents. the "\r\n" is a line return and then newline (so we get the list going down the debugger dialog and not have everything on one line
for i, v in tbliPodInfo do
--Debug.ShowWindow(true)
--Debug.Print(v.."\r\n")
end
end

end

TJ_Tigger
08-06-2006, 11:53 AM
Nice job I-man. I modified the code a bit as I have other removeable drives on the system and they are found as removeable drives but the media is not present so the code failed. I moved the Drive.GetInformation before the if statement and check to make sure information was returned, if it is then proceed if not then skip it. Works for skipping A: and B: drives too. I tried to streamline the code for reading to a table. The file uses \n as new lines and not \r\n which is required for TextFile.ReadToTable to correctly separate lines into a table.

tblDrives = Drive.Enumerate()

for i,v in tblDrives do
strDriveType = Drive.GetType(v)
T = Drive.GetInformation(v)
if T and strDriveType == DRIVE_REMOVABLE then
--Dialog.Message(strDriveType, T.Label .. "\r\n" .. T.FileSystem .. "\r\n".. T.SerialNumber .. "\r\n"..T.DisplayName);
--the following code converts the newline \n to a carrige return and new line \r\n
--the output is then written to a file and then read to a table.
--this is necessary to have the ReadFromTable separate the content into different entries in the table
s = String.Replace(TextFile.ReadToString(v.."\\iPod_Control\\Device\\SysInfo"), "\n", "\r\n", false);
TextFile.WriteFromString(_TempFolder.."\\SysInfo", s, false);
tbliPodInfo = TextFile.ReadToTable(_TempFolder.."\\SysInfo");
--Dialog.Message("", s);
--a = String.Mid(s, 40, 11);
--Dialog.Message("Should be the iPod's Serial Number (check the back, metal plate)", a);

for ii, vv in tbliPodInfo do
if String.Find(vv, "SerialNumber", 1, false) ~= -1 then
Dialog.Message(v, String.Mid(vv, String.Find(vv, ":", 1, false) +2, -1));
end
--Debug.ShowWindow(true);
--Debug.Print(vv.."\r\n");
end
end
end

Tigg

Intrigued
08-06-2006, 02:42 PM
Thanks Tig. It was getting late and my eyes were rolling towards the back of my head. I have been busy because I started a new business recently. My first brick and mortar.

I'd like to know if this works on Gen. 1 and 2 iPods. I hope someone reads this post soon that has one and will try this out for us.

:yes