Daniel Reetz, the founder of the DIY Book Scanner community, has recently started making videos of prototyping and shop tips. If you are tinkering with a book scanner (or any other project) in your home shop, these tips will come in handy. https://www.youtube.com/channel/UCn0gq8 ... g_8K1nfInQ

Spreads on Linux Mint: First Impressions

General discussion about software packages and releases, new software you've found, and threads by programmers and script writers.
spomwii
Posts: 69
Joined: 17 Jun 2011, 07:57

Re: Spreads on Linux Mint: First Impressions

Post by spomwii » 16 Sep 2013, 14:10

Thanks,

I am trying this command

Code: Select all

spread --verbose download --no-parallel-download ~/tommy/Documents
But I am getting this error:

Code: Select all

spread --verbose download --no-parallel-download ~/tommy/Documents
usage: spread [-h] [--verbose]
              {configure,capture,download,postprocess,output,wizard,gui} ...
spread: error: unrecognized arguments: --no-parallel-download
It looks to me like it does not recognize the no parallel switch. Do I have a typo or something?

Edit: I did update from github before I tried.

User avatar
jbaiter
Posts: 98
Joined: 17 Jun 2013, 16:42
E-book readers owned: 2
Number of books owned: 0
Country: Germany
Location: Munich, Germany
Contact:

Re: Spreads on Linux Mint: First Impressions

Post by jbaiter » 16 Sep 2013, 14:38

Try uninstall the stable version before you install from GitHub.

On my machine with a clean check out and a fresh virtualenv everything works as it should:

Code: Select all

(spreads)spreads(master*) ± spread download --help
usage: spread download [-h] [--no-parallel-download] [--keep]
                       [--first-page FIRST_PAGE]
                       path

positional arguments:
  path                  Path where scanned images are to be stored

optional arguments:
  -h, --help            show this help message and exit
  --no-parallel-download
                        Do not download from multiple devices at once.
  --keep, -k            Keep files on devices after download
  --first-page FIRST_PAGE, -fp FIRST_PAGE
                        Set device with first page (left/right) [default:
                        left]
(spreads)spreads(master*) ± spread download --no-parallel-download /tmp/foo
There is a problem with your device configuration:
Could not find any compatible devices!
(spreads)spreads(master*) ± 
spreads: Command-line workflow assistant

spomwii
Posts: 69
Joined: 17 Jun 2011, 07:57

Re: Spreads on Linux Mint: First Impressions

Post by spomwii » 16 Sep 2013, 14:45

Sorry but how do I uninstall the stable version? My Linux knowledge is very limited :? But I am learnig every day ;)

spomwii
Posts: 69
Joined: 17 Jun 2011, 07:57

Re: Spreads on Linux Mint: First Impressions

Post by spomwii » 16 Sep 2013, 15:16

I have no idea what I am doing here but I tried

Code: Select all

pip uninstall spreads
and installed it again with

Code: Select all

pip install -e .

No the no parallel command worked but still same error. (there are only images in the right folder) Here is full output:

Code: Select all

spread --verbose download --no-parallel-download test2
spreads.plugin: Detecting support for attached devices
spreads.plugin: Creating device manager
stevedore.extension: found extension EntryPoint.parse('chdkcamera = spreadsplug.dev.chdkcamera:CHDKCameraDevice')
stevedore.extension: found extension EntryPoint.parse('a2200 = spreadsplug.dev.chdkcamera:CanonA2200CameraDevice')
spreads.plugin: Trying to match device "Canon Digital Camera" with plugin CHDKCameraDevice
spreads.plugin: Trying to match device "Canon Digital Camera" with plugin CanonA2200CameraDevice
spreads.plugin: Plugin matched device!
PTPDevice: Executing script: "
                file=io.open('A/OWN.TXT')
                content=file:read()
                file:close()
                return content
                "
PTPDevice: Camera returned: LEFT
PTPDevice: Orientation is: "left"
spreads.plugin: Trying to match device "Canon Digital Camera" with plugin CHDKCameraDevice
spreads.plugin: Trying to match device "Canon Digital Camera" with plugin CanonA2200CameraDevice
spreads.plugin: Plugin matched device!
PTPDevice: Executing script: "
                file=io.open('A/OWN.TXT')
                content=file:read()
                file:close()
                return content
                "
