Skip to content

Commit

Permalink
fixed bug that caused excessive heat (#67)
Browse files Browse the repository at this point in the history
* fixed bug that caused excessive heat

* something besides the ir leds was still using current in the nightvision mode, was audible with the buildin mic :D
  • Loading branch information
iothing authored and samtap committed Mar 20, 2017
1 parent 2392427 commit 47e320c
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions data/usr/bin/fang-ir-control.sh
Expand Up @@ -2,10 +2,11 @@

echo "IR script started"
# ir_init
gpio_ms1 -n 2 -m 1 -v 1
gpio_aud write 1 1 0
gpio_aud write 0 2 1
gpio_aud write 1 0 0
#gpio_ms1 -n 2 -m 1 -v 1 # this causes increased current flow
gpio_ms1 -n 2 -m 1 -v 0 # has something to do with the ir-cut/pass filter movement
gpio_aud write 1 1 0 # pin 1 is an output and is set to low, purpose unknown
gpio_aud write 0 2 1 # pin 2 is an input, the photoresistor
gpio_aud write 1 0 0 # pin 0 is an output and set to low, these are the ir-leds

sleep 3

Expand All @@ -19,17 +20,20 @@ do
then
if [ $IR_ON -eq 1 ]
then
gpio_ms1 -n 2 -m 1 -v 1
gpio_aud write 1 0 0
gpio_ms1 -n 2 -m 1 -v 1 # filter movement enabled
gpio_aud write 1 0 0 # disable ir led and latch the filter in the correct position
gpio_ms1 -n 2 -m 1 -v 0 # filter movement disabled
echo 0x40 > /proc/isp/filter/saturation
IR_ON=0
fi
else
if [ $IR_ON -eq 0 ]
then
echo 0x0 > /proc/isp/filter/saturation
gpio_aud write 1 0 1
gpio_ms1 -n 2 -m 1 -v 0
gpio_ms1 -n 2 -m 1 -v 0 # filter movement enabled
gpio_aud write 1 0 1 # enable ir led and latch the filter in the correct position
gpio_ms1 -n 2 -m 1 -v 1 # # filter movement disabled
echo 0x40 > /proc/isp/filter/saturation
IR_ON=1
fi
fi
Expand Down

3 comments on commit 47e320c

@hybe022
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. this trick worked and camera is running cool now.

One problem is that the image is reddish/violet-ish when IR is ON / Night mode
Is there any way to fix it?

@davidjb
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@hybe022 This was fixed later by changing the saturation, see

echo 0x0 > /proc/isp/filter/saturation

@ktecho
Copy link

@ktecho ktecho commented on 47e320c Aug 19, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@samtap Any chances you upload a new image so we can get latest fixes like this one? Thanks!

Please sign in to comment.