Skip to content

ANSI C12.18 component for Espressif ESP32 ESP-IDF framework

License

Notifications You must be signed in to change notification settings

tmedicci/esp-idf-ansic1218

Repository files navigation

ESP-IDF ANSI C12.18 Component

ANSI C12.18 component for Espressif ESP32 ESP-IDF framework

ANSI C12.18 is a communication protocol for two-way communication with a metereing device through an ANSI Type 2 Optical port. This component implements ANSI C12.18 funcitonalities over UART port, which can be attached to a optical-serial adapter to interface with the metering device.

Implemented Services

  • Identification Service;
  • Read (Total Read) Service;
  • Write Service (Total Write);
  • Security Service;
  • Partial Read (offset/octet-count method);
  • Partial Write (offset/octet-count method);

How to use

ANSI C12.18 Component

Clone this repository somewhere, e.g.:

cd ~/myprojects/esp
git clone https://github.com/tmedicci/esp-idf-ansic1218.git ansic1218

Add path to components in your CMakeLists.txt:

cmake_minimum_required(VERSION 3.5)
set(EXTRA_COMPONENT_DIRS /home/user/myprojects/esp)
include($ENV{IDF_PATH}/tools/cmake/project.cmake)
project(my-esp-project)

External Components

esp-idf-ansic1218 uses esp-idf-libutils as an external component in order to handle with commonly used functionalities.

In the same folder level of the esp-idf-ansic1218, clone it:

cd ~/myprojects/esp
git clone https://github.com/tmedicci/esp-idf-libutils.git libutils

ANSI C12.18 Examples

Examples directory provides the following usage examples:

To build examples, clone this repository somewhere, navigate to the example directory and build it with 'idf.py' e.g.:

cd ~/myprojects/esp
git clone https://github.com/tmedicci/esp-idf-ansic1218.git
cd examples/meter_identification
idf.py build

About

ANSI C12.18 component for Espressif ESP32 ESP-IDF framework

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published