Reading current settings: read_registers
Control and configuration registers never appear in telemetry. The
polling cycle only reads registers categorised telemetry; every writable
setting lives in control, config or alarm and is excluded. So a
remote-control screen has no source of current values unless it asks:
// → client
{"type": "read_registers", "deviceKey": "7c9e6679-7425-40de-944b-e07fc1f90ae7",
"registers": ["remote_on_off_enable", "generator_enable", "overload_restart"]}
// ← server — read from the device now
{"type": "registers_values", "deviceKey": "7c9e6679-7425-40de-944b-e07fc1f90ae7", "ok": true,
"values": [
{"register": "remote_on_off_enable", "ok": true, "value": 1},
{"register": "generator_enable", "ok": true, "value": 0},
{"register": "overload_restart", "ok": false, "error": "register falls outside the batch response (offset 12, need 2, have 8)"}
]}
Text registers
Most registers hold a number. A few hold packed ASCII text — the inverter's
serial number, for example (sn on the Aotai Hybrid profile). Modbus has no
string type, so these are stored two characters per 16-bit register and are
decoded server-side into a string.
For such a register the entry carries text, and value stays 0:
// ← server
{"type": "registers_values", "deviceKey": "3f2504e0-4f89-41d3-9a0c-0305e82c3301", "ok": true,
"values": [
{"register": "sn", "ok": true, "value": 0, "text": "AT2024ABCD1234"}
]}
Read text when it is present; fall back to value when it is not. text
is omitted entirely for numeric registers, so its presence is what
distinguishes the two — never the value of value, which is a legitimate
0 for many numeric registers.
A packed date/time register (catalog dataType datetime, e.g. Aotai
time and warning_time) is returned the same way, as text in the form
"YYYY-MM-DDTHH:MM:SS". That is the inverter's own clock, with no UTC offset.
A date/time the device never set (all zero bytes, e.g. warning_time
before any warning) reports ok: false with an error.
A text register that could not be decoded reports ok: false with an
error, and carries neither a usable value nor a text. It is never
reported as an empty string: an empty serial is not a usable answer, and a
client binding on one must see a failure.
Text registers are excluded from the telemetry poll — they are identity, not
measurement, and they do not change — so read_registers is the only way to
obtain one.
Each register reports its own ok. Reads are coalesced into the fewest
Modbus round trips, and one failed batch marks only its own members failed
— a single bad address can't blank out the whole screen. An unknown name
comes back as a per-register error, not a rejected request.
On an IP20 3K6/5K (ASCII protocol, not Modbus) there are no batches:
each distinct text query is sent once per request, however many registers
its reply fills (every flag setting comes from one TE?), at about half a
second a query. A query that fails or is answered NAK fails only its own
registers; one not reached before the request's deadline fails with not read in time. A read that arrives during that model's ~9 s telemetry cycle
is run between two of the cycle's queries instead of waiting for the cycle
to end. Its text registers (firmware_version, inverter_sn, …) are plain
reply fields rather than packed registers; inverter_sn reads as the
factory placeholder on a unit whose serial was never programmed. See
IP20 3K6/5K.
A batch the inverter refuses with a Modbus exception (both the Yorker and the
Nexus answer exception 04 for a whole read when any address in it, even an
undocumented gap between two requested registers, is not readable) is split
and retried, down to single registers. It is cut at an address gap first,
since that is where an unreadable address usually is. A register refused on
its own is tried once more, because the older Yorker firmware sometimes
refuses a register it reads fine a moment later. So a register comes back
ok: false with an exception only when the inverter refuses it on its own,
and the error then says so: the inverter refused to read this register on its own, so this firmware most likely does not implement it: device returned exception code 0x04 for function 0x03.
The split points are remembered per inverter, across reconnects, until the
TCP server restarts. So only the first read of a screen pays the extra round
trips. On the older Yorker firmware (6 kW) that first read of the More screen
needs 30 or more round trips and can take up to about 20 seconds; later reads
take a few seconds. A read that still has registers left when its time runs
out reports them with not read: the request ran out of time while working around registers this inverter refuses to read; open the screen again.
Reading again fills them in.
At most 64 registers per request. Every batch is a full round trip over
the WiFi-to-serial bridge — the same cost that makes a 353-register
telemetry cycle take 19–26 seconds. Ask in pages if a screen needs more.
One read_registers may be in flight per connection. The device side also
queues at most one pending read (from any client), so reads of a busy
device can come back ok: false with a register read is already in progress for this device, try again shortly. An offline device answers
device offline or unreachable after about 25 seconds, the longest a read
may take. Give read_registers and get_registers with values at least
30 seconds before timing out on the client.
There's no ownership check on this, unlike write — it's a read, and it's
consistent with watch, which already streams telemetry to any client that
can reach the gateway. Both sit under the same still-open authentication
gap.