os.execute destroying vera, how about this alternative?

So after writing a bunch of applescripts and setting up the SSH keys to automate airplay and tts using my macl, I can send a command via Vera CLI but when I add the Luup code to a scene everything hangs and basically self destructs.

I’m thinking a possible solution would be to send http requesting to an RPi, and use it to SSH into my mac and run the applescripts. I have very limited knowledge of linux, so my questions are:

What distribution would suit my needs best?
What type of server would best suit my needs?
Is there a better way out there to integrate airplay/itunes with vera?

The remote command must run quickly … or Vera will restart.
If you have a lengthy task … then spawn a sub process to handle it and return while the sub process continues to run in the background.

It’s worse than that: the subprocess, even if it is backgrounded, can cause a Luup restart because it holds open file descriptors. I ran into this with the UPnP event proxy plugin. Follow the link for the scary hackish workaround.

Holy Futzle!!!.. I think I might need to throw away a whole weekend and set up OpenHab

I always wondered what all the complaints about Vera was all about, mine ran smooth with 80+ devices, 100+ scenes and enough PLEG to shake a stick at along with plug ins for everything. Then about a week ago everything hit the fan after the first time I added the os.execute command to a luup tab. I even made a first ever support ticket, no help. Im actually sitting here waiting for vera to save something but all i see is…



So heres what I have in the LUUP tab of PLEG,

luup.inet.wget(“http://10.0.1.xxx:xxxx/eventghost.html?speakerA”, 3)

os.execute(“ssh -y -i ~/.ssh/id_rsa charles@10.0.1.xxx osascript /Documents/BRoomAirplay.scpt”)

I wasn’t around for Vera 1 or 2 and thanks to Richard I haven’t really needed to code anything until now. Anyway I can make these more stable? Should I separate them into multiple events?

Careful about using ~ to mean the HOME directory in Vera. It is not always set to /root. Best to spell out the full path. Perhaps ssh is sitting there trying to get a password typed into a nonexistent tty.

I feel so stupid right now. I even read a post about it a while ago but something didn’t click and I was stilling here enabling root on my mac and trying to move the keys over… right idea, wrong device.

I appreciate the responses… Vera should cut you guys a check!

If you are running a single command on the underlying OS that could possibly take a while to execute, and you don’t need to wait for the output of the command, a simple fix is to add an ampersand to the end of the command string… This causes the command to fork a new process, and the os.execute command will return immediately.

Scroll up for the phrase “it’s worse than that” for why this might not help. (Related Google search term: close on exec.)