I'm trying to add indigo support for my PlayStation 4. I can successfully wake the PS4 and launch apps on it with a command line tool called PS4-Waker, for which more info may be found here:https://github.com/dhleong/ps4-waker
It works well from the command line, so I tried converting from command line to shell script. I'm trying to excute the following shell script from the "Run Shell Script" server action:
- Code: Select all
#!/bin/bash
/usr/local/bin/ps4-waker -t 30000
The script produces no effect or does not appear to run from indigo. However, if I double click on it in Finder, it will execute the script in Terminal and will generate the desired outcome.
It would still not work if I removed the -t 30000 (default is -t 10000.
I tried enabling the "Store the output of the script in a variable, but I'm getting the following error when I execute the action with the checkbox checked:
Action Collection Error Script /Users/myriam/Documents/Indigo-Scripts/ps4Waker-wake exited abnormally with a return code of: 127
after some more research, I stumbled on this thread http://forums.indigodomo.com/viewtopic.php?f=107&t=12148
So I decided to switch to Python to see if I would have better results
here's the python code:
- Code: Select all
import subprocess
command = "/usr/local/bin/ps4-waker"
arg = "standby"
proc = subprocess.Popen([command, '-t 30000', arg], stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=True)
out, err = proc.communicate()
indigo.server.log(u"command error: %s" % err)
here's the error that's logged in console:
command error: env: node: No such file or directory
Any idea as to what I should do to get it to work?