Gateway and integration
Modbus and RS-485 in plain words:how an inverter gets read.
Modbus is a simple question-and-answer protocol: one master asks, a slave answers. RS-485 is the pair of wires it often travels on. A gateway that reads an inverter is a Modbus master asking for the inverter's registers over RS-485.
The shortversion.
Last checked 16 November 2026. General information, not legal, tax or financial advice; figures are estimates.
- One master starts every exchange, and slaves only ever reply. Slave addresses run from 1 to 247, and 0 is for broadcast.
- RS-485 is a balanced two-wire pair plus a common. The specification calls the wires D0 and D1 (A and B on many devices). Makers do not always label them the same way, so swapping them is the first thing to try.
- The serial specification requires 9600 and 19200 bit/s, with even parity as the default. At 9600 bit/s a trunk can run up to 1,000 m on cable of AWG 26 or wider.
- Termination goes at the two ends of the trunk only. Biasing, where needed, goes in one place only.
- A register is a 16-bit word. The specification does not say what any register means; that is up to the inverter's maker. Register numbers in manuals and the addresses on the wire can differ by one.
Ask and answer,one at a time.
How the Modbus serial protocol works.
Modbus is a small set of simple rules. The serial-line specification calls it a master and slaves protocol. Only one master is connected to the bus at a time, and up to 247 slaves share it.
- 01
The master asks
A Modbus communication is always started by the master. It sends a request to one slave.
- 02
The slave answers
The slave addressed processes the request and returns a reply. Slaves never send data without a request.
- 03
Nobody else talks
Slaves never talk to each other, and the master starts only one transaction at a time.
There is also a broadcast mode, where the master sends a request to all slaves and no reply is returned. Broadcast requests are necessarily writing commands.
Who is whoon the bus.
0
The broadcast address. All slaves must recognise it, and none reply.
1 to 247
The addresses of individual slaves. Each must be unique on the bus.
248 to 255
Reserved.
The master has no address of its own, only the slaves do. This is why an inverter's settings include a Modbus ID, which is its address on the bus: two devices with the same ID on one bus will answer over each other. The inverter we tested ships with ID 1 and 9600 bit/s as its defaults.
What RS-485needs.
The specification asks a new Modbus serial solution to use the RS-485 electrical standard, in a two-wire configuration: one balanced twisted pair that carries data in both directions, with only one driver transmitting at any time, plus a third conductor, the common, that links all the devices.
The specification names the pair's two wires D0 and D1. D1 corresponds to the terminal many makers label B (or B'), and D0 to the one labelled A (or A'). It asks makers to use the names D0, D1 and Common in their documents so devices can work together. In practice labels differ, which is why 'swap A and B' is the standard first move when a device will not answer. On the first WayTara unit we set up, it fixed the fault.
Speed andframing.
- 9600 and 19200 bit/s are required, and 19200 is the required default. Other rates may be offered, such as 1200, 2400, 4800 and 38400
- In the usual RTU mode each byte is sent as 11 bits: one start bit, eight data bits, one parity bit and one stop bit
- Even parity is required and is the default. With no parity, two stop bits fill the character out
- Every message ends with a two-byte CRC, so a corrupted frame can be detected
- Frames are separated by a silent interval of at least 3.5 character times, and a message is at most 256 bytes
- Devices can work together only if they are all in the same transmission mode, and RTU is the default. In practice the speed and the parity must match as well
That last point is the source of many 'it does not answer' reports: a master set to 9600 baud with even parity cannot read a slave set to 19200 baud with no parity.
How to lay outthe bus.
The serial-line specification's rules for a multipoint RS-485 bus.
- Length of the trunk
For up to 9600 baud and AWG 26 or wider cable, a maximum of 1,000 m. Category 5 cable may be used up to 600 m. It depends on baud rate, cable and the number of loads
- Branches
Derivations must be short, never more than 20 m. With a multi-port tap of n branches, each is limited to 40 m divided by n
- Number of devices
32 are always allowed without a repeater. More are possible if the devices are documented for it, and a repeater can extend the bus
- Line termination
Needed near each of the two ends of the trunk, never more than two on a pair, never on a branch. A 150 ohm (0.5 W) resistor, or 120 ohms in series with a 1 nF capacitor where the pair is biased
- Biasing (polarisation)
If one or more devices need it, one pair of resistors, 450 to 650 ohms, at a single place on the whole bus, usually at the master. It reduces the number of devices allowed by four
- The common conductor
Connected directly to protective ground, preferably at one point only, usually at the master
| What the specification says | |
|---|---|
| Length of the trunk | For up to 9600 baud and AWG 26 or wider cable, a maximum of 1,000 m. Category 5 cable may be used up to 600 m. It depends on baud rate, cable and the number of loads |
| Branches | Derivations must be short, never more than 20 m. With a multi-port tap of n branches, each is limited to 40 m divided by n |
| Number of devices | 32 are always allowed without a repeater. More are possible if the devices are documented for it, and a repeater can extend the bus |
| Line termination | Needed near each of the two ends of the trunk, never more than two on a pair, never on a branch. A 150 ohm (0.5 W) resistor, or 120 ohms in series with a 1 nF capacitor where the pair is biased |
| Biasing (polarisation) | If one or more devices need it, one pair of resistors, 450 to 650 ohms, at a single place on the whole bus, usually at the master. It reduces the number of devices allowed by four |
| The common conductor | Connected directly to protective ground, preferably at one point only, usually at the master |
A gateway and one inverter a few metres apart hardly need most of this. On a longer or busier bus, these are the rules to check first: the length, the branches, the ends and the common.
What is ina register.
From the application protocol specification.
Data in Modbus lives in tables. The one that matters for an inverter is registers, each a 16-bit word. The specification describes four tables: single-bit discrete inputs and coils, and 16-bit input registers and holding registers. Input registers are read-only. Holding registers can be read and written.
Reading
Function 03 reads a block of holding registers and function 04 reads a block of input registers. A request may ask for 1 to 125 consecutive registers.
Big-endian
A 16-bit value is sent with its more significant byte first, so 0x1234 goes out as 0x12 then 0x34.
Errors
If a request cannot be carried out, the reply carries the function code plus 0x80 and an exception code, instead of data.
One off by one
On the wire, registers are addressed from zero. The specification's own example says registers numbered 1 to 16 are addressed as 0 to 15. A manual may list register numbers or addresses, so check which a manual means before asking for register 100.
The specification also says that how the data model maps onto a device's own memory is entirely specific to the maker. In practice, what a register means, its unit and its scale are in the inverter's own Modbus documentation, not in the specification.
How our gatewayuses Modbus.
The WayTara gateway is the master. It reads only the registers its register map lists, joins neighbouring registers into one request where the gap is small, and asks for each at its own interval, from every few seconds for fast-moving values to once an hour for identity details.
Each request has a timeout, three retries, a CRC check and handling of exception codes. A register that fails three passes in a row is flagged and not silently shown as zero. Reads do not overlap writes. For a setting, the gateway writes, reads the register back and compares, and the dashboard shows it as applying, confirmed or failed.
Makers differ in what they accept. The Deye inverter we tested ignores the write-single-register function and accepts write-multiple-registers, so our firmware uses the second.
When an inverterdoes not answer.
- 01
Swap A and B
The most common cause. The labels differ between makers.
- 02
Check the ID, speed and parity
The master and the inverter must agree on all three, and the ID must be unique on the bus.
- 03
Check the port
Many inverters have several RS-485 ports for different jobs. Use the one the manual says is for Modbus.
- 04
Check power and termination
That the inverter is on, that the line is terminated at both ends only, and that no branch is long.
- 05
Look at the cable
Length, damage, and noise from nearby power cables. Keep the common connected.
Can an older inverterbe read?
In principle, yes, if it has a Modbus RS-485 port and its maker documents its registers. If either is missing, there is nothing to ask and nothing to interpret, and the answer is that it cannot be read by this route. A few makers use their own protocol on the same wires.
Send us the make and model and we will tell you. Deye hybrid inverters are supported today, and others are assessed and added after testing on real equipment.
Common questions,answered.
No. RS-485 is the electrical standard for the wires. Modbus is the protocol that says what the devices say to each other. Modbus on RS-485 is a common pair, and Modbus also runs over other links.
Where thiscomes from.
We link the documents themselves so you can check us. Last checked 16 November 2026.
- Modbus.org: MODBUS over Serial Line, Specification and Implementation Guide V1.02, 20 December 2006Sections 2.1 and 2.2 (master and slaves, addresses), 2.5.1 (RTU framing), 3.2 (speeds) and 3.4 (devices, length, termination, polarisation, grounding). A PDF.
- Modbus.org: MODBUS Application Protocol Specification V1.1b3, 26 April 2012Sections 4.2 to 4.4 (data encoding, data model, addressing) and 6.3 and 6.4 (the functions that read registers). A PDF.
- Modbus.org: Specifications and Implementation GuidesThe official list of the specifications.
- WayTara platform: how it connects and what it supportsThe statements on supported equipment and on what the gateway does.