'NCD Relay - How to fix WinError 10060 - Python

Trying to write code to connect to a solid state, 8-relay NCD board. All I want to do is be able to turn on and off a relay. What am I doing wrong?

#importing packages

import socket

from ncd_industrial_relay import Relay_Controller

#connect the socket using IP address and Port

IP_ADD = '160.69.4.212'

PORT = 2101

#set up socket with desired settings

#AF_INET refers to the address family ipv4

#SOCK_STREAM means connection oriented TCP protocol

sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)

board = Relay_Controller(sock)

sock.connect((IP_ADD, PORT))

board.turn_on_relay_by_index(1)

sock.close()

Traceback (most recent call last): File "C:\Users\A-Justin.Brundage\downloads\Industrial-Relay-Control-master\Industrial-Relay-Control-master\Example.py", line 17, in <module> sock.connect((IP_ADD, PORT)) TimeoutError: [WinError 10060] A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond

Not sure where I am going wrong, thanks



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source