CHIMP - Canon Hack Installation and Management Platform - page 8 - General Discussion and Assistance - CHDK Forum

CHIMP - Canon Hack Installation and Management Platform

  • 134 Replies
  • 32138 Views
Re: CHIMP - Canon Hack Installation and Management Platform
« Reply #70 on: 19 / June / 2017, 13:08:24 »
Advertisements
0.9.2 - 2017-06-19
Author of CHIMP, Canon Hack Installation and Management Platform

Re: CHIMP - Canon Hack Installation and Management Platform
« Reply #71 on: 21 / June / 2017, 18:42:38 »
0.9.3 - 2017-06-22
  • Improved multi-partition card handling
  • Improved CHDK module handling
  • Added support for DIGIC VI cameras: G7 X, SX60HS, SX280HS, SX275HS and SX270HS
  • Added Russian translation
  • Downgraded support for SDM (explained here)
  • Various bugfixes and code improvements
Author of CHIMP, Canon Hack Installation and Management Platform

Re: CHIMP - Canon Hack Installation and Management Platform
« Reply #72 on: 23 / June / 2017, 13:08:17 »
I'm considering adding PTP support to CHIMP, which would allow the user to seamlessly update CHDK via USB.

I'm wondering:
  • Where can I find some documentation?
  • Is there an API for querying the platform/sub?
  • How difficult would it be for me to extend if it doesn't?
Author of CHIMP, Canon Hack Installation and Management Platform

*

Offline reyalp

  • ******
  • 12107
Re: CHIMP - Canon Hack Installation and Management Platform
« Reply #73 on: 23 / June / 2017, 23:30:47 »
I'm considering adding PTP support to CHIMP, which would allow the user to seamlessly update CHDK via USB.
One difficulty is that native windows software already controls PTP devices. chdkptp uses libusb-win32, which entirely takes over access to the device.

I don't know if there is way to send arbitrary PTP commands while playing nicely with the native windows drivers. Installing libusb (and disabling normal windows PTP) doesn't seem like it would be a great option for most users, though users who also want to use chdkptp might appreciate it.

chdkptp uses libusb for portability, but even if it was possible to play nice with Windows, it wouldn't really help, because standard PTP commands sent by the OS put the camera in a state where it can no longer switch to record mode.

Quote
Where can I find some documentation?
The CHDK PTP API is documented in the ptp.h header https://app.assembla.com/spaces/chdk/subversion/source/HEAD/trunk/core/ptp.h

chdkptp is available as a sample client implementation.


Quote
Is there an API for querying the platform/sub?
The CHDK PTP API is designed to do almost everything using CHDK Lua, and all normal CHDK script functions are available. You can use get_buildinfo() to get version and platform information.

The platform (PID) can also be determined directly from the USB layer, but without the firmware version that doesn't help for installs.
Don't forget what the H stands for.


Re: CHIMP - Canon Hack Installation and Management Platform
« Reply #74 on: 24 / June / 2017, 00:13:22 »
One difficulty is that native windows software already controls PTP devices. chdkptp uses libusb-win32, which entirely takes over access to the device.

I don't know if there is way to send arbitrary PTP commands while playing nicely with the native windows drivers. Installing libusb (and disabling normal windows PTP) doesn't seem like it would be a great option for most users, though users who also want to use chdkptp might appreciate it.

I think as far as CHIMP is concerned, PTP would only be useful in update scenario. Once the user has CHDK installed, they really should get the libusb driver installed on their PC as well.

Quote
The CHDK PTP API is designed to do almost everything using CHDK Lua, and all normal CHDK script functions are available. You can use get_buildinfo() to get version and platform information.

So I just send an "execute command" command? Do I have to run Lua on the host?

Quote
The platform (PID) can also be determined directly from the USB layer, but without the firmware version that doesn't help for installs.

Well, if there are pictures in DCIM, I can always download the last one...
Author of CHIMP, Canon Hack Installation and Management Platform

*

Offline reyalp

  • ******
  • 12107
Re: CHIMP - Canon Hack Installation and Management Platform
« Reply #75 on: 24 / June / 2017, 01:11:45 »
Once the user has CHDK installed, they really should get the libusb driver installed on their PC as well.
Only if they want to use chdkptp (or other CHDK extension clients), and do not want to use the native windows PTP functionality.

