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

Orange Pi Zero 2 image with TRIGGERcmd agent pre-installed and programmed for IR remote control

Raspberry Pi
orange pi raspberry pi panel
1
1
658
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.
  • R
    Russ
    last edited by Russ Nov 16, 2022, 1:29 PM Oct 29, 2022, 11:29 PM

    I put this Orange Pi image out on Google Drive if you want to try it. I have a couple Orange Pi Zero 2's running it so far. One is in my office and one is in my basement entertainment center room (youtube video).

    The Orange Pi has an infrared sensor so I use this IR remote control to run up to 21 different commands - one command per button. I don't recommend you associate your garage door with one of those buttons though. IR is not secure - it's just infrared light, and anyone can buy a remote like this for around $3:
    IR_Remote.jpg

    I bought a few of these Orange Pi Zero 2's for about $30 each, and I noticed they had these IR receivers built into the expansion boards they came with. You can see it in the middle of this photo on the top board:
    OrangePiZero2.jpg

    This is the Orange Pi image file:
    https://drive.google.com/drive/folders/1G4JnV3VLcLFa76tf-zO2t0jC9h9o4YlW

    You can write it out to your microSD card with belanaEtcher or the Raspberry Pi imager tool.

    I took the the official Orange Pi Ubuntu image for the Zero 2 hardware from this page, installed the TRIGGERcmd agent on it. I also installed a script that runs on boot that shows you a TRIGGERcmd pair code on the hdmi console to pair it with your TRIGGERcmd account. You can also get the pair code from /root/paircode by ssh'ing to it, but you'll need to know the IP, or you could try the dns name which will be tcmd-orangepizero2 if it works. Both the orangepi and root have orangepi as the password. You should change that. I'll probably add a command to change that via a built-in TRIGGERcmd command in the next version of this image file.

    You'll need to pair your Orange Pi with the Pair button under your name in the upper-right.
    39d1fc0f-9f2a-4a80-ac8f-e8c79e8bb998-image.png

    It will create a computer in your account with a few built-in commands, like the commands to control 2 relays on a relay board like this.

    It will also create an "IR Remote" panel in your account with a virtual panel button for each physical button on the remote.
    2c8afaba-8f38-4095-9f09-0aaaf61edbd8-image.png
    You'll just need to associate those virtual buttons with the commands in your account that you want them to run. I've been running Calculator a lot, but I intend to associate things like my basement lights via an Alexa routine etc.

    To connect the Orange Pi to Wifi you'll need to plug it into ethernet first and ssh in, or use the console if you have a micro HDMI adapter and keyboard to set it up using the console. Run orangepi-config to setup wifi. The Orange Pi comes with a nice wifi antenna. You can see the antenna wire in the photo above.

    I like that these remotes are so cheap.

    Here a couple Amazon posts selling them:
    fa18683c-39c9-4efd-a613-4c382c8b9968-image.png

    I'll probably do a Raspberry Pi image too if people are interested. I figured the Orange Pi image might be more useful at the moment because it's hard to get the Raspberry Pi's right now. Notice those remotes come with an IR receiver, which you'll need if you use a Raspberry Pi.

    If you want to wire up a relay board, this is how to connect the pins:
    IMG_20221029_195308438.jpg

    EDIT 11/13/2022:
    This is the commands.json file from my laptop running Winamp in the Youtube video:

    [
     {
      "trigger": "Reboot in 10 seconds",
      "command": "shutdown /r /t 10",
      "ground": "background",
      "voice": "reboot"
     },
     {
      "trigger": "Calculator",
      "command": "calc",
      "ground": "foreground",
      "voice": "calculator"
     },
     {
      "trigger": "Notepad",
      "command": "notepad",
      "ground": "foreground",
      "voice": "notepad"
     },
     {
      "trigger": "Volume up",
      "command": "nircmd changesysvolume 6000",
      "offCommand": "",
      "ground": "foreground",
      "voice": "",
      "voiceReply": "",
      "allowParams": "false"
     },
     {
      "trigger": "Volume down",
      "command": "nircmd changesysvolume -6000",
      "offCommand": "",
      "ground": "foreground",
      "voice": "",
      "voiceReply": "",
      "allowParams": "false"
     },
     {
      "trigger": "Play/Pause",
      "command": "nircmd sendkeypress c",
      "offCommand": "",
      "ground": "foreground",
      "voice": "",
      "voiceReply": "",
      "allowParams": "false"
     },
     {
      "trigger": "Previous song",
      "command": "nircmd sendkeypress z",
      "offCommand": "",
      "ground": "foreground",
      "voice": "",
      "voiceReply": "",
      "allowParams": "false"
     },
     {
      "trigger": "Next song",
      "command": "nircmd sendkeypress b",
      "offCommand": "",
      "ground": "foreground",
      "voice": "",
      "voiceReply": "",
      "allowParams": "false"
     },
     {
      "trigger": "MilkDrop",
      "command": "c:\\tools\\milkdrop.bat",
      "offCommand": "",
      "ground": "foreground",
      "voice": "",
      "voiceReply": "",
      "allowParams": "false"
     },
     {
      "trigger": "Milkdrop Title",
      "command": "nircmd sendkeypress t",
      "offCommand": "",
      "ground": "foreground",
      "voice": "",
      "voiceReply": "",
      "allowParams": "false"
     },
     {
      "trigger": "Fast forward",
      "command": "nircmd sendkeypress shift+right",
      "offCommand": "",
      "ground": "foreground",
      "voice": "",
      "voiceReply": "",
      "allowParams": "false"
     },
     {
      "trigger": "Rewind",
      "command": "nircmd sendkeypress shift+left",
      "offCommand": "",
      "ground": "foreground",
      "voice": "",
      "voiceReply": "",
      "allowParams": "false"
     },
     {
      "trigger": "Winamp",
      "command": "\"C:\\Program Files (x86)\\Winamp\\winamp.exe\"",
      "offCommand": "",
      "ground": "foreground",
      "voice": "",
      "voiceReply": "",
      "allowParams": "false"
     },
     {
      "trigger": "Previous Milkdrop preset",
      "command": "nircmd sendkeypress backspace",
      "offCommand": "",
      "ground": "foreground",
      "voice": "",
      "voiceReply": "",
      "allowParams": "false"
     },
     {
      "trigger": "Pause Milkdrop preset rotation",
      "command": "nircmd sendkeypress scroll",
      "offCommand": "",
      "ground": "foreground",
      "voice": "",
      "voiceReply": "",
      "allowParams": "false"
     },
     {
      "trigger": "Next Milkdrop Preset",
      "command": "nircmd sendkeypress h",
      "offCommand": "",
      "ground": "foreground",
      "voice": "",
      "voiceReply": "",
      "allowParams": "false"
     },
     {
      "trigger": "Lights color rotate",
      "command": "c:\\tools\\color_rotate.bat",
      "offCommand": "",
      "ground": "foreground",
      "voice": "",
      "voiceReply": "",
      "allowParams": "false"
     }
    ]
    

    Here's my c:\tools\milkdrop.bat file on that laptop:

    tcmd -c russtv -t winamp
    ping 127.0.0.1
    start /B nircmd win activate stitle "Winamp 5"
    ping 127.0.0.1
    nircmd sendkeypress x
    ping 127.0.0.1
    nircmd sendkeypress ctrl+k
    nircmd sendkeypress alt+s
    

    Heres my c:\tools\color_rotate.bat script:

    set /p lastcolor=< c:\tools\lastcolor.txt
    echo Last color was %lastcolor%
    
    goto %lastcolor% else END
    
    :red
    echo blue > c:\tools\lastcolor.txt
    tcmd -c ds -t ar_lights_blue
    goto END
    
    :blue
    echo green > c:\tools\lastcolor.txt
    tcmd -c ds -t ar_lights_green
    goto END
    
    :green
    echo red > c:\tools\lastcolor.txt
    tcmd -c ds -t ar_lights_red
    goto END
    
    :END
    

    Russell VanderMey

    1 Reply Last reply Reply Quote 0
    • R Russ referenced this topic on Dec 23, 2022, 3:52 PM
    1 out of 1
    • First post
      1/1
      Last post