1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

rc.local does not run hyperion-v4l2 with parameters

Discussion in 'Bug Reports' started by peter, 23 March 2017.

  1. peter

    peter Member

    RPi1/Zero, RPi2, RPi3
    please, I am really helpless. I am on Armbian.

    I am trying to run hyperion-v4l2 in /etc/rc.local (please it is not important why for now) with these parameters:
    /home/user/hyperion/build/bin/hyperion-v4l2 --device /dev/video0 --video-standard PAL --width 720 --height 576 --crop-top 10 --crop-bottom 10 --crop-left 24 --crop-right 24 --frame-decimator 1 --size-decimator 4 --red-threshold 0.2 --green-threshold 0.4 --blue-threshold 1.0
    (before v4l2 I am executing sudo /home/user/hyperion/build/bin/hyperiond /home/user/hyperion.config.json)
    But it does not take crop parameters in effect (important for blackborder detection) of hyperion-v4l2.
    I tried to put the whole command in sh and python script (subprocess) but it is the same, in rc.local crop parameters are omitted, no idea why. BUT when I execute the same SH or Python script when I log in via my user, it works correctly.

    What can be wrong? In rc.local and all executed scripts via rc.local it does not take crop parameters in effect. Maybe the line with parameters is very long, but I don't understand it because manually the same scripts work correctly.

    UPDATE: After several trial and errors I found out, probably, it is related to THIS sudo /home/user/hyperion/build/bin/hyperiond /home/user/hyperion.config.json. Because when I run this script via rc.local and then manually hyperion-v4l2, then behaviour is the same.
    Last edited: 23 March 2017
  2. redPanther

    redPanther Active Member

    RPi1/Zero, RPi2, 32/64bit, +Arduino
    put hyperion stuff in a script:
    hyperiond my.cfg &
    sleep 3
    hyperion-v4l2 your_args &

    Call it from rc.local
    If you need sudo (perhaps not neccessary) exec the script with sudo, not the hyperion bins.

    BTW exec hyperiond and a standalone grabber on same system makes no sense in most cases. Use v4l grabber from inside hyperion.
  3. peter

    peter Member

    RPi1/Zero, RPi2, RPi3
    thanks redPanther, I tried the same things. Finally, I found out I need to run v4l2, then kill it and then run it again and after that all leds work ok. I must use separate hyperiond and hyperion-v4l2 because when I run grabber within hyperiond then response is horrible (colors are chopped).