Are these software upgrades possible? - page 12 - General Help and Assistance on using CHDK stable releases - CHDK Forum  

Are these software upgrades possible?

  • 187 Replies
  • 45605 Views
Re: Are these software upgrades possible?
« Reply #110 on: 21 / May / 2011, 18:51:51 »
Advertisements
Quote
What I would like to know is if the previous build (either exmem-2 or the build from the sx130 dev thread) crash with your current chdkptp and script setup.
The very first custom build wouldn't power on. After that you posted a second version that had an exmem and non-exmem subversion. the non-exmem wouldn't boot either but the exmem version did. That's the one I'm using. I think later you posted another one after that but then said not to use that one.

Re: Are these software upgrades possible?
« Reply #111 on: 22 / May / 2011, 01:42:40 »
I've got one feature left to implement ( implementing the correct capmode logic for night time video) but so far here is the current logic:
1. take about 25 pics
2. download them while monitoring the folder size to see when they have finished downloading
3. go back through and rename them with time stamps so they aren't over written on the next download and so they can be sorted correctly
4. delete them from SD card so that it doesn't run out of space
5. reboot, change mode, set zoom
still TODO:
6.  if later than 1800HRs, change capmode to video and handle shutter logic accordingly

so far it still hasn't crashed and has been running 24/7.


Re: Are these software upgrades possible?
« Reply #112 on: 22 / May / 2011, 10:42:43 »
the download command is still acting weird:
Code: [Select]
09:26:22 .press "shoot_half"; sleep(10); press "shoot_full"; sleep(3000); release "shoot_full"; sleep(10); release "shoot_half"
09:26:40 .press "shoot_half"; sleep(10); press "shoot_full"; sleep(3000); release "shoot_full"; sleep(10); release "shoot_half"
09:26:41 .press "shoot_half"; sleep(10); press "shoot_full"; sleep(3000); release "shoot_full"; sleep(10); release "shoot_half"
09:26:41 a script is already running
09:26:42 .press "shoot_half"; sleep(10); press "shoot_full"; sleep(3000); release "shoot_full"; sleep(10); release "shoot_half"
09:26:42 a script is already running
09:26:55 !dcimdirs=chdku.listdir('A/DCIM',{stat="*"}); for i,dirst in ipairs(dcimdirs) do chdku.downloaddir(joinpath('A/DCIM',dirst.name),"C:/Documents and Settings/D.ACER/Desktop/Turret Control beta/Zoom Cam Images/20110522") end
09:26:55 call failed:[string "dcimdirs=chdku.listdir('A/DCIM',{stat="*"})..."]:1: bad argument #1 to 'ipairs' (table expected, got boolean)

09:27:00 lua switch_mode_usb(0)
09:27:00 not connected
09:27:05 lua click "menu"
09:27:05 not connected
It was given a whole 13 seconds to finish doing whatever it was doing before the download command was sent yet dcimdirs STILL returned false. There is no user error since there is no user. the download command worked 30 times previous to this instance with the exact same timing. Makes no sense...

Right after that, it crashed. the ROMLOG is unique this time though. It is attached.
« Last Edit: 22 / May / 2011, 10:50:57 by John1234 »

*

Offline reyalp

  • ******
  • 14082
Re: Are these software upgrades possible?
« Reply #113 on: 22 / May / 2011, 15:30:32 »
It was given a whole 13 seconds to finish doing whatever it was doing before the download command was sent yet dcimdirs STILL returned false.
As I have told you *many* times before, listdir returns false + an error message when it fails. If you wanted to figure out what was going on, checking that would be an obvious first step.

That said, given that the previous two calls died with "a script is already running" it's a fair bet the next one did as well.

The romlog indicates something died in the shooting process. Hard to say what, but it's in a task the CHDK doesn't touch at all. It's possible the camera wasn't quite done with something when it got your next shooting command. You shoot command is quite strange, you are holding the shutter down for 3 seconds, but then only leaving 10ms after you release. This isn't at all what the camera would see if there was a human behind the shutter. There is some mention of continuous mode in the log, if this is enabled you might be taking multiple pictures in each shot, in which case the waits would really be keeping you from running into the next command.

If you have review on this should probably be turned off, or accounted for in a sleep after the shot. In any case, I'd recommend several hundred ms wait after release the shutter buttons, as the camera does a few things after the button is released.