PTPDevice: Camera returned: RIGHT
PTPDevice: Orientation is: "right"
spreads.plugin: Trying to match device "BCM2045B" with plugin CHDKCameraDevice
spreads.plugin: Trying to match device "BCM2045B" with plugin CanonA2200CameraDevice
spreads.plugin: Trying to match device "Biometric Coprocessor" with plugin CHDKCameraDevice
spreads.plugin: Trying to match device "Biometric Coprocessor" with plugin CanonA2200CameraDevice
spreads.plugin: Trying to match device "EHCI Host Controller" with plugin CHDKCameraDevice
spreads.plugin: Trying to match device "EHCI Host Controller" with plugin CanonA2200CameraDevice
spreads.plugin: Trying to match device "EHCI Host Controller" with plugin CHDKCameraDevice
spreads.plugin: Trying to match device "EHCI Host Controller" with plugin CanonA2200CameraDevice
spreads.plugin: Trying to match device "UHCI Host Controller" with plugin CHDKCameraDevice
spreads.plugin: Trying to match device "UHCI Host Controller" with plugin CanonA2200CameraDevice
spreads.plugin: Trying to match device "UHCI Host Controller" with plugin CHDKCameraDevice
spreads.plugin: Trying to match device "UHCI Host Controller" with plugin CanonA2200CameraDevice
spreads.plugin: Trying to match device "UHCI Host Controller" with plugin CHDKCameraDevice
spreads.plugin: Trying to match device "UHCI Host Controller" with plugin CanonA2200CameraDevice
spreads.plugin: Trying to match device "UHCI Host Controller" with plugin CHDKCameraDevice
spreads.plugin: Trying to match device "UHCI Host Controller" with plugin CanonA2200CameraDevice
spreads.plugin: Trying to match device "UHCI Host Controller" with plugin CHDKCameraDevice
spreads.plugin: Trying to match device "UHCI Host Controller" with plugin CanonA2200CameraDevice
Downloading  images from devices
spreads.workflow: Downloading images from devices to test2, files will not remain on the devices.
spreads.workflow: Creating project directory
spreads.workflow: Creating camera directories
spreads.workflow: Starting download process
PTPDevice[left]: Executing script: "return(get_image_dir())"
PTPDevice[left]: Camera returned: A/DCIM/104___09
PTPDevice[left]: Executing script: "flist = os.listdir("A/DCIM/104___09")
table.sort(flist)
return flist[1]"
PTPDevice[left]: Camera returned: IMG_0855.JPG
PTPDevice[left]: Executing script: "return(table.getn(os.listdir('A/DCIM/104___09')))"
PTPDevice[left]: Camera returned: 3
PTPDevice[left]: Executing script: "flist = os.listdir("A/DCIM/104___09")
table.sort(flist)
return flist[3]"
PTPDevice[left]: Camera returned: IMG_0857.JPG
PTPDevice[left]: Downloading "test2/left/IMG_855.JPG"
PTPDevice[right]: Executing script: "return(get_image_dir())"
PTPDevice[right]: Camera returned: A/DCIM/104___09
PTPDevice[right]: Executing script: "flist = os.listdir("A/DCIM/104___09")
table.sort(flist)
return flist[1]"
PTPDevice[right]: Camera returned: IMG_2399.JPG
PTPDevice[right]: Executing script: "return(table.getn(os.listdir('A/DCIM/104___09')))"
PTPDevice[right]: Camera returned: 3
PTPDevice[right]: Executing script: "flist = os.listdir("A/DCIM/104___09")
table.sort(flist)
return flist[3]"
PTPDevice[right]: Camera returned: IMG_2401.JPG
PTPDevice[right]: Downloading "test2/right/IMG_2399.JPG"
PTPDevice[right]: Download complete
PTPDevice[right]: Downloading "test2/right/IMG_2400.JPG"
PTPDevice[right]: Download complete
PTPDevice[right]: Downloading "test2/right/IMG_2401.JPG"
PTPDevice[right]: Download complete
spreads encountered an error:
Traceback (most recent call last):
  File "/home/tommy/spreads/spread", line 39, in <module>
    spreads.cli.main()
  File "/home/tommy/spreads/spreads/cli.py", line 313, in main
    args.func(args)
  File "/home/tommy/spreads/spreads/cli.py", line 134, in download
    workflow.download(devices, path)
  File "/home/tommy/spreads/spreads/workflow.py", line 116, in download
    raise exc
