Using G15 pwr button pressed - General Discussion and Assistance - CHDK Forum supplierdeeply

Using G15 pwr button pressed

  • 7 Replies
  • 5929 Views
Using G15 pwr button pressed
« on: 06 / August / 2015, 09:53:43 »
Advertisements
We tried to use G15 with the latest chdk sw power button continuously pressed down.
It gives I/O error when turnin rec mode one, and camera turns off.
CHDKPTP is in use. Is there any solution for this?

*

Offline reyalp

  • ******
  • 14114
Re: Using G15 pwr button pressed
« Reply #1 on: 06 / August / 2015, 15:50:54 »
We tried to use G15 with the latest chdk sw power button continuously pressed down.
It gives I/O error when turnin rec mode one, and camera turns off.
CHDKPTP is in use. Is there any solution for this?
Are you switching to rec with the chdkptp rec command?

If the camera turned off, it may have crashed and produced a romlog: http://chdk.wikia.com/wiki/Debugging#Camera_crash_logs_.28romlog.29

It would be possible to mask out the power in C code, but this will require a special build. I can post a patch or build if you want to try, which canon firmware does your G15 have?

You could try sending
=post_levent_to_ui('UnpressPowerButton')
before switching to rec. Depending on where the problem is this might help, but I suspect it won't.
Don't forget what the H stands for.

Re: Using G15 pwr button pressed
« Reply #2 on: 18 / August / 2015, 18:13:41 »
I tried with G15 and had the similar results. If you don't have the power button pressed then you can go to "rec" mode and can shoot pictures, but if you have the power button pressed all the time then "rec" command will cause "I/O error" on chdkptp and camera will shutdown immediately (probably because the power button is being pressed :)

The =post_levent_to_ui('UnpressPowerButton') didn't have any effect.
If you have special builds to test I can try those.

Firmware Revision               : 1.00 rev 5.00
chdkptp version:    0.5-668
chdk version:          g15-100e-1.4.0-4205-full

Here's a chdkptp trace:
...
con 3> =post_levent_to_ui('UnpressPowerButton')
con 4> rec
usb_bulk_write: No such device or address
time 1.7552
ERROR: I/O error
stack traceback:
        [C]: in function 'chdk_connection.script_status'
        /usr/share/chdkptp/lua/chdku.lua:1835: in method 'script_status'
        /usr/share/chdkptp/lua/chdku.lua:1445: in method 'wait_status'
        /usr/share/chdkptp/lua/chdku.lua:932: in function </usr/share/chdkptp/lua/chdku.lua:855>
        (...tail calls...)
        /usr/share/chdkptp/lua/cli.lua:2400: in function </usr/share/chdkptp/lua/cli.lua:2399>
        (...tail calls...)
        [C]: in function 'xpcall'
        /usr/share/chdkptp/lua/cli.lua:272: in function 'cli.execute'
        /usr/share/chdkptp/lua/cli.lua:379: in function 'cli.run'
        (...tail calls...)
        /usr/share/chdkptp/lua/main.lua:274: in main chunk
        [C]: in function 'require'
        [string "require('main')"]:1: in main chunk
___>

*

Offline reyalp

  • ******
  • 14114
Re: Using G15 pwr button pressed
« Reply #3 on: 18 / August / 2015, 22:29:37 »
I tried with G15 and had the similar results. If you don't have the power button pressed then you can go to "rec" mode and can shoot pictures, but if you have the power button pressed all the time then "rec" command will cause "I/O error" on chdkptp and camera will shutdown immediately (probably because the power button is being pressed :)

The chdkptp side errors are probably just because the camera went away, so they don't tell us anything. If the camera crashed, it might have generated a romlog. If it's just shutting down because it notices the button is pressed, it won't.

Here is a test build that should hides the state of the physical power button from the firmware. Note that that you won't be able to shut down with the power button any more, but  =post_levent_to_ui'PressPowerButton'
should work

Source patch is also attached. This is a one off hack for now, to be part of the normal source it would need a script or config option.
Don't forget what the H stands for.


