Close

Run Command Not Working

Having trouble with Sighthound Video? Post here for help.

Moderator: Staff

no avatar
HAMMERDARRELL
 
Posts: 15
Joined: Sat Oct 15, 2016 9:56 pm

Run Command Not Working

by HAMMERDARRELL » Fri Aug 11, 2017 11:23 pm

I've submitted a bug report, but thought I'd post here...for the benefit of others.

I written several new "Run Command" scripts to run as part of my Rules. They all execute properly when I click TEST. They do not, however, execute when the rule is triggered...even though the associated clip is stored and the email notification is sent. I've even tried a very simple script that calls up the Windows calculator - same result.

Sample Script:
cmd.exe /k start C:\Windows\System32\calc.exe

Please help! I initially attempted to utilize IFTTT for WEMO control and it's waaaaayyyyy too slow. That's why I'm now going to use the "Run Command" feature (hopefully). It's much quicker, since it's local control of the WEMO (using AllWemo)
Last edited by HAMMERDARRELL on Sat Aug 12, 2017 8:18 pm, edited 1 time in total.

no avatar
HAMMERDARRELL
 
Posts: 15
Joined: Sat Oct 15, 2016 9:56 pm

Re: Run Command Not Working

by HAMMERDARRELL » Sat Aug 12, 2017 10:48 am

I found this issue from another user. I'm having exact same problem, as described in my original post.
https://www.sighthound.com/forums/topic12187?hilit=command#p16917

User avatar
ryan
 
Posts: 1015
Joined: Wed Aug 25, 2010 2:52 pm
Location: Palo Alto, California

Re: Run Command Not Working

by ryan » Sat Aug 12, 2017 1:09 pm

Does your command invoke anything that would require the user interface as in your example which launches calc? These types of commands won't work when executed by the cameras as the background parts of Sighthound Video are launched by a system service as the "SYSTEM" user has no concept of a desktop or screen or anywhere to allow them to function.
Learn more about Sighthound Video in our support pages - Reference Guide | All Articles
Are you a developer? Check out our cloud APIs - Demo | Docs

no avatar
HAMMERDARRELL
 
Posts: 15
Joined: Sat Oct 15, 2016 9:56 pm

Re: Run Command Not Working

by HAMMERDARRELL » Sat Aug 12, 2017 2:14 pm

Sorry Ryan...I'm not totally following you. Are you saying that running a Command from Sighthound that references the Windows command prompt won't work? Any suggestions on format of string/path? I tried launching a .bat file (which contains my script)...same result...no worky. I simply want to run AllWemo.exe (with a couple switches at the end) with a Sighthound command.

I've read that running PSexec.exe (to get a command prompt) from the System user level might work? Is this something you suggest?

The link below on your support page shows an example Command, which is virtually identical in structure to the Commands I'm using. It also uses the Windows command prompt:

https://www.sighthound.com/support/rule-editor#command

Example script from link above on Sighthound support page:
cmd.exe /k start C:\Users\Katie\Desktop\lights.bat

I do know the Sighthound Command executes properly with the TEST button. It's odd that the same Command won't execute properly when run normally by a rule.

Here's one of my actual scripts. Again, it runs fine in TEST, but not in the normal rule.
cmd.exe /k start C:\"Program Files (x86)"\Allware\AllWemo\AllWemo.exe -ip:192.168.0.133 -action:on

Thanks for all the outstanding improvements recently. Version 4 and 5 have been running so much more efficiently than prior versions. Keep up the great work and I look forward to your response!

no avatar
HAMMERDARRELL
 
Posts: 15
Joined: Sat Oct 15, 2016 9:56 pm

Re: Run Command Not Working

by HAMMERDARRELL » Tue Aug 29, 2017 5:21 pm

Update (solution)...

I found a fairly easy solution to my issue, which was that Sighthound wouldn't run my particular executable from the "Run the Command" area. Even after putting the executable in a .bat file and calling the .bat file from Sighthound...the .exe wouldn't run when a rule was set to do so.

The trick was to make the .exe I wanted to run from Sighthound a Windows (Windows 10 in my case) service. This seems to satisfy the call Sighthound makes to it from the Run the Command. It also ensures that the .exe is available, even before I log in...in the event of a reboot while I'm away for example.

I utilized the open-source NSSM utility to make my AllWemo.exe application a service and everything works great now! Took about 2 minutes to get it all set up!
https://nssm.cc/


Return to Technical Support
cron