PTPError: (8194, 'unexpected return code 0x2002')

(.spreads)tommy@tommy-ThinkPad-T61 ~/spreads $ 

User avatar
jbaiter
Posts: 98
Joined: 17 Jun 2013, 16:42
E-book readers owned: 2
Number of books owned: 0
Country: Germany
Location: Munich, Germany
Contact:

Re: Spreads on Linux Mint: First Impressions

Post by jbaiter » 16 Sep 2013, 15:48

Good, this means that the problem is not related to the parallel triggering...
Mark has reported the same error (0x2002, which is "PTP_RC_GeneralError"), which occurs on the device.
I will see if I can get around to do some debugging on the "pyptpchdk" package, maybe I can find something...
Could you try to download the images with the "chdkptp" command-line utility (available here) and report back whether it worked? Both this tool and the Python extension used by spreads rely on the same underlying library, maybe the module is using an older, more buggy, version of it.
spreads: Command-line workflow assistant

spomwii
Posts: 69
Joined: 17 Jun 2011, 07:57

Re: Spreads on Linux Mint: First Impressions

Post by spomwii » 16 Sep 2013, 16:27

Good.

I would really like to test the chdkptp utility but I just don't know how to install it. It looks to me like it is only for Ubuntu 10.04? Will it work on Linux Mint?

User avatar
jbaiter
Posts: 98
Joined: 17 Jun 2013, 16:42
E-book readers owned: 2
Number of books owned: 0
Country: Germany
Location: Munich, Germany
Contact:

Re: Spreads on Linux Mint: First Impressions

Post by jbaiter » 16 Sep 2013, 16:37

spomwii wrote:Good.

I would really like to test the chdkptp utility but I just don't know how to install it. It looks to me like it is only for Ubuntu 10.04? Will it work on Linux Mint?
Those instructions should work with Mint as well, Mint is based on Ubuntu and shares most of the packages.
Just download the latest binaries for x86_64, unzip them somewhere and then try to run it:

Code: Select all

$ cd /path/to/chdkptp
$ LUA_LIBS=/path/to/chdkptp/lua/?.lua ./chdkptp
You should see a GUI, where you can browse and download the files from the device.
spreads: Command-line workflow assistant

spomwii
Posts: 69
Joined: 17 Jun 2011, 07:57

Re: Spreads on Linux Mint: First Impressions

Post by spomwii » 16 Sep 2013, 16:48

I get this error

Code: Select all

tommy@tommy-ThinkPad-T61 ~/Downloads/chdkptp $ LUA_LIBS=/home/tommy/Downloads/chdkptp/lua/?.lua ./chdkptp
bash: ./chdkptp: cannot execute binary file

yesplease
Posts: 8
Joined: 28 Nov 2012, 04:07
Number of books owned: 0
Country: Sweden

Re: Spreads on Linux Mint: First Impressions

Post by yesplease » 19 Jan 2014, 06:05

Awesome work!
But as i dont know so little about using Ubuntu,I followed this tutorial word by word and cant solve any problems by myself
https://github.com/jbaiter/spreads/blob ... torial.rst

When i enter the command: spread configure
I get the error message: There is a problem with your configuration file(s):
plugins not found


I used CHDKPTP for linux, also tried linux-raspbian.

Cypris2010
Posts: 11
Joined: 06 Feb 2014, 10:58
Number of books owned: 0
Country: Germany

Re: Spreads on Linux Mint: First Impressions

Post by Cypris2010 » 06 Feb 2014, 12:05

I had the same. I got rid of this by creating the config.yaml an fixing dependencies. Don't know witch one fixt the problem.

Post Reply