18 Commits

Author SHA1 Message Date
Patrick Schurig
cbfb5df23e abbterra: make ABB Terra AC addable over Modbus TCP (etm2..etm5)
Follow-up to the etm1 fixes, driven by live debugging against a real ABB
Terra AC 7 kW behind a Waveshare RS485->TCP gateway (192.168.1.132, slave 2):

- etm3: disable TCP auto-discovery (createMethods = "user" only). Discovery
  blind-scans the LAN and SIGSEGVs nymead as soon as any Modbus device answers
  :502 with an exception response. The crash is in the generated reachability
  handler (abbterramodbustcpconnection.cpp:2062 dereferences the check-reachable
  reply after it is freed); it could not be fixed from the discovery code alone.
  A gateway's slave id can't be discovered anyway, so manual add is required.
- etm2: still defer/guard AbbTerraTcpDiscovery::cleanupConnection() teardown
  (kept for correctness even though discovery is now off by default).
- etm4: setupTcpThing() never called connectDevice(), so manual setup hung until
  timeout. Start the connection when the network monitor reports the device.
- etm5: decode the serial-number and firmware register fields as BCD per ABB
  spec §5.1 (0x46 = week 46, not 70; 0x22 = 22 kW). The binary reading rejected
  real chargers ("does not match the ABB Terra AC Modbus register map").

Verified end to end: charger adds cleanly (TACW7-4-4624-S0034), states poll and
actions execute, no SIGSEGV. The underlying discovery/generated-code crash is
tracked separately.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-03 12:14:44 +02:00
Patrick Schurig
368c80688a abbterra: fix TCP discovery SEGV + restore checkReachableRegister
Two coupled fixes so the ABB Terra AC can be added over Modbus TCP:

- Restore checkReachableRegister ("serialNumber") in the register JSON.
  The libnymea-modbus 1.15 code generator *requires* it — without it the
  connection classes (abbterramodbustcpconnection.h) are never generated and
  the plugin fails to build. Reverts the false lead in b23a9a2. The register
  is valid: mbpoll confirms holding reg 16384 (uint64) responds at slave 2.

- Fix a use-after-free in AbbTerraTcpDiscovery::cleanupConnection() that
  SIGSEGV'd nymead during network discovery whenever any Modbus device on the
  LAN answered on :502 with an exception (e.g. "illegal data address"). The
  method is invoked from several of the connection's own signals; it now
  bails out on the second (re-entrant) call and disconnects the connection's
  signals before disconnectDevice(), so the teardown can no longer re-enter
  while the QModbusReply "finished" handler is still dereferencing the reply.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-03 10:48:47 +02:00
Patrick Schurig
b23a9a2d00 abbterra: remove checkReachableRegister - not supported in libnymea-modbus 1.15 2026-07-03 09:55:59 +02:00
Patrick Schurig
341ea364c9 abbterra: revert to etm6 - upstream blocks not compatible with libnymea-modbus 1.15 2026-06-25 02:19:09 +02:00
Patrick Schurig
03f504d09a abbterra: adopt upstream block structure - init/update/WO registers 2026-06-25 02:09:49 +02:00
Patrick Schurig
fe7c15d0b9 abbterra: split status block to respect 31-byte RT38B01 frame limit
The status block (12 registers × 2 words = 24 words) was read as a
single Modbus request, producing a 53-byte response that overflows the
RT38B01 433 MHz radio module's 31-byte frame limit.

Dissolve the status block into individual registers with
readSchedule:update so queuedRequests sends them one at a time
(max 9 bytes per response). The deviceInfo init block (8 words → 21
bytes) is left untouched.

Bump to 1.15.0+etm6.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-24 23:33:15 +02:00
Patrick Schurig
a068d5a2cd abbterra: fix RTU setup on slow radio links (433 MHz)
reachableChanged(true) never fires within the nymea setup timeout when
the RTU link is slow (e.g. 433 MHz radio relay). Add a fallback:
trigger initialize() immediately if master is already connected
(QTimer::singleShot 500 ms), and also on master::connectedChanged.
The existing reachableChanged path is kept for TCP-style RTU adapters.

Bump to 1.15.0+etm5.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-24 23:08:36 +02:00
Patrick Schurig
26531fd58f abbterra: set readSchedule=no on write-only holding registers 2026-06-24 22:23:39 +02:00
Patrick Schurig
4ad670c45d abbterra: fix readSchedule init on write-only holding registers 2026-06-24 22:14:44 +02:00
Patrick Schurig
c82b00ddfa abbterra: communicationTimeoutReadback en 1er niveau (update) pour generer la methode reclamee par applyTimeoutSetting 2026-06-01 09:58:37 +02:00
Patrick Schurig
e0582d1fff abbterra: restaure le .h original (declaration applyTimeoutSetting manquait, .cpp et .h desynchronises) 2026-06-01 09:45:31 +02:00
Patrick Schurig
8086e80f20 abbterra: WO -> RW sur les 4 registres de commande (generateur 1.15 ne gere pas WO pur en 1er niveau) 2026-06-01 09:42:29 +02:00
Patrick Schurig
653418ce30 abbterra: abbterra-registers.json) 2026-06-01 09:39:24 +02:00
Patrick Schurig
95177a417a abbterra: readSchedule:write sur les WO (cle presente, valeur neutre -> ni KeyError ni updateXxxCommand) 2026-06-01 09:16:06 +02:00
Patrick Schurig
09dd698cf6 abbterra: restaure pilotage (cpp+json upstream) + registers.json sans readSchedule vide (compat generateur 1.15) 2026-06-01 09:09:22 +02:00
Patrick Schurig
14a2ae89c1 abbb2x: registers.json - cle 'registers' au 1er niveau (fix KeyError generateur) 2026-06-01 08:48:50 +02:00
Patrick Schurig
3cbce56454 abbterra: retire les registres WO pour build sur generateur 1.15 (lecture seule)
- abbterra-registers.json : suppression des 4 registres WO
  (chargingCurrentLimitCommand, socketLockCommand, startStopChargingSession,
  communicationTimeoutCommand) incompatibles avec le generateur libnymea-modbus 1.15
- integrationpluginabbterra.cpp/.h : suppression de executeAction + applyTimeoutSetting
- integrationpluginabbterra.json : power + maxChargingCurrent passes en lecture seule
  (writable/displayNameAction retires)
La borne sera reconnue et lira les mesures ; le pilotage sera rebranche
quand le generateur 1.16 sera disponible.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-01 08:29:36 +02:00
Patrick Schurig
c26b0336bd Ajout plugin ABB Terra AC (vendoring upstream experimental-silo)
- abbterra/ copié depuis nymea-plugins-modbus experimental-silo (a652793)
- paquet nymea-plugin-abbterra (nom upstream, vendoring tracé dans VENDORED.md)
- 3 paquets binaires => .install par paquet
- abbterra ajouté à FORKED_PLUGINS du mirror (exclusion upstream)
- changelog 1.15.0+etm3
2026-06-01 07:38:51 +02:00