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

  • 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:

           button = KEY_PLAY
           prog = irexec
           config = export HOME=/root ; /root/ calculator downstairs
           prog = irexec
           button = KEY_RIGHT
           config = export HOME=/root ; /root/ notepad downstairs

    My /root/ file looks like this:


    token=`cat /root/.TRIGGERcmdData/token.tkn`

    curl -X POST \
    -H "authorization: Bearer ${token}" \
    -H 'content-type: application/json' \
    -d "{\"computername\":\"${computer}\",\"triggername\":\"${trigger}\"}"

Log in to reply