Easy Modbus · plain-English Modbus reference

What does Modbus connection refused (Errno 111) mean?

Updated 18 September 2026

Short answer

“Connection refused” — often shown as [Errno 111] Connection refused — means your request reached a real host, but nothing was listening on the Modbus port you tried, so the host actively said no. That is different from a timeout, which is silence. It narrows to four things: the wrong port (Modbus TCP is 502, but some devices use 503 or 5020), Modbus TCP switched off on the equipment, the right port on the wrong host, or the device's single connection already being in use.

Refused is not the same as timed out

The distinction tells you where to look. A timeout means nothing answered at all — usually no route, or a firewall silently dropping packets. Refused means a host was reached and it actively rejected the connection, because nothing is listening on that port. The network is fine; the port is the problem.

The four causes

1. Wrong port

Modbus TCP is registered on 502, and that is the default to try. But 503 turns up where two Modbus services share a host, and 5020 is common on gateways and where 502 was already taken. Check the device's own network settings screen for the actual port.

2. Modbus TCP is switched off

A lot of equipment ships with Modbus disabled, or with only the serial port enabled. There is usually a menu item to turn Modbus TCP on, and some devices need a reboot afterwards. Until it is on, port 502 is closed and every attempt is refused.

3. Right port, wrong host

If you are pointing at a PC, a PLC's programming port, or a switch rather than the Modbus device itself, the host is up but has nothing on 502. Double-check the IP against the equipment label or its display.

4. The one connection is already taken

Many Modbus TCP devices accept exactly one connection. If a building management system or a logger already holds it, some devices refuse the second attempt outright rather than timing out. Close other software and try again.

How to confirm it in a minute

  1. Ping the IP. If ping works but Modbus is refused, it is the port or the service (causes 1–2), not the network.
  2. Try 502, then 503, then 5020.
  3. Check the device screen for whether Modbus TCP is enabled and on which port.
  4. Close anything else talking to it and retry.

Easy Modbus reports refused and timed-out differently, so you know at a glance whether to chase the port or the network — and its sweep tries the common Modbus ports for you. If the device is really serial behind a gateway, also see TCP, RTU or RS-485 — which do I have?