motioneye-project / motioneye

A web frontend for the motion daemon.
GNU General Public License v3.0
3.97k stars 651 forks source link

Adjusting brightness from shell script #214

Open stevegpage opened 8 years ago

stevegpage commented 8 years ago

I am trying to flip the brightness and contrast levels automaticaly at sunset/sunrise, as auto brightness does not work on the Pi. My plan was to run 'sed' on the thread-1.conf and restart the motioneye service but this does not seem to reload the config file changes - is there another way to achieve this?

DawsonLeBrown commented 8 years ago

Hi Steve, I have a cron job which runs each hour throught the day and night to execute shell script which does the following:

sudo perl -pi -e 's/auto_brightness off/auto_brightness on/g' /etc/motioneye/thread-1.conf sudo systemctl restart motioneye sleep 30s sudo perl -pi -e 's/auto_brightness on/auto_brightness off/g' /etc/motioneye/thread-1.conf sudo systemctl restart motioneye

I'm using an rPi 3 with the noIR camera - this has so far proven to be enough to set the camera's exposure to a reasonable level each hour as the day's light conditions change. Rather than relying on dawn/dusk to change the settings, it also allows for changing meteorological conditions.

stevegpage commented 8 years ago

Thats a good idea - I did notice that after setting the auto brightness and restarting it reset things. I thought I had triggered motioned to read the config data - but could not repeat it, but now I think I can understand why. Will give this a go and see what happens this evening, thanks.

On 6 June 2016 at 10:32:40, Dawson (notifications@github.com) wrote:

Hi Steve, I have a cron job which runs each hour throught the day and night to execute shell script which does the following:

sudo perl -pi -e 's/auto_brightness off/auto_brightness on/g' /etc/motioneye/thread-1.conf sudo systemctl restart motioneye sleep 30s sudo perl -pi -e 's/auto_brightness on/auto_brightness off/g' /etc/motioneye/thread-1.conf sudo systemctl restart motioneye

I'm using an rPi 3 with the noIR camera - this has so far proven to be enough to set the camera's exposure to a reasonable level each hour as the day's light conditions change. Rather than relying on dawn/dusk to change the settings, it also allows for changing meteorological conditions. This works for me

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.