2 Years Timelapse during working hours - page 2 - General Chat - CHDK Forum  

2 Years Timelapse during working hours

  • 20 Replies
  • 11114 Views
Re: 2 Years Timelapse during working hours
« Reply #10 on: 13 / December / 2012, 17:45:28 »
Advertisements
You can try a Lua script with os.date . That offers more possibilities.
@msl :  its always better with Lua, isn't it ?  Nice script.  I'd suggest one change to avoid missing a shot due to the sleep(60000) spanning  a minute mark occasionally.

Code: (lua) [Select]
--[[
@title tl test
]]

while true do
    if os.date("%w") > 0 and os.date("%w") < 6 then -- only mo - fr
        if os.date("%H") >= 8 and os.date("%H") < 17 then -- only 8 - 17
            if os.date("%M")%15 == 0 then -- every 15 minutes a shoot
                shoot()
                sleep(60000)             
            end
        end
    end
    sleep(30000)
end
Ported :   A1200    SD940   G10    Powershot N    G16

*

Offline lapser

  • *****
  • 1093
Re: 2 Years Timelapse during working hours
« Reply #11 on: 13 / December / 2012, 19:37:30 »
When you're speaking about "get_tick_time" , you mean "Get_time" ? how can it overflow if I erase the previously get_time ?
or do you mean "sleep t" that can overflow after a bunch of time ?
get_tic_time returns the number of milliseconds since the camera was turned on. If you run the camera long enough it will overflow the 64 bit integer value.
Oops, I meant get_tick_count. There is no get_tick_time, sorry.
http://chdk.wikia.com/wiki/CHDK_scripting#get_tick_count

I also just learned that CHDK doesn't have long integers. They are all 32 bit, even if you specify long. So get_tick_count overflows after the camera has been on 2^31 msec, or about 24 days

Your idea to just use sleep would accumulate errors over time. It wouldn't be accurate. I'm not sure if it would overflow after 24 days or not. If it bases its sleep time on get_tick_time, it would.

EOS-M3_120f / SX50_100b / SX260_101a / G1X_100g / D20_100b
https://www.youtube.com/user/DrLapser/videos

*

Offline lapser

  • *****
  • 1093
Re: 2 Years Timelapse during working hours
« Reply #12 on: 13 / December / 2012, 19:50:24 »
http://www.amazon.com/ACK-DC10-Replacement-Adapter-PowerShot-Digital/dp/B003CRBIYA/
I bought the equivalent adapter for my SX260 from this company and it works great. Buy two of them at that price, since the shipping isn't that much more for 2.
EOS-M3_120f / SX50_100b / SX260_101a / G1X_100g / D20_100b
https://www.youtube.com/user/DrLapser/videos

Re: 2 Years Timelapse during working hours
« Reply #13 on: 14 / December / 2012, 03:38:46 »
You can try a Lua script with os.date . That offers more possibilities.
@msl :  its always better with Lua, isn't it ?  Nice script.  I'd suggest one change to avoid missing a shot due to the sleep(60000) spanning  a minute mark occasionally.

Code: (lua) [Select]
--[[
@title tl test
]]

while true do
    if os.date("%w") > 0 and os.date("%w") < 6 then -- only mo - fr
        if os.date("%H") >= 8 and os.date("%H") < 17 then -- only 8 - 17
            if os.date("%M")%15 == 0 then -- every 15 minutes a shoot
                shoot()
                sleep(60000)             
            end
        end
    end
    sleep(30000)
end

Ok tank's alot ! that seemed too easy...
I got an error message : ":6: attempt to compare number with string"
I printed os.date, it seems to be number, but maybe it's the caracters

I tried this to see the type of the value returned by os.date... but it doesn't works (error ":6: attempt to call global lua_isnumber' (a nil value)"). Must be the syntax of the function. I keep trying, but if you have the answer before I find it... ;)
Code: [Select]
--[[
@title lua Test
--]]

while true do
print(lua_isnumber(os.date("%w")))
print(lua_isnumber(os.date("%H")))
print(lua_isnumber(os.date("%M")))
        print("end")
        sleep(60000)             
end

I'm just beginning  to learn LUA before finishing learning basic... this explain why I don't understand a word of this error message :-X


http://www.amazon.com/ACK-DC10-Replacement-Adapter-PowerShot-Digital/dp/B003CRBIYA/
I bought the equivalent adapter for my SX260 from this company and it works great. Buy two of them at that price, since the shipping isn't that much more for 2.

that's the one I ordered ;)
« Last Edit: 14 / December / 2012, 03:47:26 by BZHades »


Re: 2 Years Timelapse during working hours
« Reply #14 on: 14 / December / 2012, 04:14:41 »
I checked the LUA guide

Quote
os.date ([format [, time]])

Returns a string or a table containing date and time, formatted according to the given string format.

If the time argument is present, this is the time to be formatted (see the os.time function for a description of this value). Otherwise, date formats the current time.

If format starts with '!', then the date is formatted in Coordinated Universal Time. After this optional character, if format is the string "*t", then date returns a table with the following fields: year (four digits), month (1--12), day (1--31), hour (0--23), min (0--59), sec (0--61), wday (weekday, Sunday is 1), yday (day of the year), and isdst (daylight saving flag, a boolean).

If format is not "*t", then date returns the date as a string, formatted according to the same rules as the C function strftime.

