Relay group reset command line for a python script

Hi

I have 7 IP controlled relay boards that work with a python program. If a power outage happens at the computer the relays have residual port information that require a power cycle or a web login to send a reset.
Is there some sort of a reset script that I could send during boot up, or the beginning of my python program, to clear any posssible conflicts, before the main body of the program?

Hi,

If your relay controllers have an NCD5500 Ethernet module then you can use the inactivity timeout setting to close the client socket from the software after a defined interval. The software should send a packet to the controllers on interval to maintain the socket. This can be configured using the configuration software as explained in the NCD5500 user guide here:

Thank you,
Travis

Thanks for the reply Travis. I will give it a try!

Hi Travis
I tried different time-out settings, but all I got was a “broken pipe” error.
Is there a way to insert a code line (or more) in my code that will send a reset command to the relays?
My code has a delay to allow the OS to settle in, before the main loop. (see below)
Could I insert something after I import “ncd_industrial_relay.py”?
If so what would the command line be per relay?

( a few lines)
from kivy.uix.button import Button

import socket
import ncd_industrial_relay

import os
import time
############# set delay for os boot-up #############
time.sleep(5)

from kivy.clock import Clock

set relay on time for all relays

dreams = 300

# floors 6-43 Elevator PSE1

sockc6 = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
C6Controller = ncd_industrial_relay.Relay_Controller(sockc6)
IP_ADDRESSC6 = “192.168.32.18”
PORTC6 = 15000
sockc6.connect((IP_ADDRESSC6, PORTC6))
sockc6.settimeout(.5)

Thanks for any help you could give!