Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 37 additions & 0 deletions DEVELOPMENT.MD
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# python-dcm230

Driver for Eastron DCM230 DC Energy Meters using Modbus RTU.

## Get started

### Prerequisites

* Install [Python (>=3.10)](https://www.python.org/downloads/)
* Install [git](https://git-scm.com/downloads)
* Install [uv](https://docs.astral.sh/uv/getting-started/installation/)

### Setup development environment

Clone the repository:

```sh
git clone git@github.com:id8-engineering/python-dcm230.git
```

Change directory:

```sh
cd python-dcm230
```

Run pre-commit tests:

```sh
uv run pre-commit run -a
```

Build package:

```sh
uv build
```
41 changes: 41 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
[![OpenSSF Scorecard](https://api.scorecard.dev/projects/github.com/id8-engineering/python-dcm230/badge)](https://scorecard.dev/viewer/?uri=github.com/id8-engineering/python-dcm230)

## python-dcm230

python-dcm230 provides a simple, Pythonic interface for reading and writing data
from Eastron DCM230 DC meters over Modbus RTU. It builds on top
of [pymodbus](https://pypi.org/project/pymodbus/).

## Example usage:

```python
from dcm230 import Dcm230
from pymodbus.client import ModbusSerialClient

# Configure the Modbus client
client = ModbusSerialClient(
port="COM3", # or "/dev/ttyUSB0" on Linux
baudrate=9600,
parity="E",
stopbits=1,
bytesize=8,
timeout=1,
)

# Device Modbus address
device_address = 1

# Initialize the Dcm230 driver
meter = Dcm230(device_address=device_address, client=client)

# Read voltage
voltage = meter.V
print(f"Voltage: {voltage} V")
```

## Report issues

If you run into problems, you can ask for help in our [issue tracker](https://github.com/id8-engineering/python-dcm230/issues) on GitHub.

## Contributing
See [CONTRIBUTING.MD](https://github.com/id8-engineering/python-dcm230/blob/main/CONTRIBUTING.MD) and [DEVELOPMENT.MD](https://github.com/id8-engineering/python-dcm230/blob/main/DEVELOPMENT.MD).