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

Are these software upgrades possible?

  • 187 Replies
  • 36709 Views
Re: Are these software upgrades possible?
« Reply #10 on: 05 / May / 2011, 13:26:01 »
Advertisements
I heard that it shuts off because after each picture is saved it leaks a little bit of memory. This bot takes anywhere from 400-2,000 14M images a day, every day.

You gave me an idea though. You can't have a micro controller just double tap the power button because you can get into a scenario where it ends up turning the camera off instead of on. But, if you use a relay to disconnect the power, reconnect it, then press the power button you can be sure that the button press is actually turning the camera on and not off.

The play button is another good idea I hadn't thought of. From testing it looks like the logic for the play button press is: camera off ? (T)turn on in slideshow mode : (F)go to slideshow mode, then the shutter button puts it back in normal picture taking mode. Which brings up another question:
1. is it possible make the camera think the play button is pressed while the camera is off?

*

Offline reyalp

  • ******
  • 13712
Re: Are these software upgrades possible?
« Reply #11 on: 05 / May / 2011, 16:06:23 »
I heard that it shuts off because after each picture is saved it leaks a little bit of memory. This bot takes anywhere from 400-2,000 14M images a day, every day.
Wait, you are just basing this on things you heard, not actual test results with a specific camera ?

If memory leak is the problem, then a simple software reboot should be sufficient. The amount of memory used per picture will be roughly constant, it's easy to know how many pictures you've taken in a given session. Figure out how many pictures trigger the crash, divide that number by some healthy safety margin (e.g. 4) and reboot when you reach that many photos.

Of course, there are other possibles causes of crashes. If you are using CHDK in a situation where the camera must be able to restart after a crash in any circumstances, you will still have to solve that problem.

1. is it possible make the camera think the play button is pressed while the camera is off?
... if the camera is off, how do you expect it to "think" ?
Don't forget what the H stands for.

Re: Are these software upgrades possible?
« Reply #12 on: 05 / May / 2011, 19:37:57 »
Quote
Wait, you are just basing this on things you heard
someone on this forum told me that in an older post. It restarts because of the memory leak and I'm sure for other reasons also. Sometimes it thinks the battery is low (even though the AC adapter is being used and there are no batteries in it) and turns off really prematurely. Since there are so many possible causes and fixing them is so tedious, I don't think that is worth pursuing except as a last resort.

Quote
... if the camera is off, how do you expect it to "think" ?
it has some sort of loop running in the background while it is off that enables it to turn on when the power/play button is pressed. It knows which button is pressed so something is listening and deciding which mode to go into. whatever that something is needs to be modified so that it thinks the power/play button is pressed.

It might be worthwhile to just have a loop running that reboots the camera automatically after a certain period of time. If that approach fails it looks like I'm going to have to rig a solenoid or servo to press the play button periodically to make sure it is always on. That is at least something to try.

Ok, on to the next step:
I'd like to use my SX130IS (I can get other cameras though if I have to) which is only supported in alpha at the moment. All I need CHDK to do is run a script that sets the focus on startup, reboots after a specified period of time, and goes into video rec mode at a certain time of day.
1. Is all of that possible with the current alpha build as it is?

In addition to that I'd like to be able to copy and delete images off of the SD card when the camera is not using it using the CHDK PTP interface.
2. Is that possible with the current alpha build as it is?

« Last Edit: 05 / May / 2011, 20:09:49 by John1234 »

*

Offline reyalp

  • ******
  • 13712
Re: Are these software upgrades possible?
« Reply #13 on: 05 / May / 2011, 22:37:15 »
Quote
Wait, you are just basing this on things you heard
someone on this forum told me that in an older post. It restarts because of the memory leak and I'm sure for other reasons also. Sometimes it thinks the battery is low (even though the AC adapter is being used and there are no batteries in it) and turns off really prematurely. Since there are so many possible causes and fixing them is so tedious, I don't think that is worth pursuing except as a last resort.
So this is all second hand stuff you read on the forum, not problems you have actually encountered testing your particular application ?

