Skip to content

ANSI C12.18 reader - #1231

Open
Xento wants to merge 7 commits into
UtilitechAS:mainfrom
Xento:agent/ansi-c1218-reader
Open

ANSI C12.18 reader#1231
Xento wants to merge 7 commits into
UtilitechAS:mainfrom
Xento:agent/ansi-c1218-reader

Conversation

@Xento

@Xento Xento commented Jul 26, 2026

Copy link
Copy Markdown

Summary

This branch adds full ANSI C12.18 session-management controls to the firmware and web UI.

It introduces configurable session termination after each meter read, a configurable automatic logoff interval, and a daily idle period. During the idle window, the firmware logs off any active session and does not start new meter queries.

Supported meter types

The C12.18 implementation is intended for OSGP-compatible optical smart meters, including:

  • Echelon 83331-3I
  • Echelon 83334-3I

Xento added 7 commits July 17, 2026 17:08
Add an ESP32 MeterCommunicator for ANSI C12.18 optical meters with session setup, CRC-checked framing, multi-packet response handling and automatic UART recovery after repeated failures.

Read byte order from table 0, energy counters from table 23 and standard or extended measurements from table 28. Publish the decoded values through the existing AmsData OBIS path so MQTT and Home Assistant need no protocol-specific changes.

Store user ID, username, password and the extended-table option in a separate backwards-compatible EEPROM block, and expose these settings in the existing web configuration UI.

Validated with npm run build and PlatformIO builds for esp32 and esp8266.
Implement ANSI C12.18 channel and inter-character timeouts, three link-layer retries, ACK/NACK turnaround, negotiated packet parameters, duplicate detection, sequence validation, and optional-service fallbacks.
Keep energy values on the fast poll cycle and refresh extended table 28 hardware values every 60 seconds.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant