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

Trigger light effect from another pi

Discussion in 'Archive' started by mg3point, 6 February 2017.

Tags:
Thread Status:
Not open for further replies.
  1. mg3point

    mg3point New Member

    Messages:
    20
    Hardware:
    RPi3
    I am attempting to trigger the lights running on a pi from another pi. As an avid hockey fan i created my own version of the goal lights (similar to police light effect). I want the lights to be triggered automatically similar to the Budweiser red light. I have script running on another pi that checks the score and is currently setup to play audio through a speaker attached when my team scores a goal. What i am trying to do now is get this pi to communicate with the lights pi to trigger the light effect with it. I know on the lights pi i need to send

    /storage/hyperion/bin/hyperion-remote.sh -e "Goal" -d "40000"

    My question is how do i send that from the triggering pi?

    I'm assuming i can just hit a web service link as I think thats how the chrome and android apps work.

    Apologies if this is a simple answer, i'm still fairly new to this. Interaction designer by day, tinkerer/Connoisseur of many things by night.
     
  2. PawelGrzembka

    PawelGrzembka New Member

    Messages:
    17
    Hardware:
    RPi3
    I think you should install sshpass and then the following command should work:

    sshpass -p 'YourPassword' ssh [email protected] `/storage/hyperion/bin/hyperion-remote.sh -e "Goal" -d "40000"`

    However I've never used sshpass by myself, so can't guarantee it's ok.

    You can also add --print to your hyperion-remote command and the JSON result sent to the hyperion RPi via TCP should execute the desired effect.
     
    • Like Like x 2
  3. mg3point

    mg3point New Member

    Messages:
    20
    Hardware:
    RPi3
    I'll have to give that a go, thanks!
     
  4. penfold42

    penfold42 Active Member

    Messages:
    746
    Hardware:
    RPi1/Zero, RPi2, RPi3, 32/64bit, +Arduino, +nodeMCU/ESP8266
    +1 for hyperion-remote
    -1 for ssh - you don't need it cos Hyperion-remote can talk to instances on other hosts with -a
     
    • Like Like x 1
  5. mg3point

    mg3point New Member

    Messages:
    20
    Hardware:
    RPi3
    could you clarify the -a? I am uncertain how to communicate with the hyperion-remote on the other pi. I know it should be something simple and i feel i am right on the precipice of figuring this all out.
     
  6. mg3point

    mg3point New Member

    Messages:
    20
    Hardware:
    RPi3
    I think i should have specified that i do not have hyperion remote on the pi, i was referencing the web app, i was hoping to just pull a script from it, but then trying to put pieces together it hit me that you are probably saying i should put hyperion remote on my triggering pi and then the -a is just the ip of my lights pi. So now just to figure out how to get to Hyperion-remote on the trigger pi. Thanks for the insight, i hope i am on the right track. I dont know why i strayed away from the forums for so long.
     
  7. redPanther

    redPanther Active Member

    Messages:
    211
    Hardware:
    RPi1/Zero, RPi2, 32/64bit, +Arduino
    Just copy hyperion binaries to your triggering pi. Call there hyperion-remote -a ip_from_hyperion_pi:19444 -e Goal -d 40000
     
    • Thank you Thank you x 1
  8. mg3point

    mg3point New Member

    Messages:
    20
    Hardware:
    RPi3
    The SSHPass psuedo worked, when I ssh into my triggering pi and run the SSHPass command it first opens the connection to the lights pi and then if i run it again will trigger the lights but stays in the lights pi so i dont think that is a viable option. I've run wireshark hoping to track the TCP but its not quite clear what its sending.
    I was actually literally just getting down that road. I was struggling to connect directly to the hyperion-remote, (still a newb to this more back-end stuff i was trying to hit hyperion-remote.sh) But alas it worked! Now i just need to edit the triggering script and apply my new data.

    Thank you all for your help!
     
  9. redPanther

    redPanther Active Member

    Messages:
    211
    Hardware:
    RPi1/Zero, RPi2, 32/64bit, +Arduino
    Add --print to see whats sending and receiving. Its simple json strings over tcp sockets.
    For more help use - as usual - --help
     
Thread Status:
Not open for further replies.