Really, if you want to interact with the camera this way, you'd be much better off actually using =, and actually reading the output of chdkptp in your program.

Quote
There is no user error since there is no user.
::)
I grow tired of repeating myself to someone who seems unwilling or unable listen or do basic troubleshooting for themself.
Don't forget what the H stands for.


Re: Are these software upgrades possible?
« Reply #114 on: 22 / May / 2011, 17:52:15 »
Quote
That said, given that the previous two calls died with "a script is already running" it's a fair bet the next one did as well.
Right, because they were only 1 to 2 seconds apart. That is totally understandable. The download command though was 13 seconds later which should've given it way more than enough time to process the 3-4 images it took while holding the shutter down.

I still don't know how the = prefix handles an overlapping script. If it buffers it and runs it when the first one is done that could be bad. If it ignores it that isn't so bad for the shoot command but it is bad for all of the other commands since they can't be skipped over for the next command to work correctly. Do you know how the logic is set up for the = prefix?

Quote
but then only leaving 10ms after you release. This isn't at all what the camera would see if there was a human behind the shutter.
the 10ms delays are just meant to simulate the time it takes for a person to go from half to full, then from full to half as they let go of the shutter button. No time was added for the processing of the images but I can add that..

*

Offline reyalp

  • ******
  • 14082
Re: Are these software upgrades possible?
« Reply #115 on: 22 / May / 2011, 18:18:01 »
I still don't know how the = prefix handles an overlapping script.
There's a simple way to find out: Test it!

If you can't come up with a simple test case to check this out, maybe you aren't ready to undertake this kind of project.
Quote
Do you know how the logic is set up for the = prefix?
As I told you before (did I mention I'm getting sick of repeating myself ?) the "logic" is that the program blocks until the script ends. It doesn't do anything specifically to handle (or not) additional input, it just sits in a loop polling script status until the script ends or there is an error. What happens depends on how you are sending the input, and how your OS and possibly runtime libraries deal with that. If you are using a pipe for stdin, the thing feeding the pipe will block when the buffers fill up. If you are doing something else (like sending keystrokes to a window), it's up to you you to figure out what happens.

As best as I can gather, you are just blindly stuffing input into chdkptp, without monitoring output and trying to time things so it all works. This seems like a fundamentally fragile approach to me.
Don't forget what the H stands for.

Re: Are these software upgrades possible?
« Reply #116 on: 22 / May / 2011, 19:25:24 »
Quote
...without monitoring output and trying to time things so it all works.
I'm unable to figure out how to monitor the output except by reading the last line of the log file. I've definitely put a lot of time into getting the timing correct though. The shoot commands are sent faster than they should be to minimize gaps and because chdkptp or the camera is smart enough to not let the scripts interrupt each other.

Re: Are these software upgrades possible?
« Reply #117 on: 22 / May / 2011, 20:36:57 »
I tested the new logic for changing to video mode at night but it won't let me press the shutter button again after it has started recording.
Code: [Select]
20:20:08 reboot
20:20:16 lua switch_mode_usb(1)
20:20:18 .press "zoom_in"; sleep(1400); release "zoom_in"
20:20:21 .require('capmode').set('VIDEO_STD')
20:20:25 .shoot() <-- start recording
20:20:44 .shoot() <-- try to stop recording
20:20:44 a script is already running
20:20:51 .shoot()
20:20:51 a script is already running
20:21:19 .press "shoot_full"
20:21:19 a script is already running
While it is recording it thinks a script is already running.


*

Offline reyalp

  • ******
  • 14082
Re: Are these software upgrades possible?
« Reply #118 on: 22 / May / 2011, 20:51:15 »
shoot() does not just click the shoot button. It tries to do a full (still) photo, waiting for all the stages to complete. It's not appropriate for video.

The problem isn't that video recording makes it think a script is running, shoot() is probably waiting for some shooting status variable that isn't set in video mode, so the script is still running.

Try
press('shoot_half'); click("shoot_full");release("shoot_half")
to start or end video recording.

A click("shoot_full") might also be sufficient...
Don't forget what the H stands for.

Re: Are these software upgrades possible?
« Reply #119 on: 22 / May / 2011, 22:19:52 »
yep. That did it. Thanks.

 

Related Topics