Extended time lapse with Internet connection and power saving - page 4 - General Help and Assistance on using CHDK stable releases - CHDK Forum  

Extended time lapse with Internet connection and power saving

  • 108 Replies
  • 12341 Views
*

Offline Sdack

  • ***
  • 194
Re: Extended time lapse with Internet connection and power saving
« Reply #30 on: 29 / October / 2017, 15:54:32 »
Advertisements
Hey Manoweb,

I hope you don't feel guilty , there's no obligation here, I just really appreciate your support.

I'm on my way to solving the power supply part too, I have a dummy battery but my buck regulators are in the post, so I can't supply the 3.6 volts into it.  It will be a major bonus for me if I can get this done too.

I chuckled at your comment about the temperature, I didn't realise we could access that sort of information.  These cameras are amazing aren't they!  Yes it's getting warm over here ready for summer.  It's 25 degrees now at 7am.

I will be out for a while this morning, will check the chat channel now but may miss you but, perhaps we could schedule something?
Cheers


*

Offline reyalp

  • ******
  • 12731
Re: Extended time lapse with Internet connection and power saving
« Reply #31 on: 29 / October / 2017, 15:58:16 »
Hi guys,
Back at keyboard briefly with a fresh multilapse.log having followed the correct proceedure.
This shows IO error during remote shoot. It's not clear whether the camera has crashed or run into some other problem. If you can observe what physically happens on the camera (does it shot down immediately, does it freeze while still on, does it end up powered off with the lens extended?) that might provide some clues.

You can also check for a ROMLOG: http://chdk.wikia.com/wiki/Debugging#Camera_crash_logs_.28romlog.29

I'd also suggest trying to remoteshoot from the cli, without involving the script. If it works, try to manually replicate other steps the script does before shooting, like setting the zoom, shooting mode etc.
Don't forget what the H stands for.

*

Offline Sdack

  • ***
  • 194
Re: Extended time lapse with Internet connection and power saving
« Reply #32 on: 29 / October / 2017, 16:42:27 »
romlog of latest crash

*

Offline reyalp

  • ******
  • 12731
Re: Extended time lapse with Internet connection and power saving
« Reply #33 on: 29 / October / 2017, 17:54:34 »
In IRC, sdack reported that using remoteshoot directly in the CLI doesn't trigger the crash.

This suggests that one of the other settings set in the script causes remoteshoot to fail.

My approach to debugging this would be to interactively add run more of the camera code from camera_init in the script (the stuff in cli_cmd calls), and note if / where it fails. The camera should be restarted for each step. So the first test would look like

(camera booted)
Code: [Select]
chdkptp -c -i
=post_levent_to_ui"UnpressPowerButton"
rec
remoteshoot
Assuming that works, reboot the camera,
Code: [Select]
connect
=post_levent_to_ui"UnpressPowerButton"
rec
=require("capmode").set("P")
remoteshoot
and so on, adding the lines inside the single quote ' of cli_cmd calls. You could achieve the same effect by commenting out lines in the script.

Note the camera may crash when you try to power off after using remoteshoot. This is a known issue on some cameras and likely not related to the other failure.
Don't forget what the H stands for.


*

Offline Sdack

  • ***
  • 194
Re: Extended time lapse with Internet connection and power saving
« Reply #34 on: 30 / October / 2017, 00:19:02 »
Hi,

