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

Extended time lapse with Internet connection and power saving

  • 130 Replies
  • 42293 Views
*

Offline Sdack

  • ***
  • 195
Re: Extended time lapse with Internet connection and power saving
« Reply #80 on: 19 / November / 2017, 19:50:53 »
Advertisements
Sudden, unexpected success!!!

While I was writing my last post, I started wondering if the issues I was experiencing were 'permissions based'.. 'owenership' of the USB port having been mentioned somewhere in my research.

So I decided to double check that my bash-script based installation of chdkptp, which I run as the default Raspberry Pi user user 'pi' (as opposed to multilapse via sudo root), was in fact still working. 

On my first attempt to run the script I was shocked to find a fail with the same exact error I've been getting with multilapse:

pi@raspberrypi_Zero-01:~/share/scripts $ ./CHDK_remote_15.sh
ERROR: unrecognized argument delete DCIM
CHDK PTP control utility
Usage: chdkptp [options]
Options:
 -g  start GUI - default if GUI available and no options given
 -i  start interactive cli
 -c  connect at startup, with optional device spec e.g. -c"-d001 -bbus-0"
 -e  execute cli command, multiple allowed, e.g -e"u DISKBOOT.BIN" -ereboot
 -r  specify startup command file, if no file given skip default startup files
 -h  help
open_camera_dev_usb: ptp_opensession failed 0x2ff
open_camera_dev_usb:usb_ptp_device_reset(): Device or resource busy
usb_ptp_get_device_status(): Device or resource busy
connected: Canon IXUS 160, max packet size 512
ERROR: switch failed
ERROR: already in play


I have had the occasional failure with my script which I've sometimes put down vaguely to either the presence (or lack of) of a DCIM folder.  So this time, I put the camera into none-chdk ie. Canon mode, having established that there was no DCIM folder present, took a single image (thereby creating a DCIM folder), before attempting another run. 

The second run worked just fine so I proceeded to fire up multilapse and BOOM!

Multilapse has been shooting away merrily every 60 seconds for the last 40 minutes and uploading to my website.

Could it be something as simple as a lack of a DCIM folder causing the problem?

I just tried multilapse on my second IXUS160 and it's working fine too.

Great to have it working but the inconsistency is a little troubling

*

Offline reyalp

  • ******
  • 14126
Re: Extended time lapse with Internet connection and power saving
« Reply #81 on: 19 / November / 2017, 21:21:19 »
pi@raspberrypi_Zero-01:~/share/scripts $ ./CHDK_remote_15.sh
ERROR: unrecognized argument delete DCIM
CHDK PTP control utility
Usage: chdkptp [options]
Options:
It's not clear what happened here without the script, but it seems chdkptp was started with some commands it didn't recognize.

Quote
Could it be something as simple as a lack of a DCIM folder causing the problem?
It should have no effect at all on CHDK. I suppose it is possible that it has some effect on the behavior of the linux gphoto stuff. On my pi, the presence or not of a DCIM folder doesn't appear to make any difference.
Don't forget what the H stands for.

*

Offline Sdack

  • ***
  • 195
Re: Extended time lapse with Internet connection and power saving
« Reply #82 on: 19 / November / 2017, 21:29:57 »
Hey Reyalp,

I really appreciate your time and patience..

Here's the chdkptp part of my bash script

Code: [Select]
sudo sh /usr/local/bin/chdkptp-r735/chdkptp.sh -c -e "delete DCIM" -e"luar sleep(2000)" -e"rec" -e"luar set_zoom(0)" -e"luar sleep(3000)" -e"luar set_mf(1) set_focus(3000) set_raw(0) shoot()" -e"luar sleep(2000)" -e"play" -e"sleep(1000)" -e"mdl DCIM /media/pi/PiStore/tmp" -e"luar sleep(2000)" -e"delete DCIM" -e"lua sleep(1000) post_levent_to_ui('PressPowerButton')" -e"dis"

