Search Members Help

» Welcome Guest
[ Log In :: Register ]

Mini-ITX Boards Sale, Fanless BareBones Mini-ITX, Bootable 1G DSL USBs, 533MHz Fanless PC <-- SALE $200 each!
Get The Official Damn Small Linux Book. DSL Market , Great VPS hosting provided by Tektonic
Pages: (2) </ [1] 2 >/

[ Track this topic :: Email this topic :: Print this topic ]

reply to topic new topic new poll
Topic: Help with thinking through this, Insert USB Device -> mount -> copy *.jpg< Next Oldest | Next Newest >
beakmyn Offline





Group: Members
Posts: 63
Joined: Sep. 2004
Posted: May 16 2007,12:46 QUOTE

So, I'm looking into ways to make my digital picture frame 'parent' friendly. I'd like to ultimately have it so that "mom or dad" could take the memory card out of their camera and plug it into a USB SD  adapter and DSL would magically mount the device, search it for jpegs and copy those jpegs to a pre-defined directory.

So far I know I probably need something like automount or similar and a some way for automount to call a script that copies the files off the drive to my picture drive.

There is something for that other OS
http://www.dps.uk.com/freeware_transferer.htm

in case you can't figure out what I'm trying to do. My version will not have a gui.

Since the copy operation would be in a script I could add aplay to play a "Files copied" wav to indicate the copy process was finished or maybe kill feh and start it back up pointing to a "finished" jpeg then timeout after 5 seconds.

But, that's all bells and whistles right now I'm trying to iron out the automgacial mount, copy, unmount part.

So is my idea far fetched or is there something that already does this that I can wedge into DSL?


--------------
Have you seen my Damn Small Digital Picture frame?
http://www.frontiernet.net/~pictureframe
http://rapidshare.com/files/27769266/pframedsl.iso.html
http://www.joyceandkevin.com/dslpictureframe/pframedsl.rar
Back to top
Profile PM WEB AOL MSN YIM 
mikshaw Offline





Group: Members
Posts: 4856
Joined: July 2004
Posted: May 16 2007,13:25 QUOTE

The only thing that might present a problem is the auto mount part. I still don't understand why people want this behavior so badly, but I guess that's a matter of opinion.

The first thing I'd suggest is searching these forums. There have been a number of DSL picture frame projects done, and I can remember at least one thread that was almost identical to this one several months ago.


--------------
http://www.tldp.org/LDP/intro-linux/html/index.html
Back to top
Profile PM WEB 
beakmyn Offline





Group: Members
Posts: 63
Joined: Sep. 2004
Posted: May 16 2007,13:44 QUOTE

Quote (mikshaw @ May 16 2007,09:25)
The only thing that might present a problem is the auto mount part. I still don't understand why people want this behavior so badly, but I guess that's a matter of opinion.

The first thing I'd suggest is searching these forums. There have been a number of DSL picture frame projects done, and I can remember at least one thread that was almost identical to this one several months ago.

It was probably my project since I keep asking questions about it, and I don't believe anyone else has taken it as far as I have.

I understand your concerns about automount (I've read the posts) and I agree in a typical deployment there's no need for it.  However, this is a specific case where the system has no mouse or hard-drive and I can't very explain to "mom and dad" how to vnc into the frame and mount, copy, etc the pictures over. It needs to be easy for them. I am aware that it will see the device on bootup but I'd rather not have to make them shut it down and reboot in order to add new pictures (I have that script on my site). I hoping to make it as simple as they plug it in and it copies their pictures over and then gives some indication of progress, without rebooting.

My scripting abilities are sub-par at best. My thought is that automount would use far less system resources then anything I could write. I would cobble something together that would constantly poll the /dev and chew up what little RAM I have.

I'm more or less looking for someone to say the 'concept' is sound but you may have a problem with this or that and might I suggest you look into....


--------------
Have you seen my Damn Small Digital Picture frame?
http://www.frontiernet.net/~pictureframe
http://rapidshare.com/files/27769266/pframedsl.iso.html
http://www.joyceandkevin.com/dslpictureframe/pframedsl.rar
Back to top
Profile PM WEB AOL MSN YIM 
curaga Offline





Group: Members
Posts: 2163
Joined: Feb. 2007
Posted: May 16 2007,13:58 QUOTE

Hey.. If there's no hd, then where do you copy pics into?

I like supermount over automount, umounting with it is plainly taking the device off, with automount you have to wait predefined seconds before pulling the stick, and 'cause automount counts from last operation, it could umount when that's not wanted...

But autorunning a script is hard. In M$ it's a security risk. ???
I don't have a clue on how to do it (not on DSL, but with Udev I've done similar things)
Maybe you could make a button labeled "copy images" or something?
Or use an existing reset/power button with acpid for that?


--------------
There's no such thing as life. Those mean little jocks invented it ;)
-
Windows is not a virus. A virus does something!
Back to top
Profile PM 
beakmyn Offline





Group: Members
Posts: 63
Joined: Sep. 2004
Posted: May 16 2007,14:54 QUOTE

It has a hard-drive, just no mouse or keyboard.

I did find a script

Code Sample

#!/usr/bin/perl

$ENV{PATH} = "$ENV{PATH}:/usr/bin";
$ENV{PATH} = "$ENV{PATH}:/bin";

$imgdir = "/mnt/hd/images";
$camdir = "$imgdir/camera";

   open DEVICES, "/proc/bus/usb/devices";
   undef $/;
   $olddevice = <DEVICES>;
   close DEVICES;


while (1) {
   open DEVICES, "/proc/bus/usb/devices";
   undef $/;
   $device = <DEVICES>;
   close DEVICES;
   if ($device ne $olddevice) {
$olddevice = $device;
print "usb device changed.\n";
system("kill -USR1 `cat /var/run/slideshow.pid`");
system ("cd $camdir; gphoto2 -P");
&scale_camera_images;
system ("killall fbi");
   }
   sleep 10;
}


sub scale_camera_images {
   opendir CAMERA, $camdir;
   @files = readdir CAMERA;
   for $f (@files) {
if ($f =~ m/jpg/i) {
   system ("jpegtopnm < $camdir/$f | pnmscale -xysize 1024 768 | pnmtojpeg > $imgdir/$f");
   unlink ("$camdir/$f");
   sleep 1; # keep processor from overheating!
}
   }
}
   


I see 2 options with this run it a boot so it's running all the time. After the frame really has 1 purpose so as long as feh keeps working then I don't neccesarily mind this thing running also

The other option would be to tweak it and have a cron job run it every 5 seconds.


Of course there is a 3rd option which is to put in a wireless card and have the frame use pictures from a network drive instead. Then they copy pictures from their camera whenever, similarily I could also use flickrframe if the frame has internet.

Right now I have to use PuTTY to access the frame and move pictures via a networked drive.


--------------
Have you seen my Damn Small Digital Picture frame?
http://www.frontiernet.net/~pictureframe
http://rapidshare.com/files/27769266/pframedsl.iso.html
http://www.joyceandkevin.com/dslpictureframe/pframedsl.rar
Back to top
Profile PM WEB AOL MSN YIM 
7 replies since May 16 2007,12:46 < Next Oldest | Next Newest >

[ Track this topic :: Email this topic :: Print this topic ]

Pages: (2) </ [1] 2 >/
reply to topic new topic new poll
Quick Reply: Help with thinking through this

Do you wish to enable your signature for this post?
Do you wish to enable emoticons for this post?
Track this topic
View All Emoticons
View iB Code