Lua / bash script running longer than 10 seconds (log)
Posted: Thursday 21 January 2016 0:38
Can some one tell me why this simple bash script will results the system hanging for 10 seconds and causes an error log Error: Warning: lua script /home/pi/domoticz/scripts/lua/script_device_deurbel.lua has been running for more than 10 seconds
Bash script calls Voordeur.sh This simple script just turn the light on
First attempt:
Second attempt:
My lua script:
As soon as I remove os.execute('/home/pi/domoticz/scripts/Voordeur.sh') everything works just fine. So the problem does not seems to be the SentSnapshot.sh
The reason why os.execute('/home/pi/domoticz/scripts/SentSnapshot.sh') is repeat is because I want to take 4 snapshots. The repeating action works just fine.
Bash script calls Voordeur.sh This simple script just turn the light on
First attempt:
Code: Select all
#!/bin/sh
/usr/bin/curl "http://$192.XXX.X.XX:XXXX/json.htm?type=command¶m=switchlight&idx=54&switchcmd=On"Code: Select all
#!/bin/sh
Server=192.XXX.X.XX:XXXX
Port=XXXX
curl -s "http://$Server:$Port/json.htm?type=command¶m=switchlight&idx=54&switchcmd=On"
Code: Select all
commandArray = {}
if (devicechanged['Deurbel voordeur']=='On') then
os.execute('/home/pi/domoticz/scripts/Voordeur.sh')
os.execute('/home/pi/domoticz/scripts/SentSnapshot.sh')
os.execute('/home/pi/domoticz/scripts/SentSnapshot.sh')
os.execute('/home/pi/domoticz/scripts/SentSnapshot.sh')
os.execute('/home/pi/domoticz/scripts/SentSnapshot.sh')
print('Script Deurbel is ingedrukt')
end
return commandArray
The reason why os.execute('/home/pi/domoticz/scripts/SentSnapshot.sh') is repeat is because I want to take 4 snapshots. The repeating action works just fine.