*

Offline Sdack

  • ***
  • 195
Re: Extended time lapse with Internet connection and power saving
« Reply #83 on: 19 / November / 2017, 21:36:45 »
I am hoping i can get some voltage report uploaded to the internet along with the images, so I know when I need to return to the location and swap battery packs.

I see this call for temperature, in the multilapse.lua

status, ts, to = con:execwait_pcall[[return get_temperature(1), get_temperature(0)]]

But I haven't been able to track down a similar call for battery status in the command reference.

If you know where I should be looking, please send a link.

Re: Extended time lapse with Internet connection and power saving
« Reply #84 on: 19 / November / 2017, 21:44:25 »
If you know where I should be looking, please send a link.

From the CHDK scripting  crossreference : get_vbatt( )
Ported :   A1200    SD940   G10    Powershot N    G16

*

Offline Sdack

  • ***
  • 195
Re: Extended time lapse with Internet connection and power saving
« Reply #85 on: 19 / November / 2017, 21:51:00 »
Awesome thanks, I just ran it in a live chdkptp session

= return get_vbatt( )
13:return:3796

I'm assuming that the return value = 3.796 volts?

Which is interesting because this is from the same camera that's been taking pictures for well over an hour and recently shut itself down.  I just restarted it to run this command.

[Edit]  My Digital Multimeter confirms the voltage of that battery to be 3.78v
« Last Edit: 19 / November / 2017, 21:53:22 by Sdack »

*

Offline reyalp

  • ******
  • 14126
Re: Extended time lapse with Internet connection and power saving
« Reply #86 on: 19 / November / 2017, 21:53:11 »
Code: [Select]
sudo sh /usr/local/bin/chdkptp-r735/chdkptp.sh -c -e "delete DCIM"
OK, that makes sense, the initial error message and chdkptp usage is because there's a space after the first -e. chdkptp (unlike many programs) requires there be no space between the switch and arguments. I don't think this has any connection to the other problems, it just means the initial "delete DCIM" doesn't run.
Don't forget what the H stands for.

Re: Extended time lapse with Internet connection and power saving
« Reply #87 on: 19 / November / 2017, 21:54:26 »
I'm assuming that the return value = 3.796 volts?
Yes.  But IIRC whether that's actually 3.796 volts is a question of the calibration applied to your port by whoever did the actual porting.

Quote
Which is interesting because this is from the same camera that's been taking pictures for well over an hour and recently shut itself down.  I just restarted it to run this command.
Batteries will tend to recover a bit after they have been shut off and show a higher voltage on restart.  I think it's a thermal thing. That does not mean they have automagically somehow recharged though.
Ported :   A1200    SD940   G10    Powershot N    G16

*

Offline reyalp

  • ******
  • 14126
Re: Extended time lapse with Internet connection and power saving
« Reply #88 on: 19 / November / 2017, 21:58:37 »
I'm assuming that the return value = 3.796 volts?
Yes.  But IIRC whether that's actually 3.796 volts is a question of the calibration applied to your port by whoever did the actual porting.
The only calibration is what CHDK considers "low" and "full" for display purposes, the actual values from get_vbatt are whatever the firmware reports, and AFAIK everyone who has reported measuring them has found them to be fairly accurate.
Don't forget what the H stands for.

Re: Extended time lapse with Internet connection and power saving
« Reply #89 on: 19 / November / 2017, 22:00:53 »
Yes.  But IIRC whether that's actually 3.796 volts is a question of the calibration applied to your port by whoever did the actual porting.
The only calibration is what CHDK considers "low" and "full" for display purposes, the actual values from get_vbatt are whatever the firmware reports, and AFAIK everyone who has reported measuring them has found them to be fairly accurate.
Thanks.  I guess I did not "recall correctly".
Ported :   A1200    SD940   G10    Powershot N    G16

 

Related Topics


SimplePortal © 2008-2014, SimplePortal