/etc/nslu2/melody_disk_on.sh
/etc/nslu2/leds_off.sh
exit 0
@]
It expects 2 parameters: the device and a name for a lockfile which prevents the script from being started twice. It then mounts the device, creates a folder with the actual date, copies files one by one and umounts the device. It additionallz plays a melody after successfull recognition and umount (these scripts use the leds command).

On detection of the USB camera by udev, this rule uniquely identifies the camera using the idProduct and idVendor numbers, it then sets the access mode to 0666 (read and write access for everyone), it also creates a symbolic link /dev/canon_40d (note, this dev can not be used for much as the device uses PTP). Finally the rule runs my script located at /usr/scripts/canon_40d.sh

On detection of the USB camera by udev, this rule uniquely identifies the camera using the idProduct and idVendor numbers, it then sets the access mode to 0666 (read and write access for everyone), it also creates a symbolic link /dev/canon_40d (note, this dev can not be used for much as the device uses PTP). Finally the rule runs my script located at /usr/scripts/canon_40d.sh

Changed lines 72-73 from:

My very simple canon_40d.sh script is the following

to:

My very simple canon_40d.sh script is the following

Added line 80:

Changed line 82 from:

KERNEL=="event[0-9]*", ATTRS{name}=="ixp4xx beeper", MODE="0666"\\

to:

KERNEL=="event[0-9]*", ATTRS{name}=="ixp4xx beeper", MODE="0666"\\

Changed lines 85-86 from:

The actual getting of the photos from the camera is not done here, but rather I call another of my simple scripts get_photos.sh. This is because udev is blocked until returned from the canon_40d.sh script.

to:

The actual getting of the photos from the camera is not done here, but rather I call another of my simple scripts get_photos.sh. This is because udev is blocked until returned from the canon_40d.sh script.