I followed your instructions as best I could (didn't quite know what to do with "chdkptp -c -i"), so I used my live command initiation approach of path to my executable/chdkptp.sh then

All the commands seemed to work and allow remote shoot until I got to this one:

con 5> connect
connected: Canon IXUS 160, max packet size 512
con> rec
con 1> =set_prop(require("propcase").RESOLUTION, 1)
con 2> remoteshoot
WARNING: capture_get_data error I/O error
WARNING: error waiting for shot script nil
ERROR: I/O error uninit I/O error


and the camera crashed too, with the lens extended.  I attach the romlog from immediately after this crash
Cheers
S

*

Offline reyalp

  • ******
  • 12731
Re: Extended time lapse with Internet connection and power saving
« Reply #35 on: 30 / October / 2017, 00:57:01 »
I followed your instructions as best I could (didn't quite know what to do with "chdkptp -c -i"), so I used my live command initiation approach of path to my executable/chdkptp.sh then
That's fine, the chdkptp in the above should have been the .sh file on linux. -c tells it to connect to the camera, -i ensures you get the cli (probably the default in the build you have)

Quote
All the commands seemed to work and allow remote shoot until I got to this one:

con 5> connect
connected: Canon IXUS 160, max packet size 512
con> rec
con 1> =set_prop(require("propcase").RESOLUTION, 1)
con 2> remoteshoot
WARNING: capture_get_data error I/O error
WARNING: error waiting for shot script nil
ERROR: I/O error uninit I/O error


and the camera crashed too, with the lens extended.  I attach the romlog from immediately after this crash
Great. This actually makes sense :D

The script will probably work if you comment out the corresponding line, like
Code: [Select]
-- cli_cmd('=set_prop(require("propcase").RESOLUTION, 1)')
This command tries to the set the jpeg resolution. The most likely cause is that your camera doesn't support whatever resolution 1 would be. Another possibility is that the resolution propcase isn't correctly identified.

You can test this by setting each available resolution in the Canon UI. Therese are set in the "func" menu, usually with an L icon for full resolution, and one or more M resolutions like M1, M2 etc.

Select each one in turn (you don't have to actually close the menu, just highlight the option), and in chdkptp use
Code: [Select]
=return get_prop(require'propcase'.RESOLUTION)
You can use up arrow on the keyboard to get previous commands in chdkptp.

@manoweb
Resolution should probably be a config option


Don't forget what the H stands for.

*

Offline Sdack

  • ***
  • 194
Re: Extended time lapse with Internet connection and power saving
« Reply #36 on: 30 / October / 2017, 03:12:32 »
Hi,

I did as you suggested and changed the Canon pictures size settings and ran the code snippet.. here's the return for the 5 picture sizes available

L      = 0
M1   = 2
M2   = 3
S      =5
W     =0

Seems odd to me but what do I know!

Now, when I comment out the offending command, I get this in the multilapse.log from a brief session.

Reloading config file!
Making sure camera is OFF
Waiting 5s...
Turning camera ON
Waiting 5s for boot...
Connecting
connected: Canon IXUS 160, max packet size 512
Unpressing power button
Going into rec mode
Setting P mode
Disabling flash
White balance
Disabling display
Setting zoom
Setting resolution
Temperature: sensor = 35 optics = 30
SSTT,20171030-173657,35,30
Checking brightness level
BV = 176 try_focus = 0 i = 37
Remote shoot!
nil
Resizing image...
image.jpg JPEG 5152x3864 5152x3864+0+0 8-bit sRGB 3.988MB 0.060u 0:00.069
Uploading image...
curl: (6) Could not resolve host: EDIT
curl: (6) Could not resolve host: URL
curl: (6) Could not resolve host: HERE
Sleeping 120s
Temperature: sensor = 38 optics = 30
SSTT,20171030-174000,38,30
Checking brightness level
BV = 77 try_focus = 0 i = 120
Remote shoot!
nil
Resizing image...
image.jpg JPEG 5152x3864 5152x3864+0+0 8-bit sRGB 4.507MB 0.060u 0:00.070
Uploading image...
curl: (6) Could not resolve host: EDIT
curl: (6) Could not resolve host: URL
curl: (6) Could not resolve host: HERE
Sleeping 541s
SIGTERM received

Turning camera OFF
Waiting 5s...
Exiting!


And I get images in the archive folder... Hooray!

I started feeling cocky, so I added my ftp details into the multilapse-config but, despite an apparent connection to my ftp server, the images didn't upload.

log file attached

Cheers and have a great day guys




*

Offline reyalp

  • ******
  • 12731
Re: Extended time lapse with Internet connection and power saving
« Reply #37 on: 30 / October / 2017, 14:36:10 »
L      = 0
M1   = 2
M2   = 3
S      =5
W     =0
That mostly makes sense: The fact 1 isn't present explains the crash, but W seems suspect. Are you sure it isn't an 8?


Quote
I started feeling cocky, so I added my ftp details into the multilapse-config but, despite an apparent connection to my ftp server, the images didn't upload.

log file attached
Log doesn't show any obvious sign why the ftp failed, it appears to give a directory listing of the website instead.

I believe the curl command is set up to use http upload rather than ftp, so you probably need to change that if you want FTP. In any case, you can debug it outside of the script manually setting values based on the line that generates the curl command:

Code: [Select]
os.execute('curl -s -S -i -u "'..config.user..'" -F uploadedfile=@'..filename..' -F camera='..config.camera_ID..' -F timeStamp='..timestamp..' '..config.upload_URL)
Don't forget what the H stands for.


*

Offline Sdack

  • ***
  • 194
Re: Extended time lapse with Internet connection and power saving
« Reply #38 on: 31 / October / 2017, 01:35:40 »
L      = 0
M1   = 2
M2   = 3
S      =5
W     =0

That mostly makes sense: The fact 1 isn't present explains the crash, but W seems suspect. Are you sure it isn't an 8?
Yes, I double checked it just now.. it's a zero.

Quote
I believe the curl command is set up to use http upload rather than ftp, so you probably need to change that if you want FTP. In any case, you can debug it outside of the script manually setting values based on the line that generates the curl command:
Code: [Select]
os.execute('curl -s -S -i -u "'..config.user..'" -F uploadedfile=@'..filename..' -F camera='..config.camera_ID..' -F timeStamp='..timestamp..' '..config.upload_URL)
Thanks for the suggestion.  I followed your lead and debugged it in the console first.  FYI the curl command can handle heaps of up/download methods including http / ftp / sftp etc. it's not limited to one only.  However, it took me hours of fiddling to suss out how to juggle the relevant variables in multilapse.lua.  The mixture of double and single quotes confused me and it took ages to work out what was what but I got there in the end. 

I now have a fully working script.  I'm not across all the attributes yet, but I will read through and see if I can get my head around them.

I've ordered some more dc-dc buck converters - for controlling power to the camera.  It'd be great to know what resistor/s I should put in line with that Alesan.

Thanks guys
Sdack

Re: Extended time lapse with Internet connection and power saving
« Reply #39 on: 01 / November / 2017, 15:16:32 »
Hi, unfortunately the system did not trigger an email when new posts were added to this thread and I am late to the party.

I knew curl won't work for you as is, because I use HTTP POST to add additional parameter to a webpage. I'm sorry you had to go through having to figure out how to modify the whole thing.

Now:
  • reyalp, is there a way for me to check if a setting to the camera is not supported, so that I can validate the configuration?
  • I will make the resolution and possibly other values available in the config file
  • I will add a way to choose between "advanced" HTTP POST or "simpler" FTP

 

Related Topics