Skip to content

Modbus RTU Master No Response from Slave

DodaTech Updated 2026-06-26 1 min read

In this tutorial, you'll learn about Modbus RTU Master No Response from Slave. We cover key concepts, practical examples, and best practices.

The Problem

Modbus RTU master sends request but receives no response from slave.

Quick Fix

Wrong

#include <ModbusRtu.h>

ModbusRtu master;
master.begin(9600, SERIAL_8N1);  // Wrong baud rate or config```

Master sends request (RE/DE pin toggles) but no response from slave.


### Right

```cpp
#include <ModbusRtu.h>

Modbus master(1, Serial, 2);  // ID 1, Serial port, RE/DE pin 2

void setup() {
  master.begin(9600, SERIAL_8N1);  // 9600 baud, 8 data, no parity, 1 stop
  master.setTimeOut(1000);         // 1 second timeout
  master.setTxCallback(startTx);   // Toggle RE/DE to transmit
  master.setRxCallback(stopTx);
}

void startTx() {
  digitalWrite(2, HIGH);  // Enable RS485 driver
}

void stopTx() {
  digitalWrite(2, HIGH);  // Hold enable briefly
  delay(1);
  digitalWrite(2, LOW);   // Release for slave to respond
}

void loop() {
  uint16_t data[1];
  int result = master.readHoldingRegisters(1, 0, 1, data);
  if (result == 0) {
    Serial.print("Register 0: ");
    Serial.println(data[0]);
  } else {
    Serial.print("Error: ");
    Serial.println(result);
  }
  delay(1000);
}```

Register 0: 1234 (Stable communication at 9600 baud, 8N1)


## Prevention

Modbus RTU master must control the RE/DE (Receiver Enable/Driver Enable) pin for RS485 half-duplex. Pull HIGH before transmitting, wait 1ms after, pull LOW for slave response. Settings (baud, parity, stop bits) must match the slave. Use 9600 8N1 for maximum compatibility. Timeout should be generous (1s+) for slower baud rates.

DodaTech engineers apply these same patterns across Doda Browser, DodaZIP, and Durga Antivirus Pro for production IoT reliability.

## FAQ

<details style="margin-bottom:12px;border:1px solid #e2e8f0;border-radius:10px;overflow:hidden"><summary style="cursor:pointer;padding:14px 18px;font-weight:600;font-size:1.05rem;background:#f8fafc;border-bottom:1px solid #e2e8f0;color:#1e293b">### Why no response from slave?</summary><div style="padding:14px 18px;color:#475569;line-height:1.7;background:#fff"><p>Wrong baud/parity, RE/DE pin not toggled, wrong slave ID, wiring issues (A/B swapped), missing GND connection. Each slave must have a unique ID (1-247).</p>
<h3 id="what-baud-rate-is-standard">What baud rate is standard?</h3><p>9600 8N1 is most common. Other rates: 19200, 38400, 115200. All devices on the bus must use the same settings.</p>
<h3 id="do-i-need-termination-resistor">Do I need termination resistor?</h3><p>For long cables (&gt;100m) or high baud rates, add 120 ohm resistor between A and B at both ends of the bus.</p>
</div></details>

Built by the developers of DodaTech

Doda Browser, DodaZIP & Durga Antivirus Pro