Comments (4)
I don't think you'll get any error messages unless you use gp.use_python_logging()
to get gphoto2 error messages sent to Python's logging system.
Setting camera clocks seems to be very make & model dependent. See the set-camera-clock.py
example - it works for my Cannon cameras but I can't promise it works on others. The datetimeutc
config uses int(time.time())
, the syncdatetime
config takes the value 1
, and the datetime
config takes an int
or str
representation of the time depending on the widget type.
from python-gphoto2.
If I use set-camera-clock.py
the resulting time is off by 3600 sec. It uses the syncdatetime
config.
I think the 3600 sec offset is a timezone issue (I am in Europe/Amsterdam).
Because the syncdatetime
config does not work for me, I need the datetime
config.
That works when I use gphoto2
, but not with python-gphoto2
2.3.4.
Any ideas?
I added logging to the test script:
import gphoto2 as gp
import logging
# setup python logging
logging.basicConfig(
format='%(levelname)s: %(name)s: %(message)s', level=logging.WARNING)
callback_obj = gp.check_result(gp.use_python_logging())
# try to set the camera datetime
camera = gp.Camera()
camera.init()
config = camera.get_config()
OK, date_config = gp.gp_widget_get_child_by_name(config, 'datetime')
assert(OK == gp.GP_OK)
now = int(time.time())
date_config.set_value(now)
camera.set_config(config)
assert(now == date_config.get_value()) # the datetime config is properly set
camera.exit()
But the output does not seem relevant:
WARNING: gphoto2: (gp_port_usb_close [libusb.c:309]) Invalid parameters: 'port && port->pl->dh' is NULL/FALSE.
from python-gphoto2.
If you look at set-camera-clock.py
you'll see it uses the datetimeutc
config for my Canon EOS 100D - I expect you need to do the same with your Canon.
from python-gphoto2.
Thanks! That works. I have to add the utc offset (3600 or 7200 seconds depending on daylight saving) to the datetimeutc
value to get a correct datetime.
from python-gphoto2.
Related Issues (20)
- Missing pre-req's(?) after building libgphoto2 from source on Raspberry Pi HOT 3
- equivalent of gphoto2 --reset HOT 1
- delete a file HOT 2
- gp_camera_get_single_config HOT 2
- Socket error after gp_camera_exit in windows/msys2 HOT 15
- Faster way to copy files from camera HOT 7
- Sony FX3 overshoot HOT 1
- `delete_file()` does not delete file HOT 9
- Segmentation Fault segfault on gp.Camera.autodetect() on Github Actions Runner HOT 21
- LGPL vs. GPL license? HOT 8
- Test Virtual Camera HOT 4
- Missing bindings for gp_port_new, gp_port_open, and gp_port_reset? HOT 2
- capture_preview() broken in v2.5.0 HOT 4
- having trouble getting gphoto2 on rpi HOT 3
- use python-gphoto2 in Windows system HOT 1
- Always connected capture anytime HOT 1
- Github Actions Python 3.12 environment. HOT 1
- Is live data acquisition available in the library? HOT 1
- Error When Installing with "Local" libgphoto2 HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from python-gphoto2.