chdkptp - alternative ptp client - page 105 - General Discussion and Assistance - CHDK Forum

chdkptp - alternative ptp client

  • 1106 Replies
  • 559468 Views
*

Offline reyalp

  • ******
  • 14125
Re: chdkptp - alternative ptp client
« Reply #1040 on: 10 / December / 2019, 00:47:26 »
Advertisements
That works thanks. I changed copy_built_lua to create the liblua52.a link instead of the dylib files.
Thanks. I made it default to nogui on OSX, and changed the lua lib link to be the same as linux.
Don't forget what the H stands for.

*

Offline reyalp

  • ******
  • 14125
Re: chdkptp - alternative ptp client
« Reply #1041 on: 10 / December / 2019, 23:35:50 »
In chdkptp r924, I added some commands to the devutil module for working with non-CHDK PTP operations.

In particular, dptpsendobj allows uploading files to a camera without CHDK installed, which may save some round trips with the card reader while porting.

Note that some cameras crash if the upload file name does not include A/, while other crash if it does. I don't know which are which. A540 requires A/, while IIRC all my other cameras do not.

devutil can be loaded with
Code: [Select]

!require'extras/devutil'.init_cli()
which can be included in your user.chdkptp startup file.

devutil has a number of other goodies, which aren't new but may not have been described here

dromlog downloads the romlog, automatically decodes vxworks
The dprop* commands allow you to snapshot and compare propcase values
dl* allow you start and stop UART redirect logging (on cameras that support it), and download the UART and camera logs
Don't forget what the H stands for.

Re: chdkptp - alternative ptp client
« Reply #1042 on: 22 / December / 2019, 05:35:09 »
Hi all,  I'm just getting started with chdkptp on OSX. I've tried running
Code: [Select]
chdkptp -elist and
Code: [Select]
./chdkptp.sh -elist but I keep getting the following output:



open_camera_dev_usb: ptp_opensession failed 0x2ff
Device status OK
open_camera_dev_usb: ptp_opensession 2 failed: 0x2ff
!1: b=020 d=028 ERROR: connection failed

Is that normal? I suspect something is trying to access the USB port. Is there a fix to this? I'm on 10.13.6.


EDIT: Solved! I forgot to run
Code: [Select]
sudo chmod -x "/System/Library/Image Capture/Devices/PTPCamera.app/Contents/MacOS/PTPCamera"
« Last Edit: 22 / December / 2019, 05:52:24 by dayzman »

*

Offline koshy

  • *****
  • 1096
Re: chdkptp - alternative ptp client
« Reply #1043 on: 13 / January / 2020, 12:40:56 »
The build system with msys2 that I set up to build CHDKPTP which works fine on 874 which was then current fails on 925. The error I get is undefined reference to "clock_gettime" and to "clock_getres". Stackoverflow suggests to add -lrt to the end of the gcc call to fix that on earlier versions of gcc but I did not figure out how to do just that in the makefile.

gcc --version reports 4.8.2

Quote
Code: [Select]
gcc -Wall filename.c -lrt -O2For gcc version 4.6.1, -lrt must be after filename.c otherwise you get a link error.
« Last Edit: 13 / January / 2020, 12:44:50 by koshy »
Koshy had a little ELPH which wasn't white as snow but everywhere that Koshy went the ELPH was sure to go. (actually an SD, but that detail ruins the rhyme...)

*

Offline reyalp

  • ******
  • 14125
Re: chdkptp - alternative ptp client
« Reply #1044 on: 13 / January / 2020, 13:14:48 »
The build system with msys2 that I set up to build CHDKPTP which works fine on 874 which was then current fails on 925. The error I get is undefined reference to "clock_gettime" and to "clock_getres". Stackoverflow suggests to add -lrt to the end of the gcc call to fix that on earlier versions of gcc but I did not figure out how to do just that in the makefile.
Try adding adding rt to SYS_LIBS, like
Code: [Select]
SYS_LIBS=ws2_32 kernel32 winmm rt
But the stack overflow you linked in is for linux, so this may not be the solution on windows. My environment does not have an 'rt' lib. mingw targets would generally be expected to use microsoft runtime libraries.