(note 'beep' just beeps the on-board buzzer to let you know the camera has been detected, if you want to make the buzzer accessible by normal users edit the /etc/udev/rules.d/permissions.rule and add the following rule
KERNEL=="event[0-9]*", ATTRS{name}=="ixp4xx beeper", MODE="0666"

to:

(note 'beep' just beeps the on-board buzzer to let you know the camera has been detected, if you want to make the buzzer accessible by normal users edit the /etc/udev/rules.d/permissions.rule and add the following ruleKERNEL=="event[0-9]*", ATTRS{name}=="ixp4xx beeper", MODE="0666"\\

Now some of the device details from udevinfo output are used to create a udev rule that uniquely identifies the camera

For an excellent explanation of udev rules see writing_udev_rules by Daniel Drake

For my Canon 40D, using some of the outputs from udevinfo I created the following udev rule and added it to a new file /etc/udev/rules.d/10-local.rules

to:

Now some of the device details from udevinfo output are used to create a udev rule that uniquely identifies the camera.

For an excellent explanation of udev rules see http://www.reactivated.net/writing_udev_rules.html by Daniel Drake.

For my Canon 40D, using some of the outputs from udevinfo I created the following udev rule and added it to a new file /etc/udev/rules.d/10-local.rules

Changed lines 63-65 from:

This rule uniquely identifies the camera using the idProduct and idVendor numbers, it then sets the access mode to 0666 (read and write access for everyone), it also creates a symbolic link /dev/canon_40d (note, this dev can not be used for much as the device uses PTP). Finally the rule runs my script located at /usr/scripts/canon_40d.sh

To reload the rules run

to:

On detection of the USB camera by udev, this rule uniquely identifies the camera using the idProduct and idVendor numbers, it then sets the access mode to 0666 (read and write access for everyone), it also creates a symbolic link /dev/canon_40d (note, this dev can not be used for much as the device uses PTP). Finally the rule runs my script located at /usr/scripts/canon_40d.sh

To reload this new rule run

Changed line 80 from:

(note 'beep' just beeps the on-board buzzer to let you know the camera has been detected, if you want to make the buzzer accessible by normal users edit the /etc/udev/rules.d/permissions.rule and add the following rule

to:

(note 'beep' just beeps the on-board buzzer to let you know the camera has been detected, if you want to make the buzzer accessible by normal users edit the /etc/udev/rules.d/permissions.rule and add the following rule

The SlugOS/BE 4.8 doesn't use hotplug but triggering events on detection of the USB camera can be done via /etc/udev/rules.d/ rules files. This enables running of a simple gphoto2 --get-all-files script.

to:

The SlugOS/BE 4.8 doesn't use hotplug but triggering events on detection of the USB camera can be done via /etc/udev/rules.d/ rules files. This enables running of a simple gphoto2 --get-all-files script.

Changed line 32 from:

1. Find udev information for given camera.

to:

1. Find udev information for given camera.\\

Changed lines 56-57 from:

For an excellent explanation of udev rules see http://www.reactivated.net/writing_udev_rules.html by Daniel Drake

to:

For an excellent explanation of udev rules see writing_udev_rules by Daniel Drake

This rule uniquely identifies the camera using the idProduct and idVendor numbers, it then sets the access mode to 0666 (read and write access for everyone), it also creates a symbolic link /dev/canon_40d (note, this dev can not be used for much as the device uses PTP). Finally the rule runs my script located at /usr/scripts/canon_40d.sh

To reload the rules run

udevcontrol reload_rules

Now turn of and then turn back on the camera for it to be picked up by the new udev rule (or run #udevtrigger)

My very simple canon_40d.sh script is the following

!/bin/sh

Called from /ect/udev/rules.d/10-local.rules

/bin/beep -f 392.0 -n -f 493.9
/usr/scripts/get_photos.sh &

(note 'beep' just beeps the on-board buzzer to let you know the camera has been detected, if you want to make the buzzer accessible by normal users edit the /etc/udev/rules.d/permissions.rule and add the following rule
KERNEL=="event[0-9]*", ATTRS{name}=="ixp4xx beeper", MODE="0666"
This sets the access mode of the beeper to 0666)

The actual getting of the photos from the camera is not done here, but rather I call another of my simple scripts get_photos.sh. This is because udev is blocked until returned from the canon_40d.sh script.

This script simply copies all the photos into a 'pre_sort' folder, I then use another script to sort the photos based on the exif data (using a native compile of exif).

What would be interesting is to use http://www.imagemagick.org/][libmagick to create a fake photo inside the camera acknowledging the pictures have downloaded correctly, so you can erase them by hand without fear.

to:

What would be interesting is to use libmagick to create a fake photo inside the camera acknowledging the pictures have downloaded correctly, so you can erase them by hand without fear.

What would be interesting is to use http://www.imagemagick.org/][libmagick to create a fake photo inside the camera acknowledging the pictures have downloaded correctly, so you can erase them by hand without fear.

The first case is that the camera represents itself as a USB mass storage class device. Getting content off those cameras is similar to getting content from a memory stick. Just mount them as a fat filesystem and copy the content.

The other breed of cameras (e.g. Canon) uses PTP (picture transfer protocol). In order to use this a program like gphoto2 needs to be used. This page only covers PTP cameras.

Use gphoto to read images off any USB-connected digital camera, and back them up to a usb-hard drive

Some users report that in the current 5.x release of Unslung, you can't connect anything to the second USB port once you've booted off an unslung drive in the first port: http://slugbug.nslu2-linux.org/bug.php?op=show&bugid=288, but no-one on the core development team has been able to reproduce that bug.

to:

Use gphoto to read images off a supported USB-connected digital camera, and back them up to a USB hard drive. A list of supported cameras is on the gphoto site.

Changed lines 9-10 from:

So all you do it plug the camera into the free usb port and turn it on in view mode (and wait a while if you took lots of photos). You then have to delete the images from the camera manually, since I'm too paranoid to do that in the script.

to:

So all you do it plug the camera into the free USB port and turn it on in view mode (and wait a while if you took lots of photos). You then have to delete the images from the camera manually, since I'm too paranoid to do that in the script.

It was as simple as installing the hotplug and gphoto2 packages and then writing a shell script which does a gphoto2 --get-all-files and then moves the files based upon the date stored in the exif data to the appropriate directory. I just added a call to run that script to the end of /etc/hotplug/usb/libgphoto2.

So all you do it plug the camera into the free usb port and turn it on in view mode (and wait a while if you took lots of photos). You then have to delete the images from the camera manually, since I'm too paranoid to do that in the script.

Use gphoto to read images off any USB-connected digital camera, and back them up to a usb-hard drive. One small problem, though, in the current 5.x release of Unslung, you can't connect anything to the second USB port once you've booted off an unslung drive in the first port:

http://slugbug.nslu2-linux.org/bug.php?op=show&bugid=288

TMAN: stop editting out my stuff. You must not be running the same version of 5.x.

to:

Use gphoto to read images off any USB-connected digital camera, and back them up to a usb-hard drive

Some users report that in the current 5.x release of Unslung, you can't connect anything to the second USB port once you've booted off an unslung drive in the first port: http://slugbug.nslu2-linux.org/bug.php?op=show&bugid=288, but no-one on the core development team has been able to reproduce that bug.

Use gphoto to read images off any USB-connected digital camera, and back them up to a usb-hard drive.

to:

Use gphoto to read images off any USB-connected digital camera, and back them up to a usb-hard drive. One small problem, though, in the current 5.x release of Unslung, you can't connect anything to the second USB port once you've booted off an unslung drive in the first port:

http://slugbug.nslu2-linux.org/bug.php?op=show&bugid=288

TMAN: stop editting out my stuff. You must not be running the same version of 5.x.

Use gphoto to read images off any USB-connected digital camera, and back them up to a usb-hard drive. One small problem, though, in the current 5.x release of Unslung, you can't connect anything to the second USB port once you've booted off an unslung drive in the first port:

http://slugbug.nslu2-linux.org/bug.php?op=show&bugid=288

to:

Use gphoto to read images off any USB-connected digital camera, and back them up to a usb-hard drive.

Use gphoto to read images off any USB-connected digital camera, and back them up to a usb-hard drive. One small problem, though, in the current 5.x release of Unslung, you can't connect anything to the second USB port once you've booted off an unslung drive in the first port: