Discussion:
[ethersex-devel] Setting default state of ports
Mats Lagerwall
2014-08-11 08:24:29 UTC
Permalink
<html>
<head>

<meta http-equiv="content-type" content="text/html; charset=ISO-8859-15">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<font face="Arial">Hello,<br>
<br>
I'm new using your great prog for the AVR-NET-IO.<br>
<br>
Everything is working perfectly getting temps from1-Wire and
turning relays on and off on the K8 IO.<br>
<br>
I'm now looking for way to set the state of the relays if the
connection to the "host" application is lost.<br>
<br>
Example:<br>
<br>
I have a prog reading values from the AVR and switching thing on
and off.<br>
If the connection between the PC and the AVR is lost, a turned on
relay will stay on. This might be dangerous depending on the
purpose.<br>
<br>
I'm trying to find a way to tell the AVR to turn off all relays if
the connection to the PC is lost.<br>
<br>
I could also imagine to use one of the ADC ports to check the
"online" status, like if the value = 0 PC is online and if
&lt;&gt; 0 PC is offline.<br>
Then it would also be possible to have an emergency switch to turn
the AVR off.<br>
<br>
Thanks again for a great job and I would very much appreciate to
hear from you.<br>
<br>
Cheers<br>
<br>
Mats <br>
<br>
</font>
</body>
</html>
tjareson
2014-08-21 08:29:53 UTC
Permalink
Hi Mats,

I think the easiest way would be to let it ping the host, but as far as
I know, there is no ping command implemented. (this information might be
outdated)

Alternatively you could just try to connect from your avr to the ip
address of your host within a c6-script. If that doesn't work you know
that there is a problem with the connection and/or host.

Look for C6 TCP_CONNECT command - an example you can find here:
http://old.ethersex.de/index.php/Persistent_TCP_Connection

Or just make sure that your host is sending a keep alive signal every n
seconds. If you avr-net-io is not receiving that anymore, then it can
reset the relais or whatever subsequent action is necessary.

Tjareson
Post by Mats Lagerwall
Hello,
I'm new using your great prog for the AVR-NET-IO.
Everything is working perfectly getting temps from1-Wire and turning
relays on and off on the K8 IO.
I'm now looking for way to set the state of the relays if the
connection to the "host" application is lost.
I have a prog reading values from the AVR and switching thing on and off.
If the connection between the PC and the AVR is lost, a turned on
relay will stay on. This might be dangerous depending on the purpose.
I'm trying to find a way to tell the AVR to turn off all relays if the
connection to the PC is lost.
I could also imagine to use one of the ADC ports to check the "online"
status, like if the value = 0 PC is online and if <> 0 PC is offline.
Then it would also be possible to have an emergency switch to turn the
AVR off.
Thanks again for a great job and I would very much appreciate to hear
from you.
Cheers
Mats
_______________________________________________
Ethersex-devel mailing list
http://list.zerties.org/cgi-bin/mailman/listinfo/ethersex-devel
Loading...