Re: Using G15 pwr button pressed
« Reply #4 on: 19 / August / 2015, 15:08:05 »
I tried the "hide-power-button" image and had mixed results...

What works: Goes to Rec mode when booted with powerbutton pressed
What doesnt: Shooting pictures... and most of the other buttons are also nonfunctional
...
connected: Canon PowerShot G15, max packet size 512
con> rec
con 1> shoot
ERROR: shoot failed

On G15 screen there are 1-3 lines of
        *INTERRUPTED*
        *INTERRUPTED*

The "default script" text hangs around for awhile.
The other buttons  don't work (play/shoot) when I boot the system normally (ie not pressing the power button). Can't get into CHDK menus and camera seems to be stuck in "play"-mode with system default menu. I did see the CHDK  banner on boot.
For some reason the "Video rec"-button seems to be only one that works..

The =post_levent_to_ui'PressPowerButton'  command also worked when I had the powerbutton pressed.

The normal 4224-full image seems to work as expected (ie. doesn't work when powerbutton is being cont. pressed)

With vanilla image I can dump the ROMLOG (included in attachments), but not sure if the dump is related to chdk:
  HARDWARE DEFECT!!  ShutdownReason[9] ErrorNo[18]
  ...



*

Offline reyalp

  • ******
  • 14114
Re: Using G15 pwr button pressed
« Reply #5 on: 19 / August / 2015, 16:24:56 »
I tried the "hide-power-button" image and had mixed results...

What works: Goes to Rec mode when booted with powerbutton pressed
What doesnt: Shooting pictures... and most of the other buttons are also nonfunctional
Oops. There was a silly bug in my code, sorry about that. I tested the power button change on my D10, but didn't make sure other functions were unaffected. New build and patch attached.

This seems to work on my D10, but it never had the problem switching mode when the power button is held.
Quote
With vanilla image I can dump the ROMLOG (included in attachments), but not sure if the dump is related to chdk:
  HARDWARE DEFECT!!  ShutdownReason[9] ErrorNo[18]
  ...
Thanks.  The timestamp in the romlog is "2014:07:01 09:22:23" so unless your camera clock is set very wrong, it's unrelated, and your camera hasn't recorded a crash since that date.
Don't forget what the H stands for.

Re: Using G15 pwr button pressed
« Reply #6 on: 19 / August / 2015, 18:19:10 »
Now it seems to work much better. :) I did a quick test and everything seems to work with powerbutton pressed/unpressed.
I'll try to make some more tests tomorrow.
Thanks!

Would it be possible to get this feature as some (lua)command/option (like 'hidepowerbutton') into mainline code?

The date&time was incorrect in the camera (2014-08-20 if I remember it correctly), but it was not 2014-07 so I think it's something unrelated.

While the powerbutton is disabled.. I can now turn off the camera by pressing "play" button :)
Just clicking it will bring the "<alt>" as expected, but pressing it slightly longer will shutdown camera immediately.
« Last Edit: 19 / August / 2015, 18:31:12 by martikka »

*

Offline reyalp

  • ******
  • 14114
Re: Using G15 pwr button pressed
« Reply #7 on: 19 / August / 2015, 23:32:23 »
Would it be possible to get this feature as some (lua)command/option (like 'hidepowerbutton') into mainline code?
It could, but I'm a bit reluctant to add a special script function for a relatively rare use case on one camera model. If you can build CHDK yourself, the patch I posted should will probably apply cleanly to future 1.4 versions.

It requires camera specific code for each model, so it would only be available if specifically added.

Holding the power button down is a somewhat common practice, but AFAIK the G15 is the only cam we've encountered that where it causes problems.

For 1.5, I'd like to add a more generic masking / remapping capability.
Quote
While the powerbutton is disabled.. I can now turn off the camera by pressing "play" button :)
Just clicking it will bring the "<alt>" as expected, but pressing it slightly longer will shutdown camera immediately.
If it's like most Canon P&S, this will only work before you switch to rec the first time. After that, the play button will toggle between play and rec. This is all standard firmware behavior, not CHDK.
Don't forget what the H stands for.


 

Related Topics


SimplePortal 2.3.6 © 2008-2014, SimplePortal