TRIGGERcmd
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Register
    • Login

    Run remote commands with an old VCR remote and a Raspberry Pi Zero W

    Raspberry Pi
    1
    1
    3.0k
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • RussR
      Russ
      last edited by Russ

      I followed this tutorial to get my Pi Zero W on wifi without even connecting a keyboard and monitor to it.

      I followed this tutorial to get it setup with lirc to run commands when I press corresponding buttons on an old VCR remote.

      I setup the lircrc file to call the TRIGGERcmd API using curl commands when I press those buttons.

      I found the curl commands to be much faster than these commands.

      I also found that some remotes work better than others - like my Window Media Center remote works, but each button alternates between two different IR codes, so it works every other time you press a button. I settled on an old Toshiba VCR remote.

      Picture of the Raspberry Pi Zero with IR receiver connected

      My /etc/lirc/lircrc file looks like this:

        begin
             button = KEY_PLAY
             prog = irexec
             config = export HOME=/root ; /root/triggertest.sh calculator downstairs
        end
        begin
             prog = irexec
             button = KEY_RIGHT
             config = export HOME=/root ; /root/triggertest.sh notepad downstairs
        end
      

      My /root/triggertest.sh file looks like this:

      #!/bin/sh

      trigger=$1
      computer=$2
      token=`cat /root/.TRIGGERcmdData/token.tkn`

      curl -X POST https://www.triggercmd.com/api/run/triggerSave \
      -H "authorization: Bearer ${token}" \
      -H 'content-type: application/json' \
      -d "{\"computername\":\"${computer}\",\"triggername\":\"${trigger}\"}"

      Russell VanderMey

      1 Reply Last reply Reply Quote 1
      • tuicemenT tuicemen moved this topic from Instructions on
      • First post
        Last post