Quote
So I just send an "execute command" command? Do I have to run Lua on the host?
Yes, you would use PTP_CHDK_ExecuteScript to send something like "return get_buildinfo()" then poll PTP_CHDK_ScriptStatus until the script is done and use PTP_CHDK_ReadScriptMsg to read the result. Of course, doing it at that level means writing the low level protocol code yourself.

There was once a .net client library, I don't know what the current state of it is. See https://chdk.setepontos.com/index.php?topic=9148.0 and https://github.com/mweerden/CHDKPTPRemote

You don't need Lua on the host. chdkptp allows transparently passing Lua values between the camera and host, but that is done at a higher level.
Don't forget what the H stands for.

Re: CHIMP - Canon Hack Installation and Management Platform
« Reply #76 on: 24 / June / 2017, 04:32:47 »
Once the user has CHDK installed, they really should get the libusb driver installed on their PC as well.
Only if they want to use chdkptp (or other CHDK extension clients), and do not want to use the native windows PTP functionality.

Maybe chdkptp could support showing a list view with thumbnails and multiple selection? That would be more or or less all that's missing.

Quote
Quote
So I just send an "execute command" command? Do I have to run Lua on the host?
Yes, you would use PTP_CHDK_ExecuteScript to send something like "return get_buildinfo()" then poll PTP_CHDK_ScriptStatus until the script is done and use PTP_CHDK_ReadScriptMsg to read the result. Of course, doing it at that level means writing the low level protocol code yourself.

So I can eject an entire Lua Zip library and get it to execute on the camera? Nice!

Can I overwrite lua.flt and LUALIB while it's executing however?

Quote
There was once a .net client library, I don't know what the current state of it is. See https://chdk.setepontos.com/index.php?topic=9148.0 and https://github.com/mweerden/CHDKPTPRemote

Thank you very much, I think that's exactly what I need. I'll see if it requires updating for supporting the current version of the protocol.
Author of CHIMP, Canon Hack Installation and Management Platform

Re: CHIMP - Canon Hack Installation and Management Platform
« Reply #77 on: 24 / June / 2017, 11:47:52 »
Added table support.

Source.
« Last Edit: 24 / June / 2017, 11:58:22 by dmitrys »
Author of CHIMP, Canon Hack Installation and Management Platform


Re: CHIMP - Canon Hack Installation and Management Platform
« Reply #78 on: 24 / June / 2017, 13:16:23 »
How do I get the camera model name?

I discovered that it's get_parameter_data(3) for s3is and get_parameter_data(4) for ixus870, but is there a universal way?
Author of CHIMP, Canon Hack Installation and Management Platform

*

Offline reyalp

  • ******
  • 12107
Re: CHIMP - Canon Hack Installation and Management Platform
« Reply #79 on: 24 / June / 2017, 16:08:40 »
So I can eject an entire Lua Zip library and get it to execute on the camera? Nice!
If you mean run a pure Lua zip library on the camera, in theory, yes. In practice, beware that cameras may not have enough free RAM to hold a CHDK zip in memory. Also CHDK Lua has some quirks and differences from the standard implementation: http://chdk.wikia.com/wiki/Lua#Lua_standard_libraries:_io.2C_os.2C_string.2C_and_math

If the Lua module relies on binary modules, then it wouldn't work. Currently, CHDK Lua does not support loading flt modules like standard Lua supports dll/so modules. This is something I'd like to add some day.

Quote
Can I overwrite lua.flt and LUALIB while it's executing however?
Yes. Once a flt module or lua modules is loaded, the file on disk is irrelevant. There's no locking.

Note that if you are uploading a new build, the just-upload module may not be compatible with the current core, so if you subsequently try to run another script that could fail. So you should reboot immediately after uploading a build.

Quote
How do I get the camera model name?
You can get the camera model name from the USB layer, see https://app.assembla.com/spaces/chdkptp/subversion/source/744/trunk/chdkptp.c#ln1805

The get_parameter_data ID is defined in platform_camera.h, we use it to put the model name in DNG. This is not exposed to lua currently, AFAIK.

Remember, it varies by region.
« Last Edit: 24 / June / 2017, 16:31:26 by reyalp »
Don't forget what the H stands for.

 

Related Topics