can't get Curl -T in Lua to work. Works at command line
Posted: Monday 17 December 2018 20:33
I am trying to send a xml file to a camera (Hikvision) to turn on it's output line. I have everything working if I submit via the Pi command line but when putting it in a Lua script it's not working. I see the script executing and it returns exit and status of 0 when using os.execute, but nothing is happening on the camera side. (Lua script is saved as a Device script)
Here's the Script:
commandArray = {}
if (devicechanged['Tank - Heater'] == 'On') then
print( os.execute('curl -T /home/pi/domoticz/scripts/lua/AlarmON.xml "http://user:[email protected]:10042/IO/outputs/1"'))
else
-- os.execute('curl -T /home/pi/domoticz/scripts/lua/AlarmOFF.xml "http://user:[email protected]:10042/IO/outputs/1"')
print(devicechanged['Tank - Heater'])
end
return commandArray
Executing the same Curl command on the raspPi command line works great.
Thanks for any help.
Here's the Script:
commandArray = {}
if (devicechanged['Tank - Heater'] == 'On') then
print( os.execute('curl -T /home/pi/domoticz/scripts/lua/AlarmON.xml "http://user:[email protected]:10042/IO/outputs/1"'))
else
-- os.execute('curl -T /home/pi/domoticz/scripts/lua/AlarmOFF.xml "http://user:[email protected]:10042/IO/outputs/1"')
print(devicechanged['Tank - Heater'])
end
return commandArray
Executing the same Curl command on the raspPi command line works great.
Thanks for any help.