添加链接
link管理
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接

Hello,

I’m trying to connect to a relay board in python. I’m using the code from Industrial-Relay-Control/Network-Relay-Example.py at master · ncd-io/Industrial-Relay-Control · GitHub with the IP changed to match the IP set in NCD Config Tool. I get the following error when running the code: [WinError 10061] No connection could be made because the target machine actively refused it

This is how it is configured.

Going to 192.168.1.88 in a webpage gets the following error: 192.168.1.88 refused to connect.
However, I can ping it and get a response.

I have tried various combinations of resetting the board with the NCD ConfigTool.
One forum thread -( Python and Socket not responding - Software / Python - NCD.io Community ) mentioned only one tool could be connected at once, so I’ve restarted the computer and tried to run code and on a different restart open it in the web browser and get the same results.

Would anyone have any suggestions on how to fix this issue?

Hi Dan,

This module is running an older firmware. I would recommend updating the firmware according to the instructions at: GitHub - ncd-io/ncd_Ethernet . 2.3 is the latest version and you can find it at: ncd_Ethernet/HRev2_NCD5500_V2.3_2023-3-27.bin at main · ncd-io/ncd_Ethernet · GitHub

Additionally it looks like you may have the Static IP jumper installed in the Ethernet module. This jumper is designed for communications recovery and not common use. You can remove this jumper and set the static IP using the network settings of the config tool.

Also it looks like you are on a network with a router when trying to communicate to this device. Can you post the results of running ipconfig in the command line on Windows? This would allow me to look for a routing issue.

Additionally if you could post your code in Python that deals with opening the comms with this device I can review that.

Hello,

When I upload the firmware in the NCD ConfigTool, it gets to 100% and a pop up box appears saying “Firmware download over.”, but if I restart the board and NCD ConfigTool the firmware version still shows as 1.1.

The Static IP jumper isn’t currently in, and continuity test show that the 2 pins aren’t connected - is there something in the screenshot that indicates the jumper is in?

The IP Config is below - it’s a USB-Ethernet adaptor, there is no router. The computer is also connected to a company network (10.13.x.x).

Ethernet adapter Ethernet 4:

Connection-specific DNS Suffix . :
Link-local IPv6 Address . . . . . : fe80::661b:be2f:5fea:1e93%15
IPv4 Address. . . . . . . . . . . : 192.168.1.2
Subnet Mask . . . . . . . . . . . : 255.255.255.0
Default Gateway . . . . . . . . . : 192.168.1.1

This is the Python code:
#import the pyserial module
import socket
import ncd_industrial_relay

#set up your socket with the desired settings.
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
#instantiate the board object and pass it the network socket
board1 = ncd_industrial_relay.Relay_Controller(sock)
#connect the socket using desired IP and Port
IP_ADDRESS = “192.168.1.88”
PORT = 2101
sock.connect((IP_ADDRESS, PORT))
sock.settimeout(.5)

Hi Dan,

The firmware not updating makes me think it might be a faulty Ethernet module. The only resolution for this would be an RMA which you can request at: NCD Login - ncd.io .

The static IP address of 192.168.1.88 is the static IP assigned to these devices when using this jumper as well as the rest of the settings shown in your screenshot. If you change them, apply the settings, and restart the device they should stay changed. It’s most likely an issue with this older firmware that’s leaving it in an unrecoverable state.

It doesn’t look like an issue in routing. Those two networks woudln’t interfere with each other.

The Python code looks correct as well so that just leaves a hardware failure.

If you can request an RMA I can talk to the production department and have you not ship us the board and we just send you a replacement Ethernet module. You can power down the board and swap them out. Just make sure the pins line up before powering back on.