Donnerstag, 28. August 2014

DSLR freeze - cam reset implemented

In some rare cases the DSLR freezes.
In this situation a power reset of the DSLR was the only way, to get it back to normal operation.
Due to the fact that the cam will be mounted on the roof of a house, the option of a remote-power-reset is desirable.
The idea was to switch a relay by one of the GPIO-ports of Raspi, remotely controlled via web-frontend.
Bash script 'camera_reset.sh':
#!/bin/bash
gpio mode 7 out
sleep 2
gpio write 7 1
sleep 3
gpio write 7 0
sleep 2
gpio mode 7 in
The "sleep" delays between the commands were necessary, to create a stable situation during command execution.
If the commands were executed without the delays, in some cases the commands were not executed properly or the RASPI freezes.
It was necessary, to use GPIO7 instead of GPIO16 or GPIO15, because GPIO16 and GPIO15 were immediately active during reboot of the raspi, and remained active - so the cam was not powered after a reboot of the raspi.
GPIO7 remains inactive (0) after reboot - so the cam is directly powered after reboot.
Also GPIO's 15 and 16 were not really stable.
In some cases the RASPI was freezed after switching GPIO15 or 16 as an OUT to 1 or 0.
Since I use GPIO7, I never experienced any freeze of the RASPI.
GPIO numbering:
WiringPi GPIO7 = Raspi GPIO4 = Raspi Pin7
see here:
http://wiringpi.com/wp-content/uploads/2013/03/gpio1.png
(howto's for script execution from a website, and the realized electrical circuit see earlier posts)

Keine Kommentare:

Kommentar veröffentlichen