Page 1 of 1

Domoticz on windows and os.execute command

Posted: Tuesday 05 April 2016 0:39
by Foxdesign
Hi there,

below is a snippet of code I've copied from a linux Domoticz installation:


runcommand = "echo " .. (Fadetimer) .."" .. (FadeTime1) .. "," .. (LEDtarget) .. "" .. (CalcValue) .. " | nc -w " .. (Waittime) .. " " .. (IP) .. " " .. (Port) .. " ";
print (runcommand);
os.execute(runcommand);

end
return commandArray

So the print command here works, and spits out the following format:

echo Fadetimer2=4000,LED2_target=0 | nc -w 2 192.168.1.2 43333 (which I can send to the device using Cygwin.)

So i'm guessing the os.execute command doesn't work? . Is this because os.execute is a Linux specific function?

If so, what command should I be using on a windows machine?

Thanks for any help in advance!

Re: Domoticz on windows and os.execute command

Posted: Tuesday 05 April 2016 7:59
by mrf68
Hi Foxdesign,

I'm running Domoticz on a Windows system and use the os.execute command this way:

os.execute ("C:\\PS\\pomachterdeur.cmd")

This command works, so my answer to your assumption that os.execute doesn't work, is imo not correct. But I can't say why yours isn't working.