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

Extended time lapse with Internet connection and power saving

  • 130 Replies
  • 42290 Views
Re: Extended time lapse with Internet connection and power saving
« Reply #60 on: 17 / November / 2017, 04:57:32 »
Advertisements
I have created a new "experimental" branch with more config options that have the "dangerous" ones disabled by default.

https://github.com/alesanmanoweb/multilapse-CHDK/tree/experimental

Tomorrow I will proceed and add a "simple ftp" option

Re: Extended time lapse with Internet connection and power saving
« Reply #61 on: 17 / November / 2017, 14:30:39 »
I have added the capability to perform a simple ftp upload, along with more options directly in th config file.
It would be great if somebody could try this out :D

*

Offline Sdack

  • ***
  • 195
Re: Extended time lapse with Internet connection and power saving
« Reply #62 on: 17 / November / 2017, 23:51:58 »
Hi Alesan,

I tried your new version and this is the log for a clean attempt

Code: [Select]
root@raspberrypi_Zero-01:~# tail -f multilapse.log
Reloading config file!
Making sure camera is OFF
Waiting 5s...
Turning camera ON
Waiting 5s for boot...
Connecting
open_camera_dev_usb:usb_ptp_device_reset(): Device or resource busy
usb_ptp_get_device_status(): Device or resource busy
open_camera_dev_usb: ptp_opensession failed 0x2ff
connected: Canon IXUS 160, max packet size 512
Unpressing power button
Going into rec mode
ERROR: switch failed
Setting P mode
Setting zoom
Disabling display
sh: 1: cannot create /sys/class/leds/led1/brightness: Directory nonexistent
Temperature: sensor = 30 optics = 26
SSTT,20171118-154655,30,26
Checking brightness level
*** *** *** Pre-shooting error
Turning camera OFF
Waiting 5s...

The camera crashed - needed battery removing momentarily to come back.
The contents of multilapse was edited as follows - trying to cater for the Raspberry Pi Zero's lack of two LEDs

Code: [Select]
#!/bin/sh
echo none >/sys/class/leds/led0/trigger
echo 0 >/sys/class/leds/led0/brightness
#echo none >/sys/class/leds/led1/trigger
#echo 0 >/sys/class/leds/led1/brightness
#/usr/bin/lan951x-led-ctl --spd=0 --lnk=0
while [ true ]
do
        /root/chdkptp/chdkptp.sh -e'exec dofile("/root/multilapse-CHDK/multilapse.$
        sleep 10
done

I hope this is useful.  I see errors related to the USB so I've googled up some more similar issues and though the following info might help troubleshoot:  Here's the result of an lsusb command

root@raspberrypi_Zero-01:~/multilapse-CHDK# lsusb
Bus 001 Device 005: ID 04a9:32aa Canon, Inc.
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

I see that Device 001 is identified as a root hub - the Pi Zero's single, micro usb device is described as an OTG "on the go" adaptor

Here's a sample of the output from a dmesg command

Code: [Select]
[ 1543.744391] Indeed it is in host mode hprt0 = 00001101
[ 1543.975390] usb 1-1: New USB device found, idVendor=04a9, idProduct=32aa
[ 1543.975410] usb 1-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 1543.975433] usb 1-1: Product: Canon Digital Camera
[ 1543.975440] usb 1-1: Manufacturer: Canon Inc.
[ 1543.975447] usb 1-1: SerialNumber: E2BDC44C0F874789ADD922AB51FC3FFA
[ 1587.876785] usb 1-1: usbfs: interface 0 claimed by usbfs while 'chdkptp' sets co                                  nfig #1
[ 1587.876974] usb 1-1: usbfs: process 1051 (chdkptp) did not claim interface 0 bef                                  ore use
[ 1587.877067] usb 1-1: usbfs: process 1051 (chdkptp) did not claim interface 0 bef                                  ore use
[ 1587.877312] usb 1-1: usbfs: process 1051 (chdkptp) did not claim interface 0 bef                                  ore use
[ 1587.877671] Indeed it is in host mode hprt0 = 00001101
[ 1588.093968] usb 1-1: reset high-speed USB device number 4 using dwc_otg
[ 1588.094342] Indeed it is in host mode hprt0 = 00001101
[ 1599.146906] Indeed it is in host mode hprt0 = 00001101
[ 1599.343977] usb 1-1: reset high-speed USB device number 4 using dwc_otg
[ 1599.344352] Indeed it is in host mode hprt0 = 00001101
[ 1600.344121] usb 1-1: USB disconnect, device number 4
[ 3028.556470] Indeed it is in host mode hprt0 = 00021501
[ 3028.756382] usb 1-1: new high-speed USB device number 5 using dwc_otg
[ 3028.756820] Indeed it is in host mode hprt0 = 00001101
[ 3028.987963] usb 1-1: New USB device found, idVendor=04a9, idProduct=32aa
[ 3028.987981] usb 1-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 3028.987988] usb 1-1: Product: Canon Digital Camera
[ 3028.987995] usb 1-1: Manufacturer: Canon Inc.
[ 3028.988001] usb 1-1: SerialNumber: E2BDC44C0F874789ADD922AB51FC3FFA

