CHDK Capabilities? - page 2 - General Discussion and Assistance - CHDK Forum supplierdeeply

CHDK Capabilities?

  • 24 Replies
  • 9772 Views
*

Offline uphid

  • *
  • 13
Re: CHDK Capabilities?
« Reply #10 on: 16 / March / 2012, 17:25:02 »
Advertisements
In my experiments thus far, the USB remote functionality interferes with the USB printer connection.  If USB remote is enabled, I'm in trouble for my regular script.

However, it seems that USB (in general) is enabled at boot.  As such, the camera seems preoccupied with making a connection, rather than running my autostart script.

I don't fully understand the set_config constants yet. This is the one used to disable USB (from the script referenced previously).  Basically, I think I need this at boot time.

set_config_value 121 1

You're far more experienced than myself with this... What would you recommend?

Re: CHDK Capabilities?
« Reply #11 on: 16 / March / 2012, 17:56:44 »
In my experiments thus far, the USB remote functionality interferes with the USB printer connection.  If USB remote is enabled, I'm in trouble for my regular script.
Yea - when I thought about my previous comment I realized that might happen.  The problem is that USB remote code in the stable branch is a real mess.  It's interlocked with the scripting engine and affects when scripting is allowed to run based on the status of the USB 5V power level and not on whether USB remote is enabled or not.   That code is so bad that it was completely nuked and the version in the dev / unstable trunk is now a complete rewrite.

Quote
However, it seems that USB (in general) is enabled at boot.  As such, the camera seems preoccupied with making a connection, rather than running my autostart script.
Once the camera recognizes that there is 5V there on the USB power plug, it probably does just that.  The reason I suggested enabling the USB remote is that CHDK blocks the 5V status from reaching the Canon firmware when that happens.  The problem with that is that it will never recognize that there is a printer there.

Quote
I don't fully understand the set_config constants yet. This is the one used to disable USB (from the script referenced previously).  Basically, I think I need this at boot time.

set_config_value 121
What that does is set the USB remote menu item to "enabled" - exactly as if you'd done it from the CHDK menu.   But using a 0 (disable) or 1 (enable) here will put you into the problem described above.

Let's try one thing on startup ?  Put a long sleep at the start of your script 
Code: [Select]
sleep(30000)  and see if that lets the printer setup before your script gets going ?

Otherwise,  it seems like you need the scripting engine to completely ignore the USB voltage status if USB remote is not enabled.   I'm not going to volunteer to try to make that work with the "stable" code but I can take a look to see if the dev version will work that way.

UPDATE : I checked the code in the main development trunk and as I expected,  the interlocks between the 5V status of the USB port and whether the scripting engine will run or not are gone.  You might have better luck with the newer trunk - http://mighty-hoernsche.de/trunk/

« Last Edit: 16 / March / 2012, 18:27:15 by waterwingz »
Ported :   A1200    SD940   G10    Powershot N    G16

*

Offline msl

  • *****
  • 1280
  • A720 IS, SX220 HS 1.01a
    • CHDK-DE links
Re: CHDK Capabilities?
« Reply #12 on: 16 / March / 2012, 18:44:59 »
I think, for a connection camera <-> printer you need a virtual USB switch. This can be realized only with a Lua script with auto start function.

Use the following commands for virtal switch:
Code: [Select]
post_levent_to_ui("DisconnectUSBCable")
post_levent_to_ui("ConnectUSBCable")

- Script start in play mode

- Virtual disconnect USB cable

- Switch to record mode

- Shooting incl. remote connection (set_config_value(121, 1))

- Switch to play mode

- Virtual connect USB cable

- Start printing

You need also a combined cable for the USB printer connection & remote control.

msl
« Last Edit: 16 / March / 2012, 19:20:29 by msl »
CHDK-DE:  CHDK-DE links

Re: CHDK Capabilities?
« Reply #13 on: 16 / March / 2012, 18:59:03 »
You need also a combined cable for the USB printer connection & remote control.
@msl  :  he has a G12 and a remote switch for that camera that operates through a jack on the side of the camera ( not the USB remote used with CHDK).  With the new trunk,  interactions with the USB power status have been removed - the print functions should work independently of the script engine as long as he does not enable USB Remote.   Another nice "feature" to the USB remote V2 code :)