If so, you need to stop worrying about what other experienced in some different application with some different camera using some other build, and test with *your* camera in *your* application.
Quote
Quote
... if the camera is off, how do you expect it to "think" ?
it has some sort of loop running in the background while it is off that enables it to turn on when the power/play button is pressed. It knows which button is pressed so something is listening and deciding which mode to go into. whatever that something is needs to be modified so that it thinks the power/play button is pressed.
This is wrong. The CPU is not running when the camera is off. There must be some circuitry to power it on (which might or might not include some very small dumb micro-controller), but it is outside of the ARM firmware that CHDK interacts with.

The decision to start in rec or play mode is made much later, after the CPU has started. It boots fast enough to detect which button is still pressed. (loading CHDK takes much longer, which is why you need to long press the power button to start in REC mode)
Quote
Ok, on to the next step:
I'd like to use my SX130IS (I can get other cameras though if I have to) which is only supported in alpha at the moment. All I need CHDK to do is run a script that sets the focus on startup, reboots after a specified period of time, and goes into video rec mode at a certain time of day.
1. Is all of that possible with the current alpha build as it is?
Probably, try it and find out. If features are known to be broken, they are most likely mentioned in the development thread. Any not mentioned are either working or untested.
Quote
In addition to that I'd like to be able to copy and delete images off of the SD card when the camera is not using it using the CHDK PTP interface.
2. Is that possible with the current alpha build as it is?
As above.
Don't forget what the H stands for.


Re: Are these software upgrades possible?
« Reply #14 on: 05 / May / 2011, 23:09:37 »
Quote
So this is all second hand stuff you read on the forum, not problems you have actually encountered testing your particular application ?
To be brief, I asked why, someone said memory leak/firmware not designed to run forever, then my experiences confirmed it along with other errors as described previously.

I'll get CHDK running, attempt to get the script written (if there is enough documentation), and report back.

EDIT: I got CHDK running on the SX130IS. It is 12:30AM here so I'm off to bed. Tomorrow I'll start messing with the lua script.
« Last Edit: 06 / May / 2011, 00:35:49 by John1234 »

Re: Are these software upgrades possible?
« Reply #15 on: 06 / May / 2011, 11:41:52 »
Testing scripts is tedious. Each time you want to try a new script you have to:
turn camera off, remove card, flip write protect latch, put in card reader, save new script, remove, flip latch, put in camera, power on camera. Over and over and over.
1. how can this be done much more efficiently?

The lua documentation does not contain the commands I want like set_zoom for some reason. The uBasic docs do so I'm using that language in the form of .bas scripts instead.
2. Why are there 2 languages?
3. If uBasic already existed before lua then why use lua?
4. are their commands completely interchangeable as if they were the same language? The syntax seems different.

You were saying something abot how I would need to have 2 partitions, a boot for CHDK and a second one for saving images.
5. Why?

*

Offline zeno

  • *****
  • 889
Re: Are these software upgrades possible?
« Reply #16 on: 06 / May / 2011, 11:56:30 »
You can develop uBasic scripts on your PC or Mac using my interactive debugger - see http://www.zenoshrdlu.com/kapstuff/zubdb.html

Lua support was added because uBasic is a very small language - only integer variables (no strings, arrays or structures) and is not extensible.

If you are using cards larger than 4Gb you cannot format them as FAT16 which means you can't have CHDK automatically boot when the camera is turned on. For such cards you need two partitions - a small (16MB) FAT16 partition containing DISKBOOT.BIN and a FAT32 partition for the rest of the space which holds photos, scripts etc etc.