When called without arguments, date returns a reasonable date and time representation that depends on the host system and on the current locale (that is, os.date() is equivalent to os.date("%c")).
*

The os.date returns a string, so I have to convert it into numbers. But with lua_tonumber(os.date("%...")) I got the same error as previously "attempt to call... nil value"
How can I return os.date as a number ? in case of strict equality, it's not a problem wether it's a number or string (I can compare two string), but there, this must be inferior, superior or between...

Re: 2 Years Timelapse during working hours
« Reply #15 on: 14 / December / 2012, 04:38:46 »
I think I found the solution ... "tonumber"

Code: [Select]
--[[
@title Timelapse CTRGE
]]

while true do
    if tonumber(os.date("%w")) > 0 and tonumber(os.date("%w")) < 6 then -- only mo - fr
        if tonumber(os.date("%H")) >= 8 and tonumber(os.date("%H")) < 17 then -- only 8 - 17
            if tonumber(os.date("%M"))%15 == 0 then -- every 15 minutes a shoot
                shoot()
                sleep(60000)             
            end
        end
    end
    sleep(30000)
end

This way, it doesn't return any error message. I launched it it seems to work

Ok, thank you everybody for the help !

Next step :
- fix the camera one the wall (need to buy screw for ball head)
- wait for the AC coupler

Do you know a way with ixus 100 iS (Elph sd780) to get the photo form SD card, format it with USB port ? This way I could get all my pictures without touching the camera, so the point of view won't change event a little bit, where it would if I get SD card manually.

*

Offline msl

  • *****
  • 1280
  • A720 IS, SX220 HS 1.01a
    • CHDK-DE links
Re: 2 Years Timelapse during working hours
« Reply #16 on: 14 / December / 2012, 05:11:17 »
Sorry, my script was a little bit wrong. Yes, os.date() returns a string. We must convert this string with tonumber().

But you have found the solution by yourself.  :)

For picture transfer you can use chdkptp. But you must read a lot about PTP and CHDK:

-> http://chdk.setepontos.com/index.php?topic=6231.0
-> http://trac.assembla.com/chdkptp/browser/trunk/USAGE.TXT
-> https://www.assembla.com/spaces/chdkptp/documents

msl
CHDK-DE:  CHDK-DE links

Re: 2 Years Timelapse during working hours
« Reply #17 on: 14 / December / 2012, 08:27:56 »
Do you know a way with ixus 100 iS (Elph sd780) to get the photo form SD card, format it with USB port ? This way I could get all my pictures without touching the camera, so the point of view won't change event a little bit, where it would if I get SD card manually.
You might also want to look at eye-fi cards.   

http://en.wikipedia.org/wiki/Eye-Fi

Ported :   A1200    SD940   G10    Powershot N    G16


*

Offline lapser

  • *****
  • 1093
Re: 2 Years Timelapse during working hours
« Reply #18 on: 14 / December / 2012, 12:58:22 »
You might also want to look at eye-fi cards.   
There's a new standard for wireless cards that sounds exciting. Take a look at the Toshiba FlashAir card.
http://www.toshiba-components.com/FlashAir/index.html

It's brand new, but it should work with CHDK (I think). It sets up its own wireless hot spot. You can connect to it with a smart phone or computer, and download pictures with a web browser. No extra software is required. It might even be possible to monitor the pictures coming out of the camera remotely, by relaying the signal through a computer to the Internet (with extra software).

Another part of the standard is that it can transfer any kind of file, not just pictures., and can upload files as well as download. That gives the possibility of uploading scripts and new versions of CHDK without removing the card, although that might involve some software changes to CHDK. Plus,there should be more companies producing them soon since it's a standard.

It's available through Amazon, for a little under $100 including shipping. That way you get a bit of a guarantee and a return possibility.
http://www.amazon.com/gp/product/B009ZBUHZ8/

However, I remember philmoz talking about the memory full problems that happen when you have a lot of pictures on the card. I think he said that the camera uses memory for each picture. I'm not sure what happens when a picture disappears off the card, though. I doubt that the camera releases the memory for that picture, but I don't really know. The point is, you may run out of memory trying to take that many pictures over that long a time.

One solution would be to reboot the camera every day after you're finished with that day's pictures. There's a Lua command for that, and an option to re-start the script when  the camera re-boots.
EOS-M3_120f / SX50_100b / SX260_101a / G1X_100g / D20_100b
https://www.youtube.com/user/DrLapser/videos

Re: 2 Years Timelapse during working hours
« Reply #19 on: 14 / December / 2012, 13:29:35 »
Do you know a way with ixus 100 iS (Elph sd780) to get the photo form SD card, format it with USB port ? This way I could get all my pictures without touching the camera, so the point of view won't change event a little bit, where it would if I get SD card manually.
You might also want to look at eye-fi cards.   

http://en.wikipedia.org/wiki/Eye-Fi

I love you ...  :-* :xmas you have THE solution !
I knew this card exists, but I didn't think about it. I think it's the best solution for me : no contact, I can get all the picture from the card when I want. Furthermore, with the plate for fixing it on the ball head(or even a very small ball head), it would have been impossible to get the sd card whithout taking the camera off its support.

It's a bit more than I wanted to spend (I will spend more in the eyfi card than in my camera...  :lol ), but that's reasonnable.

 

Related Topics


SimplePortal 2.3.6 © 2008-2014, SimplePortal