CHDK PTP interface - page 46 - General Discussion and Assistance - CHDK Forum  

CHDK PTP interface

  • 1241 Replies
  • 488804 Views
*

Offline reyalp

  • ******
  • 14080
Re: CHDK PTP interface
« Reply #450 on: 20 / March / 2011, 03:16:22 »
Advertisements
Solved:

The dryos ctype functions have a bug

Code: [Select]
unsigned char _ctype[] = {
...
int isdigit(int c) {
    return _ctype[c]&_D;
}
note that c is an integer. If the value falls outside of the _ctype array, a random value in memory will be used.

It is legal to pass EOF (generally int -1) to ctype functions, and lua does this.
« Last Edit: 20 / March / 2011, 03:33:16 by reyalp »
Don't forget what the H stands for.

*

Offline philmoz

  • *****
  • 3450
    • Photos
Re: CHDK PTP interface
« Reply #451 on: 20 / March / 2011, 03:43:24 »
Solved:

The dryos ctype functions have a bug

Code: [Select]
unsigned char _ctype[] = {
...
int isdigit(int c) {
    return _ctype[c]&_D;
}
note that c is an integer. If the value falls outside of the _ctype array, a random value in memory will be used.

It is legal to pass EOF (generally int -1) to ctype functions, and lua does this.


Brilliant :D

FYI - this also fixes the problem where scripts crash with an 'unexpected symbol' error if the last line of the script does not have a 'newline' character at the end (on versions of CHDK built under GCC4 / Windows).

Phil.
CHDK ports:
  sx30is (1.00c, 1.00h, 1.00l, 1.00n & 1.00p)
  g12 (1.00c, 1.00e, 1.00f & 1.00g)
  sx130is (1.01d & 1.01f)
  ixus310hs (1.00a & 1.01a)
  sx40hs (1.00d, 1.00g & 1.00i)
  g1x (1.00e, 1.00f & 1.00g)
  g5x (1.00c, 1.01a, 1.01b)
  g7x2 (1.01a, 1.01b, 1.10b)

*

Offline reyalp

  • ******
  • 14080
Re: CHDK PTP interface
« Reply #452 on: 20 / March / 2011, 04:08:27 »
FYI - this also fixes the problem where scripts crash with an 'unexpected symbol' error if the last line of the script does not have a 'newline' character at the end (on versions of CHDK built under GCC4 / Windows).
Yes, turns out this wasn't really a PTP problem. Fixed in changeset 1092
Don't forget what the H stands for.

*

Offline philmoz

  • *****
  • 3450
    • Photos
Re: CHDK PTP interface
« Reply #453 on: 20 / March / 2011, 04:21:00 »
FYI - this also fixes the problem where scripts crash with an 'unexpected symbol' error if the last line of the script does not have a 'newline' character at the end (on versions of CHDK built under GCC4 / Windows).
Yes, turns out this wasn't really a PTP problem. Fixed in changeset 1092

With the code change in 1092 the second half of the ctypes array is redundant (from 128 - 255), will save 128 bytes by deleting these values.

Phil.
CHDK ports:
  sx30is (1.00c, 1.00h, 1.00l, 1.00n & 1.00p)
  g12 (1.00c, 1.00e, 1.00f & 1.00g)
  sx130is (1.01d & 1.01f)
  ixus310hs (1.00a & 1.01a)
  sx40hs (1.00d, 1.00g & 1.00i)
  g1x (1.00e, 1.00f & 1.00g)
  g5x (1.00c, 1.01a, 1.01b)
  g7x2 (1.01a, 1.01b, 1.10b)


*

Offline reyalp

  • ******
  • 14080
Re: CHDK PTP interface
« Reply #454 on: 20 / March / 2011, 18:10:23 »
Unless there are objections, I'm planning to merge the new ptp return/message code into the trunk soon, probably today. There are still some rough edges in the code, but it seems to be functional.

This means that existing ptpcamgui and ptpcam builds will no longer work fully with the CHDK trunk. I will provide a ptpcam executable.

If users need a build with the old ptp protocol, they should not update. Alternatively, they can use the CHDKDE autobuild until that is updated.
Don't forget what the H stands for.

*

Offline achillies

  • ***
  • 227
  • SX130IS
Re: CHDK PTP interface
« Reply #455 on: 20 / March / 2011, 23:57:53 »
You do very nice work. After updating all components (ptpcam.exe = r601, ptpcam.dll = 85, gui = 85), everything seems to work as expected.  The camera connects immediately using ptpcam.exe, but when using ptpcamgui, disconnects-reconnects several times before finally connecting (but does USUALLY connect).  I'm sure this will become more reliable with time.  So far all basic GUI tests have passed.

I like the (apparent) ability to control/connect to more than one camera, even though I've only got one right now.

Again.. Nice work. Thanks for the possibilities.

Not related: Can one of you Gui-people (or Autoit-people) explain why tooltips don't work for me in the GUI?   I get no tooltips in ptpcamgui, but I do get tooltips in CHDK-Shell.  Point me to a link if necessary, but I have not been including them in my ptpcamgui changes because they don't work for me.
« Last Edit: 21 / March / 2011, 02:54:52 by achillies »
Don't let the sands of time get in your lunch.

*

Offline achillies

  • ***
  • 227
  • SX130IS
Re: CHDK PTP interface
« Reply #456 on: 21 / March / 2011, 01:56:25 »
I just have to keep doing this.  I hope I'm not getting under anyones skin.

These attachments are changes to the latest ptpcamgui (ver 85).  The TDchange85.txt file contains the changes I make to my timelapse-timedelay, and the HLPDNLDChange85.txt file contains a minor change in the DCIM progress bar as well as changes to the Main Menu Help.  It uses an external help file, which you may not appreciate.  Anyway, here they are.  The previous post contains both the ptpcamgui.au3 and ptpcamgui_obfuscated.au3 files with all of these changes if interested.
« Last Edit: 21 / March / 2011, 02:53:45 by achillies »
Don't let the sands of time get in your lunch.

*

Offline msl

  • *****
  • 1280
  • A720 IS, SX220 HS 1.01a
    • CHDK-DE links
Re: CHDK PTP interface
« Reply #457 on: 21 / March / 2011, 08:27:17 »
You do very nice work. After updating all components (ptpcam.exe = r601, ptpcam.dll = 85, gui = 85), everything seems to work as expected.
The changes of reyalp do not affect the current trunk version. These are preparations for the future ptp-interface.

These attachments are changes to the latest ptpcamgui (ver 85).  The TDchange85.txt file contains the changes I make to my timelapse-timedelay, and the HLPDNLDChange85.txt file contains a minor change in the DCIM progress bar as well as changes to the Main Menu Help.
I have integrated the minor change for the DCIM progress bar in revision 86 with some small cosmetic changes.

Some general words about the GUI:

- For a help system I prefer gui tooltips + information thread in the forums like this, maybe also in the CHDK wiki.

- Features like time-lapse, motion detection or exposure bracketing should be only basicly be available. This is a good demonstration for CHDK beginners. Advanced functions, e.g. delay functions in time lapse modul (achillies), should be handled differently for a better overview, maybe with a context menu.

- rudi has now implemented a very nice multi camera feature. You can use more than one camera with the GUI. Every Camera get a unique identification number.

- All necessary additional binaries have been packed into a DLL file, which improves the handling.

- The most important features, upload and download, works quite well. You can download all picture files. The GUI can automatically download the current CHDK or CHDK-DE from the autobuild servers, extracts the files and sends it to the camera

At the moment we should wait with other new developments. reyalp working on an improved ptpcam version. If this version is integrated into the trunk, we have much to do in ptpCamGui code.

msl
CHDK-DE:  CHDK-DE links


*

Offline achillies

  • ***
  • 227
  • SX130IS
Re: CHDK PTP interface
« Reply #458 on: 22 / March / 2011, 18:37:41 »
I understand.  I'll stop messing with it for a while ;)

The reason I started on the help file was because tooltips don't work in my version of ptpcamgui, I'm trying to figure out why.
« Last Edit: 23 / March / 2011, 02:10:05 by achillies »
Don't let the sands of time get in your lunch.

*

Offline reyalp

  • ******
  • 14080
Re: CHDK PTP interface
« Reply #459 on: 23 / March / 2011, 00:47:50 »
I've checked in the ptp message code in the trunk changeset 1101

This means that ptpcamgui and old ptpcam version will no longer work correctly. Non script functions should be ok.

I've attached a compatible ptpcam, source can be found in the reyalp-ptp branch of the chdk svn. I have not merged this into the trunk because I don't intend to maintain a version of ptpcam in the long run.

Next stop, lua client :)
Don't forget what the H stands for.

 

Related Topics