[Elphel-support] Setting exposure time via PHP

David Haberthür david.haberthuer at psi.ch
Mon Mar 25 09:54:48 PDT 2013


Dear all.

I'd like an 'easy' way of altering the exposure time of the Elphel
cameras I'm currently using [1].

Since I didn't manage to set the exposure time through a wget-call to a
parsedit.php-URL on the cameras I thought about writing a PHP file which
I can then call with varying parameters, based on the needs of the
user/system in the end.

The file I have come up now [2] is:
	- printing the current state of AUTOEXP_ON and EXPOS
	- loading an image from the camera with current settings
	- turning off the auto exposure [3] and setting the new exposure time
	- waiting for at least three frames
	- and trying to load an image with the new settings [4], using a
'elphel_get_frame()' to load an explicit frame number.

When I load the script on the camera [5], I see that the parameters are
changed, as PHP tells me, but the image I load after changing the
exposure time is the same as before (or at least the brightness doesn't
change), or isn't loaded at all.

Am I doing something wrong by calling a certain frame (e.g.
CamIP:8081/framenumber/img) or does it not work because that frame is
simply not available anymore, because the exposure time is so short?

Does anyone have any pointers or can show me a better way?

David

[1]: I've got a monochrome camera on loan from Alexander Poltorak, I'd
like to use it with a Raspberry Pi for some hardware prototyping and
like to set the exposure time based on user input and parameters of
another thing, all reacting on the GPIO pins of the Raspberry Pi.
[2]: http://git.io/9oWgUg
[3]: http://git.io/9oWgUg#L69
[4]: http://git.io/9oWgUg#L80
[5]: after FTP-ing it to /var/html and loading
http://CamIP/var/globaldiagnostix.php?exposure=100
-- 
Dr. David Haberthür
Swiss Light Source
Paul Scherrer Institut
WBBA/217
CH-5232 Villigen
+41 56 310 31 80




More information about the Support-list mailing list