Comment 395 for bug 85488

Revision history for this message
Robert Hutton (robert-hutton) wrote : Re: [Bug 85488] Enhancement to Joel Berger's script

Or it might not work, just re-read it properly!

Looks like the next version of Ubuntu (the "Gutsy Gibbon"!) will take care
of it.

Love,

Robert

On 30/07/07, rubik-cube <email address hidden> wrote:
>
> Joel Berger gave a nice little wrapper script in comment #45. For some
> people this worked, for some people (like me, Canoscan lide 25, Feisty)
> the scanning element would not always return to its starting position.
> Until this is fixed, I'll post a new version of his script which
> basically changes the command to really reset/wake up the scanner again.
> IMHO this workaround point out that maybe the problem could be with
> sane, and not with libusb or the kernel. Anyway, here it is:
>
> #!/bin/bash
> # plustek-wrapper: finds a plustek USB device and keeps it alive while the
> # wrapped program is running.
> # Joel Berger <hikari (at) yumemiru (dot) org> 2007-04-15
>
> # Requires:
> # sane-utils (scanimage)
> # sed
> # gawk
>
> # Detect device and store as $SANE_DEVICE
> SANE_DEVICE=$( scanimage -L | \
> grep plustek | \
> sed 's/^.*plustek/plustek/' | \
> sed "s/' is a.*//" | \
> awk -F : '{print "/dev/bus/usb/" $3 "/" $4}'
> )
>
> if [ $SANE_DEVICE ] ; then
> $* &
> CHILD_PID=$!
> while ps -p $CHILD_PID > /dev/null; do
> # cat $SANE_DEVICE > /dev/null
>
> # I'm not sure whether "scanimage -n" or
> # "scanimage -L" is better here
> scanimage -n > /dev/null
> sleep 0.7
> done
> else
> # If no plustek device is detected, bail out and run the program
> normally.
> exec $*
> fi
>
>
> ** Attachment added: "plustek_wrapper.sh script - don't forget to make
> executable!"
> http://launchpadlibrarian.net/8599730/plustek_wrapper.sh
>
> --
> some usb_devices fault if usb_suspend enabled
> https://bugs.launchpad.net/bugs/85488
> You received this bug notification because you are a direct subscriber
> of a duplicate bug.
>