« Last Edit: 16 / March / 2012, 19:01:32 by waterwingz »
Ported :   A1200    SD940   G10    Powershot N    G16


*

Offline msl

  • *****
  • 1280
  • A720 IS, SX220 HS 1.01a
    • CHDK-DE links
Re: CHDK Capabilities?
« Reply #14 on: 16 / March / 2012, 19:19:19 »
Ok, you're right, the G12 has a native remote control.

But for an automatic printer connection you need a start option: camera start in play mode & active USB connection camera <-> printer. This is necessary for a start of the print menu .That's why my idea using the virtual USB connection.

msl
CHDK-DE:  CHDK-DE links

*

Offline srsa_4c

  • ******
  • 4451
Re: CHDK Capabilities?
« Reply #15 on: 16 / March / 2012, 19:20:18 »
As far as I know,  nobody has looked at integrating CHDK with the Canon remote control used on (among others) the G series cameras.  Probably because most of the Canon P&S line does not use those controls.   So I'm not sure if it integrated as a simple switch input (in which case we could add it to the kbd.c code) or a more complicated protocal.
I think uphid could help figure this out:
He needs a build with the following part uncommented in core/gui.c
Code: [Select]
        /*
        // debug keymap, KEYS_MASKx, SD_READONLY_FLAG, USB_MASK
        extern long physw_status[3];
        sprintf(buf, "PS1: %#8x", physw_status[0]);
        draw_txt_string(28, 10, buf, conf.osd_color);

        sprintf(buf, "PS2: %#8x", physw_status[1]);
        draw_txt_string(28, 11, buf, conf.osd_color);

        sprintf(buf, "PS3: %#8x", physw_status[2]);
        draw_txt_string(28, 12, buf, conf.osd_color);
        */
With enabled "misc values" display he would need to check, whether there is reaction to the remote buttons in one of the values. If there is, they could be implemented as buttons.
The remote release itself consists of two switches, nothing more.

Re: CHDK Capabilities?
« Reply #16 on: 16 / March / 2012, 19:26:02 »
I think uphid could help figure this out:
Yes - that would be good to know.  Its not needed to fix his current challenge but it would help the community if he could.

@srsa_4c :  did you find a wiring diagram for the stock Canon remote release ?

@uphid :  I can do a custom build if you are willing to test this  - what f/w version of the G12 do you have ?

« Last Edit: 16 / March / 2012, 19:37:47 by waterwingz »
Ported :   A1200    SD940   G10    Powershot N    G16

*

Offline srsa_4c

  • ******
  • 4451
Re: CHDK Capabilities?
« Reply #17 on: 16 / March / 2012, 19:44:14 »
@srsa_4c :  did you find a wiring diagram for the stock Canon remote release ?
He mentioned an RS60 clone, so I guess it's this one (one of the first hits):
http://www.camerahacker.com/RS60-E3_pin-out/pin-out.php


Re: CHDK Capabilities?
« Reply #18 on: 16 / March / 2012, 19:59:42 »
He mentioned an RS60 clone, so I guess it's this one (one of the first hits):
http://www.camerahacker.com/RS60-E3_pin-out/pin-out.php
Thanks - I just googled G12 remote control and got a lot of advertising but no wiring data.  I can use this to "trick out" my G10 too I expect.

Ported :   A1200    SD940   G10    Powershot N    G16

*

Offline uphid

  • *
  • 13
Re: CHDK Capabilities?
« Reply #19 on: 18 / March / 2012, 19:10:00 »
Everyone:

Thanks so much for all your input.  I'm just sitting down to work on it now.  I'll post a new update with my findings.

I'll see if I can determine the pinout of the remote 2.5mm "audio" connector for you all.

I've got the newest version, the "G" firmware.

Thanks much.  Updates to follow.

 

Related Topics


SimplePortal 2.3.6 © 2008-2014, SimplePortal