Now I remember and issue I had with my main RaspBPi machine.. each time I plugged in the camera to the USB, it was identified and associated with gphoto2 an inbuilt program.  Once I uninstalled gphoto, the problem disappeared.

I just looked for gphoto on the Zero and it's not installed but perhaps theres another product doing a similar thing?
« Last Edit: 18 / November / 2017, 00:23:12 by Sdack »

*

Offline reyalp

  • ******
  • 14126
Re: Extended time lapse with Internet connection and power saving
« Reply #63 on: 18 / November / 2017, 01:43:11 »
I just looked for gphoto on the Zero and it's not installed but perhaps theres another product doing a similar thing?
The dmesg output certainly looks like something called 'usbfs' is connecting to the camera before chdkptp.

I'm not sure why it would be 'usbfs' though, google results for usbfs seem to mostly refer to an old kernel interface that shouldn't be a problem even if it was present.

What distro are you using? Are both pis running the same distro?

With the camera connected, you can use fuser and grep to see what the has the camera open, like
Code: [Select]
fuser /dev/bus/usb/001/005
If a process has it open, it will output the process id after the path, like
Code: [Select]
/dev/bus/usb/001/005:  1234
You can then find the program with
Code: [Select]
ps ax |grep 1234

the numbers after /dev/bus/usb should match whatever bus / device the camera is on,  which would be 001/005 in your lsusb output.
Don't forget what the H stands for.

*

Offline Sdack

  • ***
  • 195
Re: Extended time lapse with Internet connection and power saving
« Reply #64 on: 18 / November / 2017, 01:49:08 »
Hi Reyalp

It looks like my old enemy... gphoto 2

Code: [Select]
root@raspberrypi_Zero-01:~/multilapse-CHDK/current# lsusb
Bus 001 Device 005: ID 04a9:32aa Canon, Inc.
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
root@raspberrypi_Zero-01:~/multilapse-CHDK/current# fuser /dev/bus/usb/001/005
/dev/bus/usb/001/005:   999
root@raspberrypi_Zero-01:~/multilapse-CHDK/current# ps ax |grep 999
  999 ?        Sl     0:00 /usr/lib/gvfs/gvfsd-gphoto2 --spawner :1.4 /org/gtk/g                                    vfs/exec_spaw/4
 1014 pts/0    S+     0:00 grep 999

however when I try to uninstall it

root@raspberrypi_Zero-01:~/multilapse-CHDK/current# sudo apt-get purge gphoto2
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package 'gphoto2' is not installed, so not removed
0 upgraded, 0 newly installed, 0 to remove and 8 not upgraded.

« Last Edit: 18 / November / 2017, 01:50:52 by Sdack »

*

Offline Sdack

  • ***
  • 195
Re: Extended time lapse with Internet connection and power saving
« Reply #65 on: 18 / November / 2017, 01:57:01 »
Sorry to not provide the answers you asked for

Both machines are running the latest 'raspbian' distribution

PRETTY_NAME="Raspbian GNU/Linux 9 (stretch)"
NAME="Raspbian GNU/Linux"
VERSION_ID="9"
VERSION="9 (stretch)"
ID=raspbian
ID_LIKE=debian
HOME_URL="http://www.raspbian.org/"
SUPPORT_URL="http://www.raspbian.org/RaspbianForums"
BUG_REPORT_URL="http://www.raspbian.org/RaspbianBugs"


*

Offline reyalp

  • ******
  • 14126
Re: Extended time lapse with Internet connection and power saving
« Reply #66 on: 18 / November / 2017, 02:09:51 »
Hi Reyalp

It looks like my old enemy... gphoto 2
Try
dpkg-query -S /usr/lib/gvfs/gvfsd-gphoto2
Don't forget what the H stands for.

*

Offline Sdack

  • ***
  • 195
Re: Extended time lapse with Internet connection and power saving
« Reply #67 on: 18 / November / 2017, 02:12:00 »
root@raspberrypi_Zero-01:~/multilapse-CHDK/current# dpkg-query -S /usr/lib/gvfs/gvfsd-gphoto2
gvfs-backends: /usr/lib/gvfs/gvfsd-gphoto2

*

Offline reyalp

  • ******
  • 14126
Re: Extended time lapse with Internet connection and power saving
« Reply #68 on: 18 / November / 2017, 02:23:30 »
root@raspberrypi_Zero-01:~/multilapse-CHDK/current# dpkg-query -S /usr/lib/gvfs/gvfsd-gphoto2
gvfs-backends: /usr/lib/gvfs/gvfsd-gphoto2
so gvfs-backends is the package that owns it https://packages.debian.org/jessie/gvfs-backends

I'm not sure if you'd want to uninstall the whole package, but maybe there's a way to disable the gphoto part.
Don't forget what the H stands for.

*

Offline Sdack

  • ***
  • 195
Re: Extended time lapse with Internet connection and power saving
« Reply #69 on: 18 / November / 2017, 02:32:27 »
My Googling turned up this rather promising thread

https://superuser.com/questions/1200173/free-an-ptp-usb-device-from-gvfs-usage

But it's based on Ubuntu so I'm not sure it's compatable with raspbian

 

Related Topics


SimplePortal © 2008-2014, SimplePortal