The script sometimes hangs on the curl statement - guess the wifi shield is not that stable.
When I have scheduled it in Cron indigo is fine - it does not know of the script, I guess.
When I have scheduled it from within Indigo, Indigo becomes unresponsive.
Any switches I should use and is there a way to timeout curl in less than 20 seconds (it normally takes 8 secs to run, 7 in curl)
And is there a way to find out if curl comes back successfully
Thanks
Karl
-- read data from wifi shield on-top of arduino Uno reading the alarm voltages of the inhouse alarm system of the doors and windows.
-- set variables in indigo, then send out emails in case "away" and (door is "open" or was "opened" )
set wdsData to ""
try -- read data from arduino alarm reader
set wdsData to (do shell script "curl 192.168.1.xxx -d curl=1") --- xxx is the local IP of the wifi shield
end try
set alarm_flag to (word 3 of paragraph 2 of wdsData) as text
set changed_flag to (word 4 of paragraph 2 of wdsData) as text
tell application "IndigoServer"
set value of variable "alarm_study_door" to alarm_flag
set value of variable "alarm_study_door_changed" to changed_flag
end tell
set alarm_flag to (word 3 of paragraph 3 of wdsData) as text
set changed_flag to (word 4 of paragraph 3 of wdsData) as text
tell application "IndigoServer"
set value of variable "alarm_motion_detection" to alarm_flag
set value of variable "alarm_motion_detection_changed" to changed_flag
end tell
-- etc..