You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
ConnectionResetError: [Errno 104] Connection reset by peer #81
After tcp.read_coils() function, when I run the command tcp.send_message() I get the error - ConnectionResetError: [Errno 104] Connection reset by peer.
How can this be solved?
Below is my code attached
Hi @OrangeTux, yes I have mentioned the required ip address and the port number in my actual code. It is just for the question, I have replaced the ip address with HOST.
Hi @OrangeTux, there has been a slight misunderstanding. In my original code, I have written sock.connect(('192.168.0.2', 102)). I am getting the ConnectionResetError for it.
Are you sure a modbus server is running on that IP-address? If so, there's probably something in your network filtering out your connection request, like a firewall of some kind.
The error you get is a more generic error from Python not being able to open a socket. Try to look up ConnectionResetError and under what circumstances Python would raise it.
I don't think this is a problem with uModbus, as uModbus doesn't do any connection handling, that's all done by the socket module from Python.
Activity
OrangeTux commentedon Dec 11, 2019
Hello @unidev10. You seem to want to connect to
HOSTand there is no Modbus server running there.My guess is that you need to replace
HOSTwith a valid ip or hostname, like:unidev10 commentedon Dec 11, 2019
Hi @OrangeTux, yes I have mentioned the required ip address and the port number in my actual code. It is just for the question, I have replaced the ip address with
HOST.OrangeTux commentedon Dec 11, 2019
Super! I'll close the issue now. Feel free to reopen if needed.
unidev10 commentedon Dec 12, 2019
Hi @OrangeTux, there has been a slight misunderstanding. In my original code, I have written
sock.connect(('192.168.0.2', 102)). I am getting theConnectionResetErrorfor it.jaapz commentedon Dec 12, 2019
Are you sure a modbus server is running on that IP-address? If so, there's probably something in your network filtering out your connection request, like a firewall of some kind.
The error you get is a more generic error from Python not being able to open a socket. Try to look up
ConnectionResetErrorand under what circumstances Python would raise it.I don't think this is a problem with uModbus, as uModbus doesn't do any connection handling, that's all done by the
socketmodule from Python.