chdkptp won't try to use clock_* if CLOCK_MONOTONIC is not defined, so you could undefine that, I guess.
Quote
gcc --version reports 4.8.2
My msys2 gcc is 9.2.0  :blink:
Don't forget what the H stands for.

*

Offline koshy

  • *****
  • 1096
Re: chdkptp - alternative ptp client
« Reply #1045 on: 13 / January / 2020, 16:00:51 »
Quote
gcc --version reports 4.8.2
My msys2 gcc is 9.2.0  :blink:
That's great because it means it works. If I recall right I had trouble with putting the extlibs folder together so that it would work on current gcc, the error I was getting which I forgot but could probably reproduce by trying again with what I have suggested that I needed to use the same version of gcc as the iup and/or lua files had been compiled with and gcc 4.8 worked so I didn't try to do more. Would you zip your extlibs folder that works with gcc 9.2 and throw it on some file host? I'd then conveniently set up a current mingw instead of a legacy one...
Koshy had a little ELPH which wasn't white as snow but everywhere that Koshy went the ELPH was sure to go. (actually an SD, but that detail ruins the rhyme...)

*

Offline reyalp

  • ******
  • 14125
Re: chdkptp - alternative ptp client
« Reply #1046 on: 13 / January / 2020, 16:47:31 »
Would you zip your extlibs folder that works with gcc 9.2 and throw it on some file host? I'd then conveniently set up a current mingw instead of a legacy one...
setup-ext-libs.sh should work in an msys2 mingw shell. At the very least, -pretend should give you the download links for the CD and IUP files. It currently uses the mingw6 files.
Don't forget what the H stands for.

*

Offline koshy

  • *****
  • 1096
Re: chdkptp - alternative ptp client
« Reply #1047 on: 13 / January / 2020, 17:09:18 »
So, there is an automatism I missed or neglected to look for. Good to know.
I put it together manually. I'll try the script with current mingw. I'll also try undefining what you pointed out.
Koshy had a little ELPH which wasn't white as snow but everywhere that Koshy went the ELPH was sure to go. (actually an SD, but that detail ruins the rhyme...)

*

Offline reyalp

  • ******
  • 14125
Re: chdkptp - alternative ptp client
« Reply #1048 on: 13 / January / 2020, 19:10:51 »
So, there is an automatism I missed or neglected to look for. Good to know.
Setting it up manually was the recommended way before the last release
The script is misc/setup-ext-libs.bash
Use -help for options.

edit:
Quote
I'll also try undefining what you pointed out.
CLOCK_MONOTONIC comes from the msys/mingw headers, so one would expect the functions to be available in the runtime libraries if defined. Undefining it would be a last resort.
« Last Edit: 13 / January / 2020, 19:14:14 by reyalp »
Don't forget what the H stands for.

*

Offline koshy

  • *****
  • 1096
Re: chdkptp - alternative ptp client
« Reply #1049 on: 13 / January / 2020, 21:28:07 »
So, there is an automatism I missed or neglected to look for. Good to know.
Setting it up manually was the recommended way before the last release
What a relief, I thought I had missed that it was easy to do. Well, thanks for making it easy.
For anyone doing this later This Msys2 / MinGW writeup seems worthwhile, details building a lot of other interesting stuff on Windows as well. Once the basic steps are through get CHDKPTP trunk, run reyalps great new script misc/setup-ext-libs.bash and build CHDKPTP with make.
Koshy had a little ELPH which wasn't white as snow but everywhere that Koshy went the ELPH was sure to go. (actually an SD, but that detail ruins the rhyme...)

 

Related Topics


SimplePortal © 2008-2014, SimplePortal