Author Topic: newbie trying to execute basic os.execute in luup  (Read 377 times)

Offline tublecane

  • Newbie
  • *
  • Posts: 4
  • Karma: +0/-0
newbie trying to execute basic os.execute in luup
« on: February 27, 2017, 05:29:28 pm »
I have a scene that I'd like to run the following LUUP on, but it fails, and I don't see anything in the logs explaining why.  I have a raspberry pi and a python script to open my blinds with a Broadlink RM pro e-remote.  I set up the keys so that I can ssh commands without password.  The python scripts run fine when I'm ssh'd into the vera box and run the following:

ssh -i ~/.ssh/id_dss -l userxxxx 192.xxxx 'nohup python /mnt/skolcloud/Public/blindsUp.py'
ssh -i ~/.ssh/id_dss -l userxxxx 192.xxxx 'nohup python /mnt/skolcloud/Public/blindsDown.py'

However when I try the following in the execute LUUP after scene:
os.execute("ssh -i ~/.ssh/id_dss -l pi 192.168.1.107 'nohup python /mnt/skolcloud/Public/blindsUp.py'")

I get scene run failed but can't see any other relevant messages explaining why. 

Offline jswim788

  • Hero Member
  • *****
  • Posts: 508
  • Karma: +25/-2
Re: newbie trying to execute basic os.execute in luup
« Reply #1 on: February 27, 2017, 05:42:00 pm »
See this thread.  Maybe the ~ isn't what you think it is: http://forum.micasaverde.com/index.php?topic=34330.0

Also, that thread indicates that you need to be careful with this to make sure your command is very quick.