Still Getting Errors With 924
George Handley
ghandley at kc.rr.com
Tue Mar 1 03:08:15 EST 2016
James, … and anyone else who is NOT overwhelmed with network communications,
To make this as concise as I can, David and I are stymied by something tiny we think has changed in XTension... since Build 897 that is.
We have three main XTension scripts that have stopped working, that have been working since last October. They talk to Apps on Mini #1 and 2. The error we consistently get is odd:
2/29/16 10:55:46 PM Scheduled Event: Send Temp Ave To David
2/29/16 10:55:46 PM Executing global script: Send Average Temperature to David #6
2/29/16 10:55:46 PM Send Average Temperature to David #6OSAError -1708: XTension got an error: "Bad Communications with Mini #1" doesn’t understand the “turnoff” message.
Now, the really puzzling thing is that in XTension’s editor, these scripts will run flawlessly, manually, but when assigned to a scheduled event in XTension, we get the above error.
I’ve pasted the script again below less addresses, etc. You might recall that Henk questioned all the different Mini communications error checking, but I have been assured that every line there is necessary so that won’t cause XTension to lock up, which it was the way we had started.
I hope I have described the problem we are having sufficiently, and that you immediately see what I need to change. All other systems in the house continue to work flawlessly under your latest and greatest.
Thanks,
George
--Global script Send Average Temperature to David #6
on run {}
my initializeXTensionFlags() -- initialize XTension error flags
--set routerIP to my getRouterIP()
set routerIP to "10.0.0.1"
set remoteComputerName to “xxxxxxxx"
set remoteAcctName to “xxxxxxxx"
set remoteAcctPswd to “xxxxxxxxx"
if my lanWorking(routerIP) then
if my remoteComputerOn(remoteComputerName) then
if my remoteAccountLoggedIn(remoteComputerName, remoteAcctName, remoteAcctPswd) then
if my remoteAirServerWindowOpen() then --This line was David's correction 1/30/16
set DavisTemp to "500"
try -- Gather DavisTemp value from WeatherTracker
tell application "WeatherTracker" of machine "eppc://xxxxxxx:xxxxxxxx@xxxxxx.local"
set DavisTemp to Outdoor Temperature of Station "Handley's Sports Bar"
--set DavisTemp to random number from 0 to 120 with seed 0
end tell
on error
tell application "XTension"
turnon "Bad Communications with WeatherTracker"
write log "Problem with getting DavisTemp value from WeatherTracker 1" color red
end tell
end try
tell application "XTension" to write log "Upper Level Value " & DavisTemp
set LowerLevel to "500"
try -- Gather LowerLevel value from XTension
tell application "XTension"
set LowerLevel to value of "Current Lower Level Outside Temperature B2"
--set LowerLevel to random number from -10 to 110 with seed 0
end tell
on error
tell application "XTension" to write log "Problem with getting Lower Level Outside Temperature B2 2" color red
end try
tell application "XTension" to write log "Lower Level Value " & LowerLevel
-- Calculate the average temperature
set newTemp to (LowerLevel + DavisTemp) / 2.0
tell application "XTension"
write log "The latest new average temperature is: " & newTemp
set value "Current Temp Ave" to newTemp
end tell
try -- Send the average temperature to the Banner app
tell application "Handleys Sports Bar Banner" of machine "eppc://xxxxxx:xxxxxxx@xxxxxxx.local"
update temperature value newTemp --****************
end tell
on error
tell application "XTension" to write log "Problem with sending average temperature value to Banner app 3"
end try
end if
end if
end if
end if
end run
-- ===============================
-- XTension Initialization handler
-- ===============================
on initializeXTensionFlags()
tell application "XTension"
turnoff "Bad Communications with Mini #1" -- Init this to off
turnoff "Bad Communications with WeatherTracker" -- Init this to off
end tell
end initializeXTensionFlags
-- ===============================
-- Network Router IP handler
-- ===============================
on getRouterIP()
set thisMachineIP to IPv4 address of (system info)
set text item delimiters to "."
set routerIP to ¬
first text item of thisMachineIP & ¬
"." & second text item of thisMachineIP & ¬
"." & third text item of thisMachineIP & ¬
".1"
set text item delimiters to ""
return routerIP
end getRouterIP
--- ===============================
-- Communication testing handlers
-- ===============================
on lanWorking(routerIP)
try
do shell script ("ping -o -t 1 " & routerIP)
tell application "XTension"
--write log "Communication channel open to router" -- For Testing
end tell
return true
on error
tell application "XTension"
turnon "Bad Communications with Mini #1"
write log "Network communications problem. Bad Communications with Mini #1 4" color red
end tell
return false
end try
end lanWorking
on remoteComputerOn(remoteComputerName)
try
do shell script ("ping -o -t 1 " & remoteComputerName & ".local")
tell application "XTension"
-- write log "Communication channel open to remote computer" --For testing
end tell
return true
on error
delay 2 -- delay for 2 seconds to see if network traffic clears before trying again
try
do shell script ("ping -o -t 1 " & remoteComputerName & ".local")
tell application "XTension"
--write log "Communication channel open to remote computer" -- For testing
end tell
return true
on error
tell application "XTension"
turnon "Bad Communications with Mini #1"
write log "Computer communications problem with Mini #1. Bad Communications with Mini #1. 5" color red
end tell
return false
end try
end try
end remoteComputerOn
on remoteAccountLoggedIn(remoteComputerName, acctName, acctPswd)
set remoteComputerString to "eppc://" & acctName & ":" & acctPswd & "@" & remoteComputerName & ".local"
try
using terms from application "Finder"
tell application "Finder" of machine remoteComputerString to get name
end using terms from
tell application "XTension"
-- write log "Communication channel open to remote account" --For testing
end tell
return true
on error
tell application "XTension"
turnon "Bad Communications with Mini #1"
write log "Problem with the account and password with Mini #1. Bad Communications with Mini #1. 6" color red
end tell
return false
end try
end remoteAccountLoggedIn
on remoteAirServerWindowOpen()
try
tell application "AirServer" of machine "eppc://xxxxxx:xxxxx1@xxxxxxx.local"
set iPhoneWindowCount to count of (windows whose name contains "iPhone")
end tell
if iPhoneWindowCount = 0 then
return false
else
return true
end if
on error -- likely AirServer not running
return false
end try
end remoteAirServerWindowOpen
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.machomeautomation.com/pipermail/xtensionlist/attachments/20160301/6b86e6bc/attachment.html>
More information about the XTensionList
mailing list