chdkptp on a Raspberry Pi - General Discussion and Assistance - CHDK Forum

chdkptp on a Raspberry Pi

  • 4 Replies
  • 8112 Views
chdkptp on a Raspberry Pi
« on: 14 / July / 2013, 20:48:41 »
Advertisements
Hello,


I'm trying to get chdkptp set up on a raspberry pi. I'm only interested in getting the console interface working and not the GUI.

The issue I'm having is that
Code: [Select]
pi@raspberrypi ~/Documents/starcamera $ ./chdkptp-sample.sh
/home/pi/Documents/starcamera/chdkptp: error while loading shared libraries: libiuplua51.so: cannot open shared object file: No such file or directory
pi@raspberrypi ~/Documents/starcamera $ locate libcdlua51.so
/home/pi/Documents/starcamera/libs/cd/libcdlua51.so
/usr/lib/libcdlua51.so

which seems strange because in chdk-sample.sh I've set

Code: [Select]
export LD_LIBRARY_PATH=/usr/lib:usr/lib
export LUA_PATH="$CHDKPTP_DIR/lua/?.lua"
"$CHDK_PTP/chdkptp" "$@" -i -c

and set CHDKPTP_DIR to the correct directory


I've worked through most of the steps in this post:
http://chdk.setepontos.com/index.php?topic=6231.msg88342#msg88342

However I haven't done this:

Quote
To the distro lua package, the following needs to be set
export LUA_SUFFIX=
export LUA_INC=/usr/include/lua5.1

Because I don't know what, or where, these things are.

I'm using all the precompiled libraries
cd-5.6.1_Linux32_lib.tar.gz
chdkptp-r384-raspbian-gui.zip
iup-3.8_Linux32_lib.tar.gz
lua-5.2.1_Linux32_lib.tar.gz

on a pi with Raspbian "Wheezy" os

As always any help is greatly appreciated.
-murk


*

Offline reyalp

  • ******
  • 14125
Re: chdkptp on a Raspberry Pi
« Reply #1 on: 14 / July / 2013, 21:05:46 »
I'm trying to get chdkptp set up on a raspberry pi. I'm only interested in getting the console interface working and not the GUI.
If you don't want the gui, then I'd suggest you just build chdkptp without it, by setting
IUP_SUPPORT=0
CD_SUPPORT=0
in config.mk (see config-sample-linux.mk)

chdkptp itself is much easier to build than the IUP and CD libraries.

Quote
chdkptp-r384-raspbian-gui.zip
Note that this includes all the GUI libraries, so you shouldn't need to build them yourself. Instead, just point your LD_LIBRARY_PATH at the appropriate location.

edit:
If you just extract the whole package to /home/pi/pietest your chdkptp.sh should look like this
Code: [Select]
#!/bin/sh
CHDKPTP_DIR=/home/pi/pietest
export LD_LIBRARY_PATH=$CHDKPTP_DIR/libs/cd:$CHDKPTP_DIR/libs/iup
export LUA_PATH="$CHDKPTP_DIR/lua/?.lua"
"$CHDKPTP_DIR/chdkptp" "$@"
I tested that this runs on my setup.

Also note if the gui is built in, you must use a command line option like -i or -e, otherwise it will attempt to start the gui.
« Last Edit: 14 / July / 2013, 21:17:40 by reyalp »
Don't forget what the H stands for.

Re: chdkptp on a Raspberry Pi
« Reply #2 on: 15 / July / 2013, 14:34:07 »
Thank you very much. I was unaware that all that was included in the chdkptp zip. I just reset the LD_LIBRARY_PATH as you said and it worked and connected nicely.


I think I found a bug with CHDK 1.2. I was unable to switch to rec mode to take pictures with chdkptp (either on the pi or my desktop. I reverted back to CHDK 1.1 on the camera and I was able to connect switch to rec and take pictures successfully again.



Code: [Select]
con 15> list
*1:Canon PowerShot A470 b=001 d=005 v=0x4a9 p=0x317a s=7FF1D1BE1F8146C1A7BDE032EEDCA340
con 16> rec
con 17> shoot                 # no picture so I tried
con 18> rec shoot raw=1       # all one command still nothing
con 19> rec shoot tv=10.0 raw=1
con 20> play                  # chech mode by switching
ERROR: already in play        # was in play all along



This is the 1.2 build I was using CHDK_DE_a470-102c-1.2.0-full_rev_2930.zip


Thank you again for the assistance
-murk

*

Offline reyalp

  • ******
  • 14125
Re: chdkptp on a Raspberry Pi
« Reply #3 on: 15 / July / 2013, 16:14:09 »
Thank you very much. I was unaware that all that was included in the chdkptp zip. I just reset the LD_LIBRARY_PATH as you said and it worked and connected nicely.
Glad to know it works. If you are concerned about resource usage, it might still be worthwhile to build a cli only version. (edit: though I think most of the .so files will only get loaded if you actually use the gui)

Actually, I guess I could include cli and gui binaries in the next snapshot.
Quote
I think I found a bug with CHDK 1.2. I was unable to switch to rec mode to take pictures with chdkptp (either on the pi or my desktop. I reverted back to CHDK 1.1 on the camera and I was able to connect switch to rec and take pictures successfully again.
I'll try to take a look later, but I don't think this code has changed. Maybe srsa can comment, I think he has an a470?

In my experience, there are a few camera can get in a confused state where mode switch stops working. Generally this seems to happen if you switch modes using the on-camera controls while connected to PTP (for example, if you pressed the physical play button after entering record mode with "rec") or if you have had the camera disconnected from USB and used rec mode, and then plugged it in without rebooting. I haven't worked out exactly when / how this happens, ant it likely varies by camera.

Quote
con 18> rec shoot raw=1       # all one command still nothing
Just FYI, you can't combine commands like this. It should give you an error I guess, but since rec doesn't take any arguments it doesn't check at all.
« Last Edit: 15 / July / 2013, 17:30:31 by reyalp »
Don't forget what the H stands for.

*

Offline srsa_4c

  • ******
  • 4451
Re: chdkptp on a Raspberry Pi
« Reply #4 on: 15 / July / 2013, 16:26:18 »
Maybe srsa can comment, I think he has an a470?
Just tried (trunk r2954, self compiled), it works as it should. Perhaps trouble with the CHDK config file or the modules?

 

Related Topics


SimplePortal © 2008-2014, SimplePortal