If you are prepared to 'install' CHDK each time you turn the camera on (i.e. do a manual firmware update) and the camera you have supports this (i.e. there's a PS.FIR file for it as well as a DISKBOOT.BIN) then you can have just one FAT32 partition.
A570, S100, Ixus 127
Author of ASSIST, STICK, WASP, ACID, SDMInst, LICKS, WICKS, MacBoot, UBDB, CFGEdit

Re: Are these software upgrades possible?
« Reply #17 on: 06 / May / 2011, 12:09:30 »
ok, I got ptpcam working and it can accomplish everything I need. (reboot, run scripts, file operations). Now I need to make it so that my own software (written in C#) can send those commands instead of using shdk-ptp.cmd.
1. Is there a COM visible dll I can use? how can I accomplish this?
EDIT: I'm using NativeWin32 to autonomously find the ptpcam window and send it key presses. That's not the correct way to do things though...

2. What lua command changes the camera mode from Tv to Video?
« Last Edit: 06 / May / 2011, 14:11:52 by John1234 »


*

Offline reyalp

  • ******
  • 13712
Re: Are these software upgrades possible?
« Reply #18 on: 06 / May / 2011, 16:38:53 »
Testing scripts is tedious. Each time you want to try a new script you have to:
turn camera off, remove card, flip write protect latch, put in card reader, save new script, remove, flip latch, put in camera, power on camera. Over and over and over.
1. how can this be done much more efficiently?
For lua, test over PTP. For ubasic, transfer the files over ptp.

Quote
The lua documentation does not contain the commands I want like set_zoom for some reason. The uBasic docs do so I'm using that language in the form of .bas scripts instead.
Most of the functions exist in both, with identical usage except as required by language syntax.
Quote
2. Why are there 2 languages?
3. If uBasic already existed before lua then why use lua?
Becuase lua is a much more powerful, flexible language. Many things you can do in lua are simply impossible in ubasic.

Quote
4. are their commands completely interchangeable as if they were the same language? The syntax seems different.
The syntax is different, but the available CHDK functions are generally the same. Except those that are impossible in ubasic.

Quote
You were saying something abot how I would need to have 2 partitions, a boot for CHDK and a second one for saving images.
5. Why?
I never said you needed two partitions. I said *if* you wanted to format the card without nuking CHDK, you'd need a second partition, and to *write your own formatting code*. Otherwise, you only need two partitions if you want to autoboot from a card larger than 4gb.

ok, I got ptpcam working and it can accomplish everything I need. (reboot, run scripts, file operations). Now I need to make it so that my own software (written in C#) can send those commands instead of using shdk-ptp.cmd.
You might want to look at http://chdk.setepontos.com/index.php?topic=4338.msg66042#msg66042

You could also build a dll from my chdkptp project pretty easily: http://chdk.setepontos.com/index.php?topic=6231.0

Quote
2. What lua command changes the camera mode from Tv to Video?
I suggest the capmode module http://chdk.wikia.com/wiki/LUA/Scripts:Standard/Lualib/Capmode (included in the full zips of chdk)

then you can just do something like
capmode=require("capmode")
capmode.set('VIDEO_STD')

Assuming the modemap is setup correctly in your port, which isn't a given since it's an alpha...
Don't forget what the H stands for.

Re: Are these software upgrades possible?
« Reply #19 on: 06 / May / 2011, 17:51:54 »
I've successfully got my software to type commands into ptpcam to make the camera take pictures without user intervention. I looked at your chdkptp project but didn't notice any extra functionality over what I already have.

TODO LIST:
1. C# software tells the camera when to press the shutter button. -DONE-
2. ability to delete all media from SD card without user intervention. -DONE-
3. Solve Power issue. ptpcam reboot commands just make the camera go black and hang. batteries have to be removed to fix it.
4. download all media from camera. You can download individual files only IF you know their full file name. need a better solution...
5. ability to change capmode. Where is the direct link to downlaod that specific library and where specifically do i put it on the SD card? What other specific steps, if any, have to be done to be able to use those commands?
« Last Edit: 06 / May / 2011, 18:54:47 by John1234 »

 

Related Topics