DIYBookScanner / spreads

Modular workflow assistant for book digitization
GNU Affero General Public License v3.0
127 stars 53 forks source link

Camera configuration issue #164

Closed Cypris2010 closed 9 years ago

Cypris2010 commented 9 years ago

Got a new camera today (old broke, its a Canon A 810) and had to install CHDK o the new one and did the old one too. Had to use V 1.3 since 1.2 doesn't seem to be availible.

I'm running this in an raspberry pi b+ with the spreadpi built 20150206.

Now when I try to configure the cameras I'll alsways get this:

(Required for shooting with two devices) [y/N]: y
Setting target page on cameras
Please connect and turn on the device labeled 'odd'
Press any key when ready.
spreads.plugin: Finding devices for driver "CHDKCameraDevice"
spreads encountered an error:
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/spreads/main.py", line 318, in main
    run()
  File "/usr/local/lib/python2.7/dist-packages/spreads/main.py", line 308, in run
    args.subcommand(config)
  File "/usr/local/lib/python2.7/dist-packages/spreads/cli.py", line 232, in configure
    _set_device_target_page(config, target_page)
  File "/usr/local/lib/python2.7/dist-packages/spreads/cli.py", line 183, in _set_device_target_page
    devs[0].set_target_page(target_page)
  File "/usr/local/lib/python2.7/dist-packages/spreadsplug/dev/chdkcamera.py", line 166, in set_target_page
    self._device.upload_file(tmp_handle[1], "OWN.TXT")
  File "/usr/local/lib/python2.7/dist-packages/chdkptp/device.py", line 222, in upload_file
    status, error = self._lua.call("con:stat", remote_path)
  File "/usr/local/lib/python2.7/dist-packages/chdkptp/lua.py", line 54, in call
    return self._parse_rval(fn(*args))
  File "/usr/local/lib/python2.7/dist-packages/chdkptp/lua.py", line 35, in _parse_rval
    status, rval = rval
ValueError: too many values to unpack

Is the problem with CHDK 1.3 or the todays built?

jbaiter commented 9 years ago

CHDK 1.3 should work fine, I was using the latest build last weekend and it worked. This seems to be a problem in my chdkptp code :-/ I'll look into it, thanks!

Cypris2010 commented 9 years ago

Where do the OWN.TXT file has to be on the camera?

jbaiter commented 9 years ago

It should be in the root of the SDCard on the camera.

OliPelz commented 9 years ago

I can confirm this error with the latest built 3ede013042dc0fd7f7ae6ac9ba08c76485c8a12b and a Canon A2200.

Best, Oliver

OliPelz commented 9 years ago

last working version was : a40b4b528f070af80ec65657d9cc952f4455fd80 after that you switched to chdkptp.py and the error starts to occur for me.

jbaiter commented 9 years ago

Oliver, can you please upload debug logs so I can see what is sent to the camera and what is received?

ronmortensen commented 9 years ago

Any updates on this issue by chance?

jbaiter commented 9 years ago

Did not get any logs or more specific information that could help with debugging, so no progress/updates, sorry. What I need is a log of the application running with --verbose while encountering this error. Also great would be a confirmation that uploading a file with chdkptp from the command-line does work, ideally with debug output enabled (-e"set cli_verbose=2").

OliPelz commented 9 years ago

Hey sorry for not sending you any log files!

I killed one of my cameras while hacking a permanent power supply and now waiting for a cheap one to pop up on ebay ;). I will update you if I am back in "scanning business".

ronmortensen commented 9 years ago

I am happy to send you those logs. I am really new to working with spreads and this process. Would you mind giving me the exact command line you would like run and where the logs should be located along with how you would like me to send them and I can do that today or tomorrow.

jbaiter commented 9 years ago

Ron, sure, here you go:

To test capture with verbose output: $ spread --verbose capture /tmp/test The logs can now be found in ~/.config/spreads/spreads.log, upload them to something like pastebin and post the link in this thread.

To test file upload with chdkptp, first download/unpack/build chdkptp for your architecture, switch into the directory and run the following commands:

$ echo "ODD" > test.txt
$ LUA_PATH=./lua/?.lua ./chdkptp -e "set cli_verbose=2" -e "upload ./test.txt A/OWN.TXT"

Copy the output from chdkptp to a file, upload it somewhere and post the link in this thread

ronmortensen commented 9 years ago

Thank you for your help. I am receiving the error when trying to configure the camera initially. I am using:

camera: canon powershot a2500.
spreads version: 0.5git20150415.c525 chdkptp version: host:2.6 cam:2.6

Here is the command I ran:

./spread --loglevel debug --logfile /tmp/spreads.log --verbose configure

The screen output is located here: http://pastebin.com/YdqBTHiA

The logfile output is here: http://pastebin.com/QqmMZBh3

I used the following command to confirm chdktp's ability to upload a file:

LUA_PATH=./lua/?.lua ./chdkptp "-econnect" "-eset cli_verbose=2" "-eupload ./test.txt A/OWN.TXT"

The screen output is located here: http://pastebin.com/itSk05Kc

jbaiter commented 9 years ago

Perfect, @ronmortensen!

I managed to track down the error and fix it in the library that wraps chdkptp. You can upgrade it to the latest version with this command:

$ pip install --upgrade chdkptp.py

I also registered the newer version in spreads, so the next nightly packages and images should install the correct version automatically.

ronmortensen commented 9 years ago

Thank you for your help and patience with me. I ran the upgrade command listed above. All seemed to go ok, but I am still receiving the same error. I am not sure if I should have been in a specific directory when issuing the upgrade command or not.

The screen capture of the upgrade process and the resulting error message when running spread configure is here: http://pastebin.com/xNWc7qGG

Thanks again for your help. Sorry if I missed something obvious.

ronmortensen commented 9 years ago

I did notice the OWN.TXT file from my testing above was still on the camera. I manually deleted the OWN.TXT file from the camera and ran the configure command again. I am still receiving an error, but the stack trace now matches the initial stack trace on this issue. You can find it here: http://pastebin.com/1M2kvuEi

jbaiter commented 9 years ago

@ronmortensen, the stacktraces you posted are from an older chdkptp.py version. Did you run the pip install command inside the virtualenv that you start spreads from? If so, maybe try uninstall the chdkptp.py package and then reinstalling it.

ronmortensen commented 9 years ago

Thank you for being patient with me. I was in the directory of the virtual environment, but had not set up my environment properly.

I executed source ~/.spreads/bin/activate

and then executed:

pip install --upgrade chdkptp.py

and now I successfully configured both cameras. Thanks again for your help.