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

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

    Scheduled Pinned Locked Moved Raspberry Pi
    1 Posts 1 Posters 3.6k Views 1 Watching
    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 Offline
      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

      Hello! It looks like you're interested in this conversation, but you don't have an account yet.

      Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

      With your input, this post could be even better 💗

      Register Login
      • First post
        Last post