volttron-dnp3-outstation


Namevolttron-dnp3-outstation JSON
Version 0.1.2rc1 PyPI version JSON
download
home_pagehttps://github.com/eclipse-volttron/volttron-dnp3-outstation
SummaryA Volttron agent that acts as a dnp3 outstation.
upload_time2023-05-12 19:06:34
maintainerVolttron Team
docs_urlNone
authorKefei Mo
requires_python>=3.8,<4.0
licenseApache-2.0
keywords volttron agent dnp3 outstation application
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # volttron-dnp3-outstation

[![Eclipse VOLTTRON™](https://img.shields.io/badge/Eclips%20VOLTTRON--red.svg)](https://volttron.readthedocs.io/en/latest/)
![Python 3.10](https://img.shields.io/badge/python-3.10-blue.svg)
![Python 3.11](https://img.shields.io/badge/python-3.11-blue.svg)
[![Pytests](https://github.com/eclipse-volttron/volttron-dnp3-outstation/actions/workflows/run-tests.yml/badge.svg)](https://github.com/eclipse-volttron/volttron-dnp3-outstation/actions/workflows/run-tests.yml)
[![pypi version](https://img.shields.io/pypi/v/volttron-dnp3-outstation.svg)](https://pypi.org/project/volttron-dnp3-outstation/)

Distributed Network Protocol (DNP
or [DNP3](https://en.wikipedia.org/wiki/DNP3))
has achieved a large-scale acceptance since its introduction in 1993. This
protocol is an immediately deployable solution for monitoring remote sites because it was developed for communication of
critical infrastructure status, allowing for reliable remote control.

DNP3 is typically used between centrally located masters and distributed remotes.
Application layer fragments from Master DNP3 stations are typically requests for operations on data
objects, and application layer fragments from Slave DNP3 stations (i.e., Outstation) are typically responses to those
requests. A DNP3 Outstation may also transmit a message without a request (an unsolicited response).
The volttron-dnp3-outstation is an implementation of the DNP3 master following
the [VOLTTRON Agent Specifications](https://volttron.readthedocs.io/en/main/developing-volttron/developing-agents/specifications/index.html?highlight=agent#agent-specifications).

Note: to fully desmonstate the volttron-dnp3-outstation features, including polling data, setting point
values, etc., it is suggested to establish connection between an outstation and a DNP3 master instance.
The [dnp3-python](https://github.com/VOLTTRON/dnp3-python) can provide the essential master functionality,
and as
part of the volttron-dnp3-outstation dependency, it is immediately available after the volttron-dnp3-outstation is
installed.

# Prerequisites

* Python 3 (tested with Python3.8, Python3.9, Python3.10)

## Python

<details>
<summary>To install specific Python version (e.g., Python 3.8), we recommend using <a href="https://github.com/pyenv/pyenv"><code>pyenv</code></a>.</summary>

```shell
# install pyenv
git clone https://github.com/pyenv/pyenv ~/.pyenv

# setup pyenv (you should also put these three lines in .bashrc or similar)
export PATH="${HOME}/.pyenv/bin:${PATH}"
export PYENV_ROOT="${HOME}/.pyenv"
eval "$(pyenv init -)"

# install Python 3.10
pyenv install 3.10

# make it available globally
pyenv global system 3.10
```

</details>

# Installation

The following recipe walks through the steps to install and configure a DNP3 agent. Note that it uses default setup to
work out-of-the-box. Please feel free to refer to related documentations for details.

1. Create and activate a virtual environment.

   It is recommended to use a virtual environment for installing volttron.

    ```shell
    python -m venv env
    source env/bin/activate
    
    pip install volttron
    ```

1. Install volttron and start the platform.

   > **Note**:
   > According to the [volttron-core#README](https://github.com/eclipse-volttron/volttron-core#readme), setup VOLTTRON_HOME
   > environment variable is mandatory:
   > ... if you have/had in the past, a monolithic VOLTTRON version that used the default VOLTTRON_HOME
   > $HOME/.volttron. This modular version of VOLTTRON cannot work with volttron_home used by monolithic version of
   > VOLTTRON(version 8.3 or earlier)

    ```shell
    # Setup environment variable `VOLTTRON_HOME`
    export VOLTTRON_HOME=<path-to-volttron_home-dir>
    
    # Start platform with output going to volttron.log
    volttron -vv -l volttron.log &
    ```

1. Install the "volttron-dnp3-outstation" dependency.

   There are two options to install the DNP3 Driver. You can install this library using the version on PyPi or install
   it from the source code (`git clone` might be required.)
   Note: the `vctl install` command in the following step can handle dependency installation using pypi. However, in
   this demo we demonstrate what is happening under the neath the hood by separating the dependency installation and agent registry
   steps.

    ```shell
    # option 1: install from pypi
    pip install volttron-dnp3-outstation
    
    # option 2: install from the source code (Note: `-e` option to use editable mode, useful for development.)
    pip install [-e] <path-to-the-source-code-root>/volttron-dnp3-outstation/
    ```

1. Install and start the "volttron-dnp3-outstation" agent.

   Prepare the default config files:

    ```shell
    # Create config file place holders
    mkdir config
    touch config/dnp3-outstation-config.json
    ```

   Edit the `dnp3-outstation-config.json` as follows:
    ```json
    {
     "outstation_ip": "0.0.0.0",
     "master_id": 2,
     "outstation_id": 1,
     "port":  21000
    }
    ```

   Use `vctl install` command to register to the volttron home path.
   Note: for demo purposes and reproducibility, we assign vip-identity as "dnp3_outstation", but you can choose
   any other valid agent identity as desired.

    ```shell
    vctl install volttron-dnp3-outstation --agent-config <path-to-agent-config> \
   --vip-identity dnp3_outstation \
   --start
    ```

   (Optional) Use `vctl stauts` to verify the installation
   ```shell
   (env) kefei@ubuntu-22:~/sandbox/dnp3-outstation-sandbox$ vctl status
   UUID   AGENT                             IDENTITY        TAG PRIORITY STATUS          HEALTH
   e      volttron-dnp3-outstation-0.0.1rc0 dnp3_outstation              running [3408]  GOOD
   ```

# Basic Usage Example

Like other VOLTTRON agent, the volttron-dnp3-outstation agent provides public interface and can be evoked by VOLTTRON
RPC calls. The volttron-dnp3-outstation provided a commandline interface `vdnp3_outstation` as an RPC method wrapper.
Please see [run_volttron_dnp3_outstation_cli.py](./src/vdnp3_outstation/run_volttron_dnp3_outstation_cli.py) for
implementation details of the RPC examples.

1. (Optional) Inspect the dnp3 outstation cli help menu.

   ```shell
   (env) kefei@ubuntu-22:~/sandbox/dnp3-driver-sandbox$ python -m vdnp3_outstation.run_volttron_dnp3_outstation_cli -h
   usage: dnp3-outstation [-h] [-aid <peer-name>]
   
   Run a dnp3 outstation agent. Specify agent identity, by default `dnp3_outstation`
   
   options:
     -h, --help            show this help message and exit
     -aid <peer-name>, --agent-identity <peer-name>
                           specify agent identity (parsed as peer-name for rpc call), default 'dnp3_outstation'.

   ```

1. Start the dnp3 outstation cli

   Start the volttron-dnp3-outstation cli. If you
   follow along this demo, the agent vip-identity should be "dnp3_outstation".

   ```shell
   (env) kefei@ubuntu-22:~/sandbox/dnp3-agent-sandbox$ python -m vdnp3_outstation.run_volttron_dnp3_outstation_cli --agent-identity dnp3_outstation
   2023-03-23 11:51:25,975 root DEBUG: Creating ZMQ Core None
   2023-03-23 11:51:25,975 volttron.client.vip.agent.core DEBUG: address: ipc://@/home/kefei/.volttron/run/vip.socket
   2023-03-23 11:51:25,975 volttron.client.vip.agent.core DEBUG: identity: 08953498-18e6-4070-9576-521bad3e82be
   2023-03-23 11:51:25,975 volttron.client.vip.agent.core DEBUG: agent_uuid: None
   2023-03-23 11:51:25,975 volttron.client.vip.agent.core DEBUG: serverkey: None
   2023-03-23 11:51:25,976 volttron.client.vip.agent.core DEBUG:  environ keys: dict_keys(['SHELL', 'SESSION_MANAGER', 'QT_ACCESSIBILITY', 'COLORTERM', 'XDG_CONFIG_DIRS', 'SSH_AGENT_LAUNCHER', 'XDG_MENU_PREFIX', 'GNOME_DESKTOP_SESSION_ID', 'CONDA_EXE', '_CE_M', 'GNOME_SHELL_SESSION_MODE', 'SSH_AUTH_SOCK', 'HOMEBREW_PREFIX', 'XMODIFIERS', 'DESKTOP_SESSION', 'GTK_MODULES', 'PWD', 'LOGNAME', 'XDG_SESSION_DESKTOP', 'XDG_SESSION_TYPE', 'MANPATH', 'SYSTEMD_EXEC_PID', 'XAUTHORITY', 'VOLTTRON_HOME', 'HOME', 'USERNAME', 'IM_CONFIG_PHASE', 'LANG', 'LS_COLORS', 'XDG_CURRENT_DESKTOP', 'VIRTUAL_ENV', 'VTE_VERSION', 'WAYLAND_DISPLAY', 'GNOME_TERMINAL_SCREEN', 'INFOPATH', 'GNOME_SETUP_DISPLAY', 'LESSCLOSE', 'XDG_SESSION_CLASS', 'TERM', '_CE_CONDA', 'LESSOPEN', 'USER', 'HOMEBREW_CELLAR', 'GNOME_TERMINAL_SERVICE', 'CONDA_SHLVL', 'DISPLAY', 'SHLVL', 'QT_IM_MODULE', 'HOMEBREW_REPOSITORY', 'VIRTUAL_ENV_PROMPT', 'CONDA_PYTHON_EXE', 'XDG_RUNTIME_DIR', 'PS1', 'XDG_DATA_DIRS', 'PATH', 'GDMSESSION', 'DBUS_SESSION_BUS_ADDRESS', '_', 'RABBITMQ_NOT_AVAILABLE'])
   2023-03-23 11:51:25,976 volttron.client.vip.agent.core DEBUG: server key from env None
   2023-03-23 11:51:25,976 volttron.client.vip.agent.core DEBUG: AGENT RUNNING on ZMQ Core 08953498-18e6-4070-9576-521bad3e82be
   2023-03-23 11:51:25,976 volttron.client.vip.agent.core DEBUG: keys: server: _M0Ds3SfjECMrmXulHQZtPIlsYW7JwzXMXJH1Koy2T4 public: _M0Ds3SfjECMrmXulHQZtPIlsYW7JwzXMXJH1Koy2T4, secret: yfjc9g5znWMEjTSX3kfINGwhCvaDI80fK8vN76-C7SQ
   2023-03-23 11:51:25,977 volttron.client.vip.zmq_connection DEBUG: ZMQ connection 08953498-18e6-4070-9576-521bad3e82be
   2023-03-23 11:51:25,977 volttron.client.vip.zmq_connection DEBUG: connecting to url ipc://@/home/kefei/.volttron/run/vip.socket?publickey=_M0Ds3SfjECMrmXulHQZtPIlsYW7JwzXMXJH1Koy2T4&secretkey=yfjc9g5znWMEjTSX3kfINGwhCvaDI80fK8vN76-C7SQ&serverkey=_M0Ds3SfjECMrmXulHQZtPIlsYW7JwzXMXJH1Koy2T4
   2023-03-23 11:51:25,977 volttron.client.vip.zmq_connection DEBUG: url type is <class 'str'>
   2023-03-23 11:51:25,981 volttron.client.vip.agent.core INFO: Connected to platform: identity: 08953498-18e6-4070-9576-521bad3e82be version: 1.0
   2023-03-23 11:51:25,981 volttron.client.vip.agent.core DEBUG: Running onstart methods.
    
   ========================= MENU ==================================
   <ai> - set analog-input point value
   <ao> - set analog-output point value
   <bi> - set binary-input point value
   <bo> - set binary-output point value
    
   <dd> - display database
   <di> - display (outstation) info
   <cr> - config then restart outstation
   =================================================================
    
   !!!!!!!!! WARNING: The outstation is NOT connected !!!!!!!!!
   {'outstation_ip_str': '0.0.0.0', 'port': 20000, 'masterstation_id_int': 2, 'outstation_id_int': 1, 'peer': 'dnp3_outstation'}
    
   ======== Your Input Here: ==(DNP3 OutStation Agent)======
 
   ```

1. Start a dnp3 master to establish connection.

   If there is no connection between an outstation and a master, you may see the
   warning `!!!!!!!!! WARNING: The outstation is NOT connected !!!!!!!!!`. To establish such a connection, **open
   another terminal**, and
   run `dnp3demo master`. (More details about the "dnp3demo" module, please
   see [dnp3demo-Module.md](https://github.com/VOLTTRON/dnp3-python/blob/main/docs/dnp3demo-Module.md))

   ```shell
    ===== Master Operation MENU ==================================
    <ao> - set analog-output point value (for remote control)
    <bo> - set binary-output point value (for remote control)
    <dd> - display/polling (outstation) database
    <dc> - display configuration
    =================================================================

    
    ======== Your Input Here: ==(master)======
    ```

   Note: by default, both the volttron-dnp3-outstation and the dnp3demo master uses configurations to
   assure valid connection out-of-the-box. e.g., port=20000. Feel free to configure the connection parameters as
   desired.

1. Basic volttron-dnp3-outstation operations
     ```
   ======== Your Input Here: ==(DNP3 OutStation Agent)======
   ai
   You chose <ai> - set analog-input point value
   Type in <float> and <index>. Separate with space, then hit ENTER. e.g., `1.4321, 1`.
   Type 'q', 'quit', 'exit' to main menu.

    ======== Your Input Here: ==(DNP3 OutStation Agent)======
    0.1212 0
    {'Analog': {0: 0.1212, 1: None, 2: None, 3: None, 4: None, 5: None, 6: None, 7: None, 8: None, 9: None}}
    You chose <ai> - update analog-input point value (for local reading)
    Type in <float> and <index>. Separate with space, then hit ENTER.
    Type 'q', 'quit', 'exit' to main menu.
     
     
    ======== Your Input Here: ==(DNP3 OutStation Agent)======
    1.2323 1
    {'Analog': {0: 0.1212, 1: 1.2323, 2: None, 3: None, 4: None, 5: None, 6: None, 7: None, 8: None, 9: None}}
    You chose <ai> - update analog-input point value (for local reading)
    Type in <float> and <index>. Separate with space, then hit ENTER.
    Type 'q', 'quit', 'exit' to main menu.
   ```
     <details>
     <summary>Example of interaction with the `vdnp3_outstation` module </summary>

     ```shell
     (env) kefei@ubuntu-22:~/sandbox/dnp3-agent-sandbox$ python -m vdnp3_outstation.run_volttron_dnp3_outstation_cli --agent-identity dnp3_outstation
     dnp3demo.run_outstation {'command': 'outstation', 'outstation_ip=': '0.0.0.0', 'port=': 20000, 'master_id=': 2, 'outstation_id=': 1}
     ms(1678770551216) INFO    manager - Starting thread (0)
     2023-03-14 00:09:11,216	control_workflow_demo	INFO	Connection Config
     2023-03-14 00:09:11,216	control_workflow_demo	INFO	Connection Config
     2023-03-14 00:09:11,216	control_workflow_demo	INFO	Connection Config
     ms(1678770551216) INFO    server - Listening on: 0.0.0.0:20000
     2023-03-14 00:09:11,216	control_workflow_demo	DEBUG	Initialization complete. Outstation in command loop.
     2023-03-14 00:09:11,216	control_workflow_demo	DEBUG	Initialization complete. Outstation in command loop.
     2023-03-14 00:09:11,216	control_workflow_demo	DEBUG	Initialization complete. Outstation in command loop.
     Connection error.
     Connection Config {'outstation_ip_str': '0.0.0.0', 'port': 20000, 'masterstation_id_int': 2, 'outstation_id_int': 1}
     Start retry...
     Connection error.
     Connection Config {'outstation_ip_str': '0.0.0.0', 'port': 20000, 'masterstation_id_int': 2, 'outstation_id_int': 1}
     ms(1678770565247) INFO    server - Accepted connection from: 127.0.0.1
     ==== Outstation Operation MENU ==================================
     <ai> - update analog-input point value (for local reading)
     <ao> - update analog-output point value (for local control)
     <bi> - update binary-input point value (for local reading)
     <bo> - update binary-output point value (for local control)
     <dd> - display database
     <dc> - display configuration
     =================================================================
      
      
     ======== Your Input Here: ==(DNP3 OutStation Agent)======
     ai
     You chose <ai> - update analog-input point value (for local reading)
     Type in <float> and <index>. Separate with space, then hit ENTER.
     Type 'q', 'quit', 'exit' to main menu.
      
      
     ======== Your Input Here: ==(DNP3 OutStation Agent)======
     0.1212 0
     {'Analog': {0: 0.1212, 1: None, 2: None, 3: None, 4: None, 5: None, 6: None, 7: None, 8: None, 9: None}}
     You chose <ai> - update analog-input point value (for local reading)
     Type in <float> and <index>. Separate with space, then hit ENTER.
     Type 'q', 'quit', 'exit' to main menu.
      
      
     ======== Your Input Here: ==(DNP3 OutStation Agent)======
     1.2323 1
     {'Analog': {0: 0.1212, 1: 1.2323, 2: None, 3: None, 4: None, 5: None, 6: None, 7: None, 8: None, 9: None}}
     You chose <ai> - update analog-input point value (for local reading)
     Type in <float> and <index>. Separate with space, then hit ENTER.
     Type 'q', 'quit', 'exit' to main menu.
      
      
     ======== Your Input Here: ==(DNP3 OutStation Agent)======
     ```
     </details>

# Development

Please see the following for contributing
guidelines [contributing](https://github.com/eclipse-volttron/volttron-core/blob/develop/CONTRIBUTING.md).

Please see the following helpful guide
about [developing modular VOLTTRON agents](https://github.com/eclipse-volttron/volttron-core/blob/develop/DEVELOPING_ON_MODULAR.md)

# Disclaimer Notice

This material was prepared as an account of work sponsored by an agency of the
United States Government. Neither the United States Government nor the United
States Department of Energy, nor Battelle, nor any of their employees, nor any
jurisdiction or organization that has cooperated in the development of these
materials, makes any warranty, express or implied, or assumes any legal
liability or responsibility for the accuracy, completeness, or usefulness or any
information, apparatus, product, software, or process disclosed, or represents
that its use would not infringe privately owned rights.

Reference herein to any specific commercial product, process, or service by
trade name, trademark, manufacturer, or otherwise does not necessarily
constitute or imply its endorsement, recommendation, or favoring by the United
States Government or any agency thereof, or Battelle Memorial Institute. The
views and opinions of authors expressed herein do not necessarily state or
reflect those of the United States Government or any agency thereof.

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/eclipse-volttron/volttron-dnp3-outstation",
    "name": "volttron-dnp3-outstation",
    "maintainer": "Volttron Team",
    "docs_url": null,
    "requires_python": ">=3.8,<4.0",
    "maintainer_email": "volttron@pnnl.gov",
    "keywords": "volttron,agent,dnp3,outstation,application",
    "author": "Kefei Mo",
    "author_email": "kefei.mo@pnnl.gov",
    "download_url": "https://files.pythonhosted.org/packages/67/d0/f0a39e1784f8075d3669139b6e6f99e79c8de682052a8da166a6b0b532df/volttron_dnp3_outstation-0.1.2rc1.tar.gz",
    "platform": null,
    "description": "# volttron-dnp3-outstation\n\n[![Eclipse VOLTTRON\u2122](https://img.shields.io/badge/Eclips%20VOLTTRON--red.svg)](https://volttron.readthedocs.io/en/latest/)\n![Python 3.10](https://img.shields.io/badge/python-3.10-blue.svg)\n![Python 3.11](https://img.shields.io/badge/python-3.11-blue.svg)\n[![Pytests](https://github.com/eclipse-volttron/volttron-dnp3-outstation/actions/workflows/run-tests.yml/badge.svg)](https://github.com/eclipse-volttron/volttron-dnp3-outstation/actions/workflows/run-tests.yml)\n[![pypi version](https://img.shields.io/pypi/v/volttron-dnp3-outstation.svg)](https://pypi.org/project/volttron-dnp3-outstation/)\n\nDistributed Network Protocol (DNP\nor [DNP3](https://en.wikipedia.org/wiki/DNP3))\nhas achieved a large-scale acceptance since its introduction in 1993. This\nprotocol is an immediately deployable solution for monitoring remote sites because it was developed for communication of\ncritical infrastructure status, allowing for reliable remote control.\n\nDNP3 is typically used between centrally located masters and distributed remotes.\nApplication layer fragments from Master DNP3 stations are typically requests for operations on data\nobjects, and application layer fragments from Slave DNP3 stations (i.e., Outstation) are typically responses to those\nrequests. A DNP3 Outstation may also transmit a message without a request (an unsolicited response).\nThe volttron-dnp3-outstation is an implementation of the DNP3 master following\nthe [VOLTTRON Agent Specifications](https://volttron.readthedocs.io/en/main/developing-volttron/developing-agents/specifications/index.html?highlight=agent#agent-specifications).\n\nNote: to fully desmonstate the volttron-dnp3-outstation features, including polling data, setting point\nvalues, etc., it is suggested to establish connection between an outstation and a DNP3 master instance.\nThe [dnp3-python](https://github.com/VOLTTRON/dnp3-python) can provide the essential master functionality,\nand as\npart of the volttron-dnp3-outstation dependency, it is immediately available after the volttron-dnp3-outstation is\ninstalled.\n\n# Prerequisites\n\n* Python 3 (tested with Python3.8, Python3.9, Python3.10)\n\n## Python\n\n<details>\n<summary>To install specific Python version (e.g., Python 3.8), we recommend using <a href=\"https://github.com/pyenv/pyenv\"><code>pyenv</code></a>.</summary>\n\n```shell\n# install pyenv\ngit clone https://github.com/pyenv/pyenv ~/.pyenv\n\n# setup pyenv (you should also put these three lines in .bashrc or similar)\nexport PATH=\"${HOME}/.pyenv/bin:${PATH}\"\nexport PYENV_ROOT=\"${HOME}/.pyenv\"\neval \"$(pyenv init -)\"\n\n# install Python 3.10\npyenv install 3.10\n\n# make it available globally\npyenv global system 3.10\n```\n\n</details>\n\n# Installation\n\nThe following recipe walks through the steps to install and configure a DNP3 agent. Note that it uses default setup to\nwork out-of-the-box. Please feel free to refer to related documentations for details.\n\n1. Create and activate a virtual environment.\n\n   It is recommended to use a virtual environment for installing volttron.\n\n    ```shell\n    python -m venv env\n    source env/bin/activate\n    \n    pip install volttron\n    ```\n\n1. Install volttron and start the platform.\n\n   > **Note**:\n   > According to the [volttron-core#README](https://github.com/eclipse-volttron/volttron-core#readme), setup VOLTTRON_HOME\n   > environment variable is mandatory:\n   > ... if you have/had in the past, a monolithic VOLTTRON version that used the default VOLTTRON_HOME\n   > $HOME/.volttron. This modular version of VOLTTRON cannot work with volttron_home used by monolithic version of\n   > VOLTTRON(version 8.3 or earlier)\n\n    ```shell\n    # Setup environment variable `VOLTTRON_HOME`\n    export VOLTTRON_HOME=<path-to-volttron_home-dir>\n    \n    # Start platform with output going to volttron.log\n    volttron -vv -l volttron.log &\n    ```\n\n1. Install the \"volttron-dnp3-outstation\" dependency.\n\n   There are two options to install the DNP3 Driver. You can install this library using the version on PyPi or install\n   it from the source code (`git clone` might be required.)\n   Note: the `vctl install` command in the following step can handle dependency installation using pypi. However, in\n   this demo we demonstrate what is happening under the neath the hood by separating the dependency installation and agent registry\n   steps.\n\n    ```shell\n    # option 1: install from pypi\n    pip install volttron-dnp3-outstation\n    \n    # option 2: install from the source code (Note: `-e` option to use editable mode, useful for development.)\n    pip install [-e] <path-to-the-source-code-root>/volttron-dnp3-outstation/\n    ```\n\n1. Install and start the \"volttron-dnp3-outstation\" agent.\n\n   Prepare the default config files:\n\n    ```shell\n    # Create config file place holders\n    mkdir config\n    touch config/dnp3-outstation-config.json\n    ```\n\n   Edit the `dnp3-outstation-config.json` as follows:\n    ```json\n    {\n     \"outstation_ip\": \"0.0.0.0\",\n     \"master_id\": 2,\n     \"outstation_id\": 1,\n     \"port\":  21000\n    }\n    ```\n\n   Use `vctl install` command to register to the volttron home path.\n   Note: for demo purposes and reproducibility, we assign vip-identity as \"dnp3_outstation\", but you can choose\n   any other valid agent identity as desired.\n\n    ```shell\n    vctl install volttron-dnp3-outstation --agent-config <path-to-agent-config> \\\n   --vip-identity dnp3_outstation \\\n   --start\n    ```\n\n   (Optional) Use `vctl stauts` to verify the installation\n   ```shell\n   (env) kefei@ubuntu-22:~/sandbox/dnp3-outstation-sandbox$ vctl status\n   UUID   AGENT                             IDENTITY        TAG PRIORITY STATUS          HEALTH\n   e      volttron-dnp3-outstation-0.0.1rc0 dnp3_outstation              running [3408]  GOOD\n   ```\n\n# Basic Usage Example\n\nLike other VOLTTRON agent, the volttron-dnp3-outstation agent provides public interface and can be evoked by VOLTTRON\nRPC calls. The volttron-dnp3-outstation provided a commandline interface `vdnp3_outstation` as an RPC method wrapper.\nPlease see [run_volttron_dnp3_outstation_cli.py](./src/vdnp3_outstation/run_volttron_dnp3_outstation_cli.py) for\nimplementation details of the RPC examples.\n\n1. (Optional) Inspect the dnp3 outstation cli help menu.\n\n   ```shell\n   (env) kefei@ubuntu-22:~/sandbox/dnp3-driver-sandbox$ python -m vdnp3_outstation.run_volttron_dnp3_outstation_cli -h\n   usage: dnp3-outstation [-h] [-aid <peer-name>]\n   \n   Run a dnp3 outstation agent. Specify agent identity, by default `dnp3_outstation`\n   \n   options:\n     -h, --help            show this help message and exit\n     -aid <peer-name>, --agent-identity <peer-name>\n                           specify agent identity (parsed as peer-name for rpc call), default 'dnp3_outstation'.\n\n   ```\n\n1. Start the dnp3 outstation cli\n\n   Start the volttron-dnp3-outstation cli. If you\n   follow along this demo, the agent vip-identity should be \"dnp3_outstation\".\n\n   ```shell\n   (env) kefei@ubuntu-22:~/sandbox/dnp3-agent-sandbox$ python -m vdnp3_outstation.run_volttron_dnp3_outstation_cli --agent-identity dnp3_outstation\n   2023-03-23 11:51:25,975 root DEBUG: Creating ZMQ Core None\n   2023-03-23 11:51:25,975 volttron.client.vip.agent.core DEBUG: address: ipc://@/home/kefei/.volttron/run/vip.socket\n   2023-03-23 11:51:25,975 volttron.client.vip.agent.core DEBUG: identity: 08953498-18e6-4070-9576-521bad3e82be\n   2023-03-23 11:51:25,975 volttron.client.vip.agent.core DEBUG: agent_uuid: None\n   2023-03-23 11:51:25,975 volttron.client.vip.agent.core DEBUG: serverkey: None\n   2023-03-23 11:51:25,976 volttron.client.vip.agent.core DEBUG:  environ keys: dict_keys(['SHELL', 'SESSION_MANAGER', 'QT_ACCESSIBILITY', 'COLORTERM', 'XDG_CONFIG_DIRS', 'SSH_AGENT_LAUNCHER', 'XDG_MENU_PREFIX', 'GNOME_DESKTOP_SESSION_ID', 'CONDA_EXE', '_CE_M', 'GNOME_SHELL_SESSION_MODE', 'SSH_AUTH_SOCK', 'HOMEBREW_PREFIX', 'XMODIFIERS', 'DESKTOP_SESSION', 'GTK_MODULES', 'PWD', 'LOGNAME', 'XDG_SESSION_DESKTOP', 'XDG_SESSION_TYPE', 'MANPATH', 'SYSTEMD_EXEC_PID', 'XAUTHORITY', 'VOLTTRON_HOME', 'HOME', 'USERNAME', 'IM_CONFIG_PHASE', 'LANG', 'LS_COLORS', 'XDG_CURRENT_DESKTOP', 'VIRTUAL_ENV', 'VTE_VERSION', 'WAYLAND_DISPLAY', 'GNOME_TERMINAL_SCREEN', 'INFOPATH', 'GNOME_SETUP_DISPLAY', 'LESSCLOSE', 'XDG_SESSION_CLASS', 'TERM', '_CE_CONDA', 'LESSOPEN', 'USER', 'HOMEBREW_CELLAR', 'GNOME_TERMINAL_SERVICE', 'CONDA_SHLVL', 'DISPLAY', 'SHLVL', 'QT_IM_MODULE', 'HOMEBREW_REPOSITORY', 'VIRTUAL_ENV_PROMPT', 'CONDA_PYTHON_EXE', 'XDG_RUNTIME_DIR', 'PS1', 'XDG_DATA_DIRS', 'PATH', 'GDMSESSION', 'DBUS_SESSION_BUS_ADDRESS', '_', 'RABBITMQ_NOT_AVAILABLE'])\n   2023-03-23 11:51:25,976 volttron.client.vip.agent.core DEBUG: server key from env None\n   2023-03-23 11:51:25,976 volttron.client.vip.agent.core DEBUG: AGENT RUNNING on ZMQ Core 08953498-18e6-4070-9576-521bad3e82be\n   2023-03-23 11:51:25,976 volttron.client.vip.agent.core DEBUG: keys: server: _M0Ds3SfjECMrmXulHQZtPIlsYW7JwzXMXJH1Koy2T4 public: _M0Ds3SfjECMrmXulHQZtPIlsYW7JwzXMXJH1Koy2T4, secret: yfjc9g5znWMEjTSX3kfINGwhCvaDI80fK8vN76-C7SQ\n   2023-03-23 11:51:25,977 volttron.client.vip.zmq_connection DEBUG: ZMQ connection 08953498-18e6-4070-9576-521bad3e82be\n   2023-03-23 11:51:25,977 volttron.client.vip.zmq_connection DEBUG: connecting to url ipc://@/home/kefei/.volttron/run/vip.socket?publickey=_M0Ds3SfjECMrmXulHQZtPIlsYW7JwzXMXJH1Koy2T4&secretkey=yfjc9g5znWMEjTSX3kfINGwhCvaDI80fK8vN76-C7SQ&serverkey=_M0Ds3SfjECMrmXulHQZtPIlsYW7JwzXMXJH1Koy2T4\n   2023-03-23 11:51:25,977 volttron.client.vip.zmq_connection DEBUG: url type is <class 'str'>\n   2023-03-23 11:51:25,981 volttron.client.vip.agent.core INFO: Connected to platform: identity: 08953498-18e6-4070-9576-521bad3e82be version: 1.0\n   2023-03-23 11:51:25,981 volttron.client.vip.agent.core DEBUG: Running onstart methods.\n    \n   ========================= MENU ==================================\n   <ai> - set analog-input point value\n   <ao> - set analog-output point value\n   <bi> - set binary-input point value\n   <bo> - set binary-output point value\n    \n   <dd> - display database\n   <di> - display (outstation) info\n   <cr> - config then restart outstation\n   =================================================================\n    \n   !!!!!!!!! WARNING: The outstation is NOT connected !!!!!!!!!\n   {'outstation_ip_str': '0.0.0.0', 'port': 20000, 'masterstation_id_int': 2, 'outstation_id_int': 1, 'peer': 'dnp3_outstation'}\n    \n   ======== Your Input Here: ==(DNP3 OutStation Agent)======\n \n   ```\n\n1. Start a dnp3 master to establish connection.\n\n   If there is no connection between an outstation and a master, you may see the\n   warning `!!!!!!!!! WARNING: The outstation is NOT connected !!!!!!!!!`. To establish such a connection, **open\n   another terminal**, and\n   run `dnp3demo master`. (More details about the \"dnp3demo\" module, please\n   see [dnp3demo-Module.md](https://github.com/VOLTTRON/dnp3-python/blob/main/docs/dnp3demo-Module.md))\n\n   ```shell\n    ===== Master Operation MENU ==================================\n    <ao> - set analog-output point value (for remote control)\n    <bo> - set binary-output point value (for remote control)\n    <dd> - display/polling (outstation) database\n    <dc> - display configuration\n    =================================================================\n\n    \n    ======== Your Input Here: ==(master)======\n    ```\n\n   Note: by default, both the volttron-dnp3-outstation and the dnp3demo master uses configurations to\n   assure valid connection out-of-the-box. e.g., port=20000. Feel free to configure the connection parameters as\n   desired.\n\n1. Basic volttron-dnp3-outstation operations\n     ```\n   ======== Your Input Here: ==(DNP3 OutStation Agent)======\n   ai\n   You chose <ai> - set analog-input point value\n   Type in <float> and <index>. Separate with space, then hit ENTER. e.g., `1.4321, 1`.\n   Type 'q', 'quit', 'exit' to main menu.\n\n    ======== Your Input Here: ==(DNP3 OutStation Agent)======\n    0.1212 0\n    {'Analog': {0: 0.1212, 1: None, 2: None, 3: None, 4: None, 5: None, 6: None, 7: None, 8: None, 9: None}}\n    You chose <ai> - update analog-input point value (for local reading)\n    Type in <float> and <index>. Separate with space, then hit ENTER.\n    Type 'q', 'quit', 'exit' to main menu.\n     \n     \n    ======== Your Input Here: ==(DNP3 OutStation Agent)======\n    1.2323 1\n    {'Analog': {0: 0.1212, 1: 1.2323, 2: None, 3: None, 4: None, 5: None, 6: None, 7: None, 8: None, 9: None}}\n    You chose <ai> - update analog-input point value (for local reading)\n    Type in <float> and <index>. Separate with space, then hit ENTER.\n    Type 'q', 'quit', 'exit' to main menu.\n   ```\n     <details>\n     <summary>Example of interaction with the `vdnp3_outstation` module </summary>\n\n     ```shell\n     (env) kefei@ubuntu-22:~/sandbox/dnp3-agent-sandbox$ python -m vdnp3_outstation.run_volttron_dnp3_outstation_cli --agent-identity dnp3_outstation\n     dnp3demo.run_outstation {'command': 'outstation', 'outstation_ip=': '0.0.0.0', 'port=': 20000, 'master_id=': 2, 'outstation_id=': 1}\n     ms(1678770551216) INFO    manager - Starting thread (0)\n     2023-03-14 00:09:11,216\tcontrol_workflow_demo\tINFO\tConnection Config\n     2023-03-14 00:09:11,216\tcontrol_workflow_demo\tINFO\tConnection Config\n     2023-03-14 00:09:11,216\tcontrol_workflow_demo\tINFO\tConnection Config\n     ms(1678770551216) INFO    server - Listening on: 0.0.0.0:20000\n     2023-03-14 00:09:11,216\tcontrol_workflow_demo\tDEBUG\tInitialization complete. Outstation in command loop.\n     2023-03-14 00:09:11,216\tcontrol_workflow_demo\tDEBUG\tInitialization complete. Outstation in command loop.\n     2023-03-14 00:09:11,216\tcontrol_workflow_demo\tDEBUG\tInitialization complete. Outstation in command loop.\n     Connection error.\n     Connection Config {'outstation_ip_str': '0.0.0.0', 'port': 20000, 'masterstation_id_int': 2, 'outstation_id_int': 1}\n     Start retry...\n     Connection error.\n     Connection Config {'outstation_ip_str': '0.0.0.0', 'port': 20000, 'masterstation_id_int': 2, 'outstation_id_int': 1}\n     ms(1678770565247) INFO    server - Accepted connection from: 127.0.0.1\n     ==== Outstation Operation MENU ==================================\n     <ai> - update analog-input point value (for local reading)\n     <ao> - update analog-output point value (for local control)\n     <bi> - update binary-input point value (for local reading)\n     <bo> - update binary-output point value (for local control)\n     <dd> - display database\n     <dc> - display configuration\n     =================================================================\n      \n      \n     ======== Your Input Here: ==(DNP3 OutStation Agent)======\n     ai\n     You chose <ai> - update analog-input point value (for local reading)\n     Type in <float> and <index>. Separate with space, then hit ENTER.\n     Type 'q', 'quit', 'exit' to main menu.\n      \n      \n     ======== Your Input Here: ==(DNP3 OutStation Agent)======\n     0.1212 0\n     {'Analog': {0: 0.1212, 1: None, 2: None, 3: None, 4: None, 5: None, 6: None, 7: None, 8: None, 9: None}}\n     You chose <ai> - update analog-input point value (for local reading)\n     Type in <float> and <index>. Separate with space, then hit ENTER.\n     Type 'q', 'quit', 'exit' to main menu.\n      \n      \n     ======== Your Input Here: ==(DNP3 OutStation Agent)======\n     1.2323 1\n     {'Analog': {0: 0.1212, 1: 1.2323, 2: None, 3: None, 4: None, 5: None, 6: None, 7: None, 8: None, 9: None}}\n     You chose <ai> - update analog-input point value (for local reading)\n     Type in <float> and <index>. Separate with space, then hit ENTER.\n     Type 'q', 'quit', 'exit' to main menu.\n      \n      \n     ======== Your Input Here: ==(DNP3 OutStation Agent)======\n     ```\n     </details>\n\n# Development\n\nPlease see the following for contributing\nguidelines [contributing](https://github.com/eclipse-volttron/volttron-core/blob/develop/CONTRIBUTING.md).\n\nPlease see the following helpful guide\nabout [developing modular VOLTTRON agents](https://github.com/eclipse-volttron/volttron-core/blob/develop/DEVELOPING_ON_MODULAR.md)\n\n# Disclaimer Notice\n\nThis material was prepared as an account of work sponsored by an agency of the\nUnited States Government. Neither the United States Government nor the United\nStates Department of Energy, nor Battelle, nor any of their employees, nor any\njurisdiction or organization that has cooperated in the development of these\nmaterials, makes any warranty, express or implied, or assumes any legal\nliability or responsibility for the accuracy, completeness, or usefulness or any\ninformation, apparatus, product, software, or process disclosed, or represents\nthat its use would not infringe privately owned rights.\n\nReference herein to any specific commercial product, process, or service by\ntrade name, trademark, manufacturer, or otherwise does not necessarily\nconstitute or imply its endorsement, recommendation, or favoring by the United\nStates Government or any agency thereof, or Battelle Memorial Institute. The\nviews and opinions of authors expressed herein do not necessarily state or\nreflect those of the United States Government or any agency thereof.\n",
    "bugtrack_url": null,
    "license": "Apache-2.0",
    "summary": "A Volttron agent that acts as a dnp3 outstation.",
    "version": "0.1.2rc1",
    "project_urls": {
        "Bug Tracker": "https://github.com/eclipse-volttron/volttron-dnp3-outstation/issues",
        "Homepage": "https://github.com/eclipse-volttron/volttron-dnp3-outstation",
        "Repository": "https://github.com/eclipse-volttron/volttron-dnp3-outstation"
    },
    "split_keywords": [
        "volttron",
        "agent",
        "dnp3",
        "outstation",
        "application"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "fc93ada889a1a064873aa887bb70f8b995b6604468967e19796af442b4d148f5",
                "md5": "e758cef61914c69c672806e1c675ba8e",
                "sha256": "44c9ca870f11aeeabb21f268564d702a95743b342ea9b0dcce6a3371486b5d24"
            },
            "downloads": -1,
            "filename": "volttron_dnp3_outstation-0.1.2rc1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "e758cef61914c69c672806e1c675ba8e",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8,<4.0",
            "size": 17600,
            "upload_time": "2023-05-12T19:06:32",
            "upload_time_iso_8601": "2023-05-12T19:06:32.792495Z",
            "url": "https://files.pythonhosted.org/packages/fc/93/ada889a1a064873aa887bb70f8b995b6604468967e19796af442b4d148f5/volttron_dnp3_outstation-0.1.2rc1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "67d0f0a39e1784f8075d3669139b6e6f99e79c8de682052a8da166a6b0b532df",
                "md5": "e4e1150d81d005f9b9f273bdace3339f",
                "sha256": "469be6c20893b73a2d85d168b803690cf5cd6f0b14541316c05e9b38cb86f5fe"
            },
            "downloads": -1,
            "filename": "volttron_dnp3_outstation-0.1.2rc1.tar.gz",
            "has_sig": false,
            "md5_digest": "e4e1150d81d005f9b9f273bdace3339f",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8,<4.0",
            "size": 21886,
            "upload_time": "2023-05-12T19:06:34",
            "upload_time_iso_8601": "2023-05-12T19:06:34.396832Z",
            "url": "https://files.pythonhosted.org/packages/67/d0/f0a39e1784f8075d3669139b6e6f99e79c8de682052a8da166a6b0b532df/volttron_dnp3_outstation-0.1.2rc1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-05-12 19:06:34",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "eclipse-volttron",
    "github_project": "volttron-dnp3-outstation",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "volttron-dnp3-outstation"
}
        
Elapsed time: 0.06553s