-
Notifications
You must be signed in to change notification settings - Fork 343
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Camera running hot/warm #61
Comments
My camera's don't run hot, actually they do get hot but it doesn't make any difference if I run cloud app or rtsp server. Can you monitor cpu usage (i.e. using top command in ssh), does it run hot because it uses a lot of cpu or is there another reason, i.e. the IR leds heating up the device from the inside as was suggested elsewhere? |
Hi, Thanks. I checked with top. Mem: 26784K used, 10172K free, 0K shrd, 4776K buff, 13936K cached |
%nice is related to the amount of cpu resources claimed by processes running with regular nice prio (i.e. processes that can be dropped in case something with a higher prio requires cpu, which is not really relevant for our device). But you should read it the other way around, in "CPU: 0.3% usr 25.7% sys 0.0% nic 73.6% idle 0.0% io 0.0% irq 0.1% sirq" the 73.6% is the amount of time the cpu is idle. |
I think that I've worked out the cause of this issue - it's related to the IR control script - it's leaving the solenoid for the IR cut filter energised when it shouldn't be - updated fang-ir-control.sh: #!/bin/sh
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
sleep 1
gpio_ms1 -n 2 -m 1 -v 0
echo 0x40 > /proc/isp/filter/saturation
sleep 3
# ir loop
IR_ON=0
while :
do
DAY="$(gpio_aud read 2)"
if [ $DAY -eq 1 ]
then
if [ $IR_ON -eq 1 ]
then
# gpio_ms1 -n 2 -m 1 -v 1
gpio_aud write 1 0 0
echo 0x40 > /proc/isp/filter/saturation
IR_ON=0
# wait a second and then disable the output to the solenoid to reduce power use!
sleep 1
gpio_ms1 -n 2 -m 1 -v 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
IR_ON=1
# wait a second and then disable the output to the solenoid to reduce power use!
sleep 1
gpio_ms1 -n 2 -m 1 -v 1
fi
fi
sleep 3
done It's nearly midday here, so I can't actually test this until tonight, but I'm pretty confident that this is the fix. I suspect that the reason why most people aren't seeing this issue is because they're in cooler months in the northern hemisphere - meanwhile, here in Australia, it's often over 30 degrees C at midnight! In further testing that I've done, I've found that IR sensitivity also gets worse over time with the cloud apps - just not as bad as when running the script. If we can find a way to further reduce power use - e.g. by undervolting/underclocking the processor then that would improve things further. |
@MarkG55 Where did you discover what the arugements for gpio_ms1 are? |
@MarkG55 , good to hear that the poor vision is an issue! I've just tested your Script on one of my camera, but keep to have a sad night vision. Should we wait the camera become "colder" to view a . signifiant difference ? |
@thanme I'm just using the commands that are already in the IR control script - just copied one line to 2 other places. I'm presuming that the last value indicates the digital output that will be set by the command. @TommyChausson Yes, you'll need to turn the camera off for a while to let it cool down. The problem is only causing extra current draw while the IR LEDs are off - once the IR LEDs are on, there is no extra current draw, but it seems that the camera just doesn't get a chance to cool down properly once it has warmed up. I'm 100% confident that if you leave it off for 5 to 10 minutes, you'll see a significant improvement - the question is just on whether it stays that way, or whether it will slowly go bad again. |
@MarkG55 , "Day is coming" so i cannot test now :( , i will try tonight |
OK, I've done some more testing and found that compared to the standard set up, it was actually using more power when the IR LEDs were on - I've updated the script above. I'm pretty confident that it should be right now, but still can't check it because it isn't dark enough yet. |
Why don't you cover the lens to make it dark? ;-) Anyway great job at debugging this. I wonder if we could also find some way to control brightness of the IR leds. I think with the current script they're either off or on, but with cloud app the brightness is controlled based on how much light is reflected. If something is close to the lens, the brightness is reduced to prevent the object from appearing too bright and white. |
Thanks - I just did some testing and it seems a lot better with these changes. I had a camera running the cloud app alongside one with the updated hack and the pictures were quite similar. The picture on the hacked version appears more grainy, but I think that just comes down to the fact that I'm running with MJPEG which I find has more detail than the H.264 stream. The camera running the cloud app is also a newer version which has a slightly wider angle lens, so that was also making it a bit harder to compare. Are you sure that the cloud app is controlling the brightness of the IR LEDs? They don't appear to be varying in brightness to me and I'd expect them to simply be either on or off with either option. To handle the case of something being close to the camera with a lot of IR being reflected, it looks like the camera in both cases simply reduces the exposure time (or maybe the gain) When I did the test tonight, I found that the hacked version was actually giving a better picture - but I think that comes down to the difference in the angle of the view from the different lenses - sitting at a certain distance from both cameras, the hacked version was showing a good picture of me with a dark background and the unhacked version was washing me out almost completely. When I moved closer to the cameras so that I was taking up a similar amount of the picture area on the wider angle lens version, the picture of me then came good. Overall, even with this change, I'm still not overly impressed with the IR performance of this camera. I'd rate it as OK for a small room, poor for a larger room and pretty much useless outside even within the rated 9m range (because you're not getting the reflection of the light that you get within a room) For the price for these cameras though, it's still hard to complain of course... If we can get the camera to run cooler than even with the cloud app, then I think that the night time performance would significantly improve. If it's not possible to reduce power consumption in any way, I'm tempted to try drilling some holes in the top of one of my cameras to allow better ventilation and see how that goes! |
So I was playing with this last night (I'm using your original update and not the new one yet) and it looks great. |
@conradhagemans |
Yes ofcourse I can share my setup. Method 1: Direct connection. Probably the easiest one.
Ofcourse put your own IP addresses in. Method 2: Indirect via Zoneminder. I like this method more. Then you are also able to trigger recording. In configuration.yaml:
Do you know how to setup Zoneminder configuration to see our camera's? |
If you want a more fancy setup in Homeassistant like on my images to have camera button on the top menu etc. let me know then I share my full setup/config files. |
@conradhagemans this stuff can be really useful to others, would you mind putting it up on the wiki? This issue will likely be closed some day making it much harder to find. I will make sure the fixes for the ir control script will be included in the next image. |
@conradhagemans ZoneMinder setup: Credit goes to @thanme from this thread fritz-smh/yi-hack#118 |
Hi, could be possible to merge this fix to the new version ? I tried version 0.2 but i'ts really overheating (i can't hold hand on front glass) and camera will freeze because of that heat. |
@nehaleem Did you even read the thread. Samtap said he will make sure to include them in next. |
I submitted a pull request that fixes this issue, if you cannot wait: https://github.com/iothing/fang-hacks |
@ZeroPoints Sorry, didn't saw that. Don't get me wrong, i'm really grateful for all this work! I just asked :-) |
@MarkG55 @iothing & @samtap I think the color problem comes from "echo 0x40 > /proc/isp/filter/saturation": ... so only this lines must be changed in your script. #!/bin/sh
echo "IR script started"
# ir_init
#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
# ir loop
IR_ON=0
while :
do
DAY="$(gpio_aud read 2)"
if [ $DAY -eq 1 ]
then
if [ $IR_ON -eq 1 ]
then
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
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 0x0 > /proc/isp/filter/saturation
IR_ON=1
fi
fi
sleep 3
done |
Unfortunately, I've been glad too early - temperature on lens is after 2h again by 50.5 °C. |
@SuperSaiyan1 No problem. The script is stored in this directory: /media/mmcblk0p2/data/etc/scripts
As you can see I am running the snx-rtsp-server without any parameters. I think it will run then in 720p mode and not 1080p. Then in Homeassistant with this setup:
the stream will run smooth. Maybe therefore the camera isn't running hot. To test in VLC choose in the menu 'Open Network' then fill in rtsp://192.168.1.205/unicast Good luck. Let us know if you get it working. |
@conradhagemans Thank you very much. |
Thanks for your help @conradhagemans, but I also still have the same error loading the stream in fullscreen with HA, the still 10s refreshed image works fine. |
Tommy032017: apologies, this was my fault with the purple image, I submitted a new pull request fixing this For your camera running hot: could you try to measure the current? Also check top to see if there is some process causing heavy cpu load that could result in heat. |
@MarkG55 Thanks! Will do new topic. |
@tommy I don't see any link to you're new image. Can you please share it? |
@Tommy032017 I don't see any link to you're new image. Can you please share it? |
@eterpstra |
@Tommy032017 Oke so i have to delete fang-ir-control.sh and create a new fang-ir-control.sh with the new settings? |
@eterpstra Just edit the existing fang ir control sh |
Oke thanks @ZeroPoints and @Tommy032017 I applied the hack and it seems to be running fine. Still one question.. When you power off the camera and poweron the camera again, is the hack still enabled? Or do i have to poweroff the camera, remove the sdcard, poweron the camera and insert the sdcard again? |
Its still enabled |
I applied the change to |
@mhdawson I'd say that's quite normal or even quite cool even when using the stock firmware & settings - you've probably got a fairly low ambient temperature? To everyone else, my apologies for the delay in posting an update: I finally received an order of new cameras - I've measured the current drawn by one of them with just the stock firmware and settings - having never loaded the hack and the current drawn by the camera is.... exactly the same as the hack with my modified version of the IR control script. Unfortunately, I've been caught up with a heap of other things so I haven't had a chance to do much further testing or even set the cameras up properly and that's also why it has taken me so long to post here. At least based on this, it appears that the cameras that have been running the original hack probably aren't damaged. It seems that for me at least, temperatures between 3 cameras - one previously hacked but running the stock firmware, one that hasn't ever seen the hack and another that has the fixed hack, all 3 are running at similar temperatures and similar looking pictures... After the above test, I modified the camera that was running the updated hack by removing the speaker and adding a heat sink to the Sonix controller - that appeared to make a fairly significant improvement to the picture compared to the cameras that were running stock firmware, The next day, ambient temperatures dropped off significantly and the difference in picture quality the following night was nowhere near as noticeable - I haven't had a chance to do any further testing since then... |
Hi @conradhagemans, I have a raspberry pi 3 and i want to install zonemider, but i can't. I followed this link to install: https://wiki.zoneminder.com/Raspbian But when i try to install lits of package: sudo apt-get install php5 mysql-server php-pear php5-mysql, appears me a big lits of dependencies package and not continue. Then if i make: "sudo apt-get -f install" appears me an error of package systemd:
|
Is this fang-ir-control.sh: fix already included in the SD-Card image, V0.2.0? Mine is also running hot. |
It's not included in the image. Did you change any settings in mi home related to ir filter/leds? |
No settings have been changed in the Mi home app. |
@MarkG55 Thanks for the script. The camera would be much warmer by now from combined heat of this and the processor. The only thing I notice is it seems to have also raised the threshold where it changes to daylight/turns off IR. |
@samtap Can you please do an urgent new image that includes the heat fix and any other fixes e.g. 1hr+ incorrect time zone. Many people will download the older 0.2 image and not be aware of this heating issue and thread until the heat has cause some damage to their devices. |
@MarkG55 @ZeroPoints How do we check the before and after temps after using the new script? |
Yes, that should be all that you need to do from memory.
Maybe try restarting the camera.
You could use an IR temperature gun. Alternatively, you can use a USB current meter to compare the current being drawn by the camera with different configurations. If everything else is the same, a camera drawing more current is going to generate more heat and so run hotter. |
@MarkG55 this is my ir control script |
can you share the image and post a fork to this github or suggest a merge so that the release page shows the new image? I think this is way too important and for many newbies they will not know that the IR heating is an issue It is also confusing about how to fix this.. when reading this thread.. In my case I didn't know that the camera was running too hot even though touching it did feel somewhat hot.. It is very irresponsible of @samtap to not post an updated image... Even on the release page for 0.2 image (Known issues) there is no mention of the heating issue on that page or how to fix it. Not sure if he is still following this github or not.. |
Bumping this. Would be great to have a new image. Frustrating that after 4 years there is still no mention of this issue on the release page. |
Would also love it if anyone has any suggestions on what to do about this heat issue. My camera gets hot to the touch, unfortunately. |
I have running the hack for more then 2 weeks now on both my 2 camera's.
I noticed that they are running warm.
Does anyone know why?
Is the sensor recording all the time even if not an RTSP stream is requested?
Isn't it possible to put the camera in idle mode till a stream is requested or motion is detected?
The text was updated successfully, but these errors were encountered: