Jump to content
Sign in to follow this  
TheBrainiac

Control scripts using X10 RF remotes

Recommended Posts

TheBrainiac

Greetings!

So I found a device named "X10 RF Remote Receiver" along with the remote in an old PC and it was connected to the motherboard with a 4-pole connector, so I soldered a USB plug on it and plugged it into my laptop - and it worked!

But since programs don't usually come with support for all kinds of HIDs, this needed a little bit of software inbetween the drivers and whatever I want to control. After a few hours, I ran into a .NET tool that translated the remote signals into keystrokes, tailored to a wide variety of programs. Except they wanted money for it. After the free trial expired, my remote was once again useless, except for arrow keys and the power button. But today I managed to get hold of the raw signals!

TL;DR:

If your PC has an X10 type remote (and many other models are said to be compatible, I just can't guarantee this will work) and you've been wanting to directly control a script with it, this code is for you! (I seriously hope this is something new)

First, you need the ActiveHome PRO SDK. After you've installed it, you can listen for key press events in your AutoIt script:

$x10 = ObjCreate("X10.ActiveHome")
If @error Then
    MsgBox(0,"",@error)
EndIf

$x10event = ObjEvent($x10, "_x10event", "_DIActiveHomeEvents")
If @error Then
    MsgBox(0,"",Hex(@error))
    Exit
EndIf

Func _x10eventRecvAction($parameter1,$parameter2,$parameter3,$parameter4,$parameter5,$parameter6,$parameter7)
    ConsoleWrite($parameter1 & @CRLF &  $parameter2 & @CRLF &  $parameter3 & @CRLF &  $parameter4 & @CRLF &  $parameter5 & @CRLF &  $parameter6 & @CRLF & $parameter7)
EndFunc

While 1
    Sleep(10)
WEnd

Your computer might still interpret remote key presses as keystrokes. To disable that, open your Control Panel and locate the Remote Control menu:

fernbedienung.png

d0s0637.png

Press any key on the remote to see which channel it sends on, then tell it to accept commands only from a different channel. The script will still work fine and Windows will leave you alone!

Edit: It even survives unplugging and re-plugging the receiver. In fact, it fires a DeviseStop/DeviceStart event!

Translating key presses on the remote into useful things is left as an exercise for the reader.

Edited by TheBrainiac
  • Like 1

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Similar Content

    • ur
      By ur
      I have an aws cloud machine where I kept all the build process to create some set of zip files and uploading them to OneDrive.
      Once it is completed, I have another local machine in our environment which is a acting as a local share server also.
      Is there anyway to notify this machine(without public IP) to start downloading these files.
      I have written an AutoIT exe to download these files and copy them to respective locations.But don't know how to notify this from the remote machine.
       
      Any suggestion??
       
    • Piotr_Hodl
      By Piotr_Hodl
      Hi guys,
       
      My post is more architecture related than the actual autoit script.
      Currently I have a java tool that makes a connection to a azure Windows VM using WINRM.
      Then I "grep" the session ID of RDP and using psexec I execute my autoit script on the session ID of the RDP (This assumes that I need to have already a RDP connection established).
      The script runs perfectly when I have a RDP session maximized/opened. If I minimize the RDP window some commands do not work, as for example the Send command.
      I do understand that it has to do with the window not being active, even though the script is executed remotely.
      https://www.autoitscript.com/wiki/FAQ#Why_doesn.27t_my_script_work_on_a_locked_workstation.3F
       
      My goal is to be able to run the autoit scripts with no limitations, like I was running in my local machine.
       
      One important thing, all the flow is being triggered from a linux machine with no GUI. So that is why, I am using a jar file to start the winrm connection.
       
      So to sum up:
      starting server: centos with no GUI
      remote server: azure win 10
      goal: from starting server, launch autoit script that is on remote server
       
      Thanks
      Piotr
       
       
       
    • ur
      By ur
      With  ProcessList ( ["name"] )  we are able to get the running process list from the local machine.
       
      Is there anyway to get the list from Remote machine, more precisely to get to know the status whether a particular application is running or not on remote machine using AutoIT?
       
      We can implement through PSList.exe, but again we need to parse the text of it to read the output.
      Is there any direct UDF in AutoIT?
    • parrishjason
      By parrishjason
      I am trying to spawn a cmd.exe shell on a remote machine using psexec then proceed to running commands on that machine and reading the output. I.e. running pwd. 

      Unfortunately, the code I have now will just immediately exit cmd on the remote system 
      I'm trying to use the current code
      #include <Constants.au3> $pid = Run('C:\Users\test\Desktop\psexec.exe \\192.168.1.123 -u test -p "P@$$word1" -h -s cmd',@SystemDir, @SW_HIDE, $STDIN_CHILD + $STDOUT_CHILD) StdinWrite($pid,"pwd") StdinWrite($pid,@CRLF) Local $data Sleep(2000) $data &= StdoutRead($pid) ConsoleWrite("Debug:" & $data & @LF) StdinWrite($pid,"cd ") StdinWrite($pid,"C:\users\test2") StdinWrite($pid,@CRLF) StdinWrite($pid) $data &= StdoutRead($pid) ConsoleWrite("Debug:" & $data & @LF) http://stackoverflow.com/questions/19206834/command-prompt-and-autoit-stdinwrite <- credits to this stack overflow post
      Unfortunately, on my end, my cmd just starts/stops with this prompt
       
      Connecting with PsExec service on 192.1.123...Starting cmd on 192.168.1.123... cmd exited on 192.168.1.123 with error code 0. Any ideas how I can keep my shell open over psexec and still interact with it using AutoIT?

      Any feed back would be amazing! Thanks!
    • ur
      By ur
      When I run a program in remote vm virtualbix machine windows 7 64 bit with psexec from my current machine.   It is working fine in system context. C:\Users\kirud01>"C:\Software\application packaging\PsTools\PsExec.exe" -s -i -d "\\erwin-pc" -c -f "C:\Build\delete.exe"   But when I run the same in user context i.e., without -s parameter. The screen is getting freezed in the remote machine. Could you please help me on this. If possible any alternatives for PSEXEC in AutoIT code itself.
×