0

Looking for a coding guru to explain me what direction I need to take now:

I use an Amazon Echo Dot which is currently connected to my Raspberry Pi. I can now say "Alexa turn device on/off" which returns a true/false to my Raspberry Pi using this excellent repository: https://github.com/toddmedema/echo.

Could anyone explain me how I can replace this 'true' in this python script with a script that sends a request to execute a batch file on my windows computer using RDP?. I think it is here but it doesn't work:

def act(self, client_address, state, name):
    print "State", state, "from client @", client_address
    GPIO.setmode(GPIO.BOARD) ## Use board pin numbering
    GPIO.setup(str(sys.argv[3]), GPIO.OUT)   ## Setup GPIO Pin to OUTPUT
    GPIO.output(str(sys.argv[3]), not state) ## State is true/false
    GPIO.cleanup(str(sys.argv[3]))
    return True ## after this line add the command the execute?

Extra question: How do I add more voice commands?

Would really appreciate it.

Charles Duffy
  • 235,655
  • 34
  • 305
  • 356
Wim M
  • 1
  • 1
  • On the computer *running this code*, or remotely on your Windows box? That latter is much too big a topic to be considered reasonably scoped. – Charles Duffy Jul 21 '17 at 15:31
  • This code (found in the repository) is now running on the Raspberry Pi – Wim M Jul 21 '17 at 15:32
  • Yes, but are you asking us how to trigger an arbitrary local script (which happens to run a remote command), or are you asking us how to trigger a remote command? That is, will an answer that only tells you how to run a local command be acceptable to you, or is "how do I execute a batch file on my Windows computer running RDP?" part of the question's core? – Charles Duffy Jul 21 '17 at 15:37
  • I would like to know how to trigger a command in this script (out of scope: which then will execute a file/command which will do the Windows rdp part). – Wim M Jul 21 '17 at 15:46
  • Ahh! That's much more reasonable, then. Is [Calling an external command in Python](https://stackoverflow.com/questions/89228/calling-an-external-command-in-python) not helpful? (Can you [edit] the question to explain how/why the existing questions and answers along the line of that one don't apply?) – Charles Duffy Jul 21 '17 at 15:56

0 Answers0