I stil have continuing problems with this errorcode = 2, LUA code is like this:
function IP_Send(Code, IP, Port, Message_Header)
message = ""
bytes = 0
errorcode = 0
try = 1
tcpSocket = Net.FTcpSocket(IP, Port)
tcpSocket:setReadTimeout(50)
bytes, errorCode = tcpSocket:write(Code.."\r")
tcpSocket:disconnect()
while errorCode ~= 0 and try ~= 6 do
message = message.."- Försök "..try.." misslyckades att sända "..Code.." , returkod "..errorCode.."!\r"
fibaro:sleep(350)
tcpSocket = Net.FTcpSocket(IP, Port)
tcpSocket:setReadTimeout(50)
bytes, errorCode = tcpSocket:write(Code.."\r")
tcpSocket:disconnect()
try = try + 1
end
if message ~= ""
then
subject = Message_Header.." sänd misslyckades!"
fibaro:call(2, "sendEmail", subject, message)
return false
end
return true
end
IP_Send("SIIRADIO","xxx.xxx.xxx.xxx",23,"Marantz SR7008 IP")
And result is an email everytime I get into problemes with transmitting, and it is frequent:
- Försök 1 misslyckades att sända SIIRADIO , returkod 2!
- Försök 2 misslyckades att sända SIIRADIO , returkod 2!
- Försök 3 misslyckades att sända SIIRADIO , returkod 2!
Translated: "Trial x was unsucessfull to transmit "SIIRADIO", returncode = 2"
It would be great if someone could give any clues to WHY this is happening and WHAT errorcode = 2 is...