Sign in to follow this  
Followers 0
TheBrainiac

Control scripts using X10 RF remotes

1 post in this topic

#1 ·  Posted (edited)

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
1 person likes this

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  
Followers 0

  • Similar Content

    • 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.
    • faldo
      By faldo
      "The why"
      I've been working over 15 years in the IT industry and have realised that the best way of streamlining operations and support is by combining the concept of selling services (instead of hours) along with a tool built for managing those services.
      For the past 10 years i've been working with some of the leading providers of MSP-tools. The prize set on these comercial tools is quite high and there are usually few licence models to choose from. A smaller it-company will find the cost hard to motivate and in turn have dificulties converting its busines model in order to make more money, classic catch 22
      "The how"
      During the years, i've gathered the pros and cons of these tools, dissected their core and realised there is no magic or rocket science going on. There is however a whole lot of scripting used and that's why i feel AutoIT would be a great foundation for a new project.
      So, i've decided to compile my years of experiance and create a tool for remote management and monitoring of machines over WAN. Instead of monetizing it and try to compete with the big companies i felt it more efficiant to make it open source and hope for community interest and development.
      "The what"
      The following features are under development, some arn't started, some are finished. Check the changelog for more info.
      Base components
      - Agent running as service
      - Central server with MySQL (hub engine)
      - Management client (AutoitGUI/WebGUI)
      Main features
      - Remote execution of shell commands as system or specific user
      - File transfer from/to agent
      - Live monitoring of system resources
      Consequential features (based on main features)
      - Hardware/software inventory
      - Software deployment/updating
      - Patch management
      - Antivirus management
      - OS deployment
      - Disaster recovery
      - Hardware/software/network monitoring
      - Wake on LAN
      - Reporting
      - Remote registry, event viewer, task manager
      - Scripting (obviously)
      Additional features (stand-alone modules)
      - Remote control
      - Servicedesk (based on ITIL)
      - AD-integration
      Security
      - Secure communication with SSL and rotating key for every session.
      - SHA256 encryption.
      Remmanaut network overview

       
       
      My knowledge of AutoIT is average but i'm novice when it comes to programing structure for collaboration, so if you're willing to help me out in making the project easy to share, i'd be very thankfull. Unfortunatly i'm no php-guru so i'll be concentrating on the AutoitGUI until the agent and hub engine reaches an adequate version.

      If you feel that this tool could benefit you in any way or just want to join the project for the fun of development, don't hesitate to post constructive feedback or hit me a PM.
      Code optimisation to do:
       
      Download:
       
       
    • faldo
      By faldo
      Remmanaut, the autoit RMM tool.
    • Mian
      By Mian
      #include <Excel.au3> #include <Array.au3> #include <String.au3> #include <IE.au3> local $oIE =_IECreate ("https://example.com/export") sleep(5000) WinWait("Internet Explorer") WinActivate("Internet Explorer") send("{TAB 2}") sleep(1000) send("{ENTER}") sleep(1000) WinWait("Save As") WinActivate("Save As") send("PatientsData.csv") sleep(1000) send("{TAB 3}") sleep(1000) send("{ENTER}") sleep(1000) WinWait("Confirm Save As") WinActivate("Confirm Save As") send("{TAB 1}") sleep(1000) send("{ENTER}") WinWait("Blank Page - Internet Explorer") WinActivate("Blank Page - Internet Explorer") sleep(1000) RunWait('taskkill /F /IM "iexplore.exe"') Exit  
      I have written the above simple script, which open a link and save it to the disk. I execute it and every thing works fine. I scheduled it in windows task and it executed fine. However when I scheduled it and I logged out of the system it stops working. The scheduled start the task.exe. Open the internet explorer send f2 to open the save as dialogue and after that it fails to send the tab. 
      Since partial script is execute therefore I think that the problem is not related to permissions. The script stops at second or third line.