power off authomatically - General Help and Assistance on using CHDK stable releases - CHDK Forum  

power off authomatically

  • 41 Replies
  • 9827 Views
*

Offline timgor

  • ***
  • 150
power off authomatically
« on: 28 / April / 2013, 14:16:56 »
Advertisements
Hi!
Did anybody have a problem that camera switches off itself after a few hours of continuous work in a motion detection mode?
What can it be? CHDK issue, general canon camera issue or just external power stability issue (external power slightly jumps)?
Thanks

Re: power off authomatically
« Reply #1 on: 28 / April / 2013, 14:26:32 »
Did anybody have a problem that camera switches off itself after a few hours of continuous work in a motion detection mode?
It would be interesting to know if the camera is crashing or switching off for some other reason.  There is a "Save ROM crash log" in the Debug menu that will dump a file if a crash occured.  Try that and post it here?

Quote
What can it be? CHDK issue
Possibly.  What script are you using?

Quote
general canon camera issue
Probably not.

Quote
or just external power stability issue (external power slightly jumps)?
If your power supply is a problem,  the shutdowns will happen randomly.  Some right away and others after a long time.  What timing pattern do you have ?
Ported :   A1200    SD940   G10    Powershot N    G16

*

Offline reyalp

  • ******
  • 14117
Re: power off authomatically
« Reply #2 on: 28 / April / 2013, 15:53:14 »
Hi!
Did anybody have a problem that camera switches off itself after a few hours of continuous work in a motion detection mode?
Does the lens retract, or does it shut down with the lens out? If the lens is out, then it probably crashed and you should get a romlog like waterwingz said.

Another possibility might be overheating. I never verified it rigorously, but I suspect the cameras have the capability to shutdown if they get too hot.
Don't forget what the H stands for.

*

Offline timgor

  • ***
  • 150
Bug report
« Reply #3 on: 02 / May / 2013, 11:03:04 »
My preliminary results are folowing:

I tested a3400is camera and I used a3400-101a-1.1.0 version.
1.  I did test of motion.lua script for 4-5 times and camera shut-down every time after about 3 hours of work.
2.  I relapced md_detect_motion() function by sleep(300000) and it started to work "forever" so the problem is in the md_detect_motion function.
3. the ROMLOG.LOG file has the following content:

Exception!! Vector 0x10
Occured Time  2013:04:29 10:50:17
Task ID: 14483488
Task name: PhySw
Exc Registers:
0x9727FF40
0x00000000
0x00000001
0x00000048
0x9727FF40
0x03C68900
0x405E5480
...........................
The full version is attached.

The website says " This occurs when the code attempts to access an invalid memory address."
I have just installed development version and ready to debug source files.
I would appreciate if somebody can help me or say what part of code makes the problem.
Thanks.!
 
« Last Edit: 02 / May / 2013, 11:18:44 by timgor »


*

Offline timgor

  • ***
  • 150
Re: power off authomatically
« Reply #4 on: 02 / May / 2013, 12:04:21 »
Does everything happen in motion_detector.c file and md_detect_motion(void) function or bug can be in other wrappers?

*

Offline reyalp

  • ******
  • 14117
Re: power off authomatically
« Reply #5 on: 02 / May / 2013, 13:04:12 »
Does everything happen in motion_detector.c file and md_detect_motion(void) function or bug can be in other wrappers?
The romlog tells you the crash happened in PhySw task (also referred to as kbd_task etc in CHDK)

Since it's an exception, the registers give you the exact address where exception occurred: PC (R15) = 0x03C683FA in this case. That looks like it's in CHDK code, since it's a RAM address, not ROM and not the relativity low addresses of the canon code that's copied to RAM in newer cameras.

However, without the original files from the build, it's hard to figure out which line of code that corresponds to. If you can make you own build of CHDK, that's the next step. You should use the 1.2 trunk rather than 1.1, since it will be easier to debug modules. Be sure to save the core/main.bin.dump and modules/.o/*.elf files from your build.

Install your new build and turn on "module logging" in the misc->modules menu. Run your build until the crash happens again. Save the new ROMLOG, and look up the PC address in main.dump, or if it isn't there, figure out which module it is in from modules.log, disassemble the corresponding ELF as described in http://chdk.wikia.com/wiki/Debugging#Debugging_modules and look up the address there.

If this seems too complicated, I can provide you with a build to run.
Don't forget what the H stands for.

Re: power off authomatically
« Reply #6 on: 02 / May / 2013, 14:29:20 »
Does everything happen in motion_detector.c file and md_detect_motion(void) function or bug can be in other wrappers?
The romlog tells you the crash happened in PhySw task (also referred to as kbd_task etc in CHDK)
CHDK scripts are executed by the kbd_task (or PhySw) so it seems likely the crash is happening in the md_detect_motion() function based on timgor's description.   There were quite a few recent changes to that code so its possible a bug was recently introduced.  I'll try some extended testing on my cameras too.
Ported :   A1200    SD940   G10    Powershot N    G16

*

Offline timgor

  • ***
  • 150
Re: power off authomatically
« Reply #7 on: 02 / May / 2013, 18:18:26 »
Can I just debug writing
"flag1", "flag2" to a file from the C code?
Will it work for the camera?

#include <stdio.h>

FILE *file = fopen("file.txt","a");
fprintf(file,"%s","flag1");
fprintf(file,"%s","flag2");
...
fclose(file);


Re: power off authomatically
« Reply #8 on: 02 / May / 2013, 19:28:46 »
Can I just debug writing "flag1", "flag2" to a file from the C code?
You can certainly do that.   But for something that takes hours to occur, it seems you would be better off knowing as much as possible about what caused the exception to occur?  The process reyalp described will give you that.
Ported :   A1200    SD940   G10    Powershot N    G16

*

Offline reyalp

  • ******
  • 14117
Re: power off authomatically
« Reply #9 on: 02 / May / 2013, 22:41:58 »
Here is a test build. If you get a romlog from a crash with this build, I'd be happy to try to find where the error is.

You can certainly debug using a file, but an exception has the potential to show you the exact line where the fault happened. Using files can also cause other crashes due to having to many file handles open at the wrong time...
Don't forget what the H stands for.

 

Related Topics


SimplePortal 2.3.6 © 2008-2014, SimplePortal