diff --git a/deprecated/OldDnp3/OldDnp3Driver/PlatformDriverAgent/tests/test_dnp3_driver.py b/deprecated/OldDnp3/OldDnp3Driver/PlatformDriverAgent/tests/test_dnp3_driver.py deleted file mode 100644 index 44fc8d0b06..0000000000 --- a/deprecated/OldDnp3/OldDnp3Driver/PlatformDriverAgent/tests/test_dnp3_driver.py +++ /dev/null @@ -1,129 +0,0 @@ -import pytest -import gevent -import logging - -try: - import pydnp3 -except ModuleNotFoundError: - pytest.skip( - "DNP3 driver is currently not supported and not tested. " - "If you still want to run this test, install the import with: pip install pydnp3", - allow_module_level=True - ) - -from services.core.DNP3Agent.dnp3 import DATA_TYPE_ANALOG_INPUT -from volttron.platform.agent.known_identities import PLATFORM_DRIVER -from volttron.platform import get_services_core -from volttron.platform.agent import utils - -utils.setup_logging() -logger = logging.getLogger(__name__) - -DNP3_AGENT_ID = 'dnp3agent' - -DRIVER_CONFIG_STRING = """{ - "driver_config": { - "dnp3_agent_id": "dnp3agent" - }, - "campus": "campus", - "building": "building", - "unit": "dnp3", - "driver_type": "dnp3", - "registry_config": "config://dnp3.csv", - "interval": 15, - "timezone": "US/Pacific", - "heart_beat_point": "Heartbeat" -}""" - -REGISTRY_CONFIG_STRING = """Volttron Point Name,DNP3 Point Name,Data Type,Scaling,Units,Writable -Test1,DCHD.WinTms,int,1.0,,TRUE -Test2,DCHD.RmpTms,int,1.0,,TRUE""" - -DNP3_AGENT_CONFIG = { - "points": [ - { - "name": "DCHD.WinTms", - "group": 30, - "variation": 1, - "index": 1, - "data_type": DATA_TYPE_ANALOG_INPUT, - }, - { - "name": "DCHD.RmpTms", - "group": 30, - "variation": 1, - "index": 2, - "data_type": DATA_TYPE_ANALOG_INPUT, - } - ], - "point_topic": "dnp3/point", - "outstation_status_topic": "dnp3/outstation_status", - "outstation_config": { - "database_sizes": 10000, - "log_levels": ["NORMAL"] - }, - "local_ip": "0.0.0.0", - "port": 20000 -} - -# Test values for set_point and get_point RPC calls -REGISTER_VALUES = { - 'Test1': 10, - 'Test2': 10, -} - - -@pytest.fixture(scope="module") -def agent(request, volttron_instance): - """Build PlatformDriverAgent and add DNP3 driver config to it.""" - - test_agent = volttron_instance.build_agent() - - def update_config(agent_id, name, value, cfg_type): - test_agent.vip.rpc.call('config.store', 'set_config', agent_id, name, value, config_type=cfg_type) - - capabilities = {'edit_config_store': {'identity': PLATFORM_DRIVER}} - volttron_instance.add_capabilities(test_agent.core.publickey, capabilities) - - gevent.sleep(1) - - # Build and start DNP3Agent - dnp3_agent_uuid = volttron_instance.install_agent(agent_dir=get_services_core("DNP3Agent"), - config_file=DNP3_AGENT_CONFIG, - vip_identity=DNP3_AGENT_ID, - start=True) - - # Build and start PlatformDriverAgent - - test_agent.vip.rpc.call('config.store', 'delete_store', PLATFORM_DRIVER) - - platform_uuid = volttron_instance.install_agent(agent_dir=get_services_core("PlatformDriverAgent"), - config_file={}, - start=True) - - update_config(PLATFORM_DRIVER, 'devices/dnp3', DRIVER_CONFIG_STRING, 'json') - update_config(PLATFORM_DRIVER, 'dnp3.csv', REGISTRY_CONFIG_STRING, 'csv') - - # Wait for the agent to start and start the devices - gevent.sleep(3) - - def stop(): - volttron_instance.stop_agent(platform_uuid) - volttron_instance.stop_agent(dnp3_agent_uuid) - test_agent.core.stop() - - request.addfinalizer(stop) - return test_agent - - -class TestDNP3Driver: - """Regression tests for the DNP3 driver interface.""" - - def test_set_and_get(self, agent): - for key, val in REGISTER_VALUES.items(): - self.issue_dnp3_rpc(agent, 'set_point', key, val) - assert self.issue_dnp3_rpc(agent, 'get_point', key) == val - - @staticmethod - def issue_dnp3_rpc(agent, rpc_call, *args): - return agent.vip.rpc.call('platform.driver', rpc_call, 'dnp3', *args).get(timeout=10) diff --git a/deprecated/OldDnp3/OldDnp3Driver/dnp3-driver.rst b/deprecated/OldDnp3/OldDnp3Driver/dnp3-driver.rst deleted file mode 100644 index d35c51e056..0000000000 --- a/deprecated/OldDnp3/OldDnp3Driver/dnp3-driver.rst +++ /dev/null @@ -1,89 +0,0 @@ -.. _DNP3-Driver: - -=========== -DNP3 Driver -=========== - -VOLTTRON's DNP3 driver enables the use of `DNP3 `_ (Distributed Network Protocol) -communications, reading and writing points via a DNP3 Outstation. - -In order to use a DNP3 driver to read and write point data, VOLTTRON's DNP3 Agent must also -be configured and running. All communication between the VOLTTRON Outstation and a -DNP3 Master happens through the DNP3 Agent. - -For information about the DNP3 Agent, please see the :ref:`DNP3 Platform Specification `. - - -Requirements -============ - -The DNP3 driver requires the PyDNP3 package. This package can be installed in an activated environment with: - -.. code-block:: bash - - pip install pydnp3 - - -Driver Configuration -==================== - -There is one argument for the "driver_config" section of the DNP3 driver configuration file: - - - **dnp3_agent_id** - ID of VOLTTRON's DNP3Agent. - -Here is a sample DNP3 driver configuration file: - -.. code-block:: json - - { - "driver_config": { - "dnp3_agent_id": "dnp3agent" - }, - "campus": "campus", - "building": "building", - "unit": "dnp3", - "driver_type": "dnp3", - "registry_config": "config://dnp3.csv", - "interval": 15, - "timezone": "US/Pacific", - "heart_beat_point": "Heartbeat" - } - -A sample DNP3 driver configuration file can be found in the VOLTTRON repository -in ``services/core/PlatformDriverAgent/example_configurations/test_dnp3.config``. - - -DNP3 Registry Configuration File -================================ - -The driver's registry configuration file, a `CSV `_ file, -specifies which DNP3 points the driver will read and/or write. Each row configures a single DNP3 point. - -The following columns are required for each row: - - - **Volttron Point Name** - The name used by the VOLTTRON platform and agents to refer to the point. - - **Group** - The point's DNP3 group number. - - **Index** - The point's index number within its DNP3 data type (which is derived from its DNP3 group number). - - **Scaling** - A factor by which to multiply point values. - - **Units** - Point value units. - - **Writable** - TRUE or FALSE, indicating whether the point can be written by the driver (FALSE = read-only). - -Consult the **DNP3 data dictionary** for a point's Group and Index values. Point -definitions in the data dictionary are by agreement between the DNP3 Outstation and Master. -The VOLTTRON DNP3Agent loads the data dictionary of point definitions from the JSON file -at "point_definitions_path" in the DNP3Agent's config file. - -A sample data dictionary is available in ``services/core/DNP3Agent/dnp3/mesa_points.config``. - -Point definitions in the DNP3 driver's registry should look something like this: - -.. csv-table:: DNP3 - :header: Volttron Point Name,Group,Index,Scaling,Units,Writable - - DCHD.WTgt,41,65,1.0,NA,FALSE - DCHD.WTgt-In,30,90,1.0,NA,TRUE - DCHD.WinTms,41,66,1.0,NA,FALSE - DCHD.RmpTms,41,67,1.0,NA,FALSE - -A sample DNP3 driver registry configuration file is available -in ``services/core/PlatformDriverAgent/example_configurations/dnp3.csv``. diff --git a/deprecated/OldDnp3/OldDnp3Driverexamples/configurations/drivers/dnp3.csv b/deprecated/OldDnp3/OldDnp3Driverexamples/configurations/drivers/dnp3.csv deleted file mode 100644 index 571d2e9a8e..0000000000 --- a/deprecated/OldDnp3/OldDnp3Driverexamples/configurations/drivers/dnp3.csv +++ /dev/null @@ -1,13 +0,0 @@ -Volttron Point Name,Group,Index,Scaling,Units,Writable -DCHD.WTgt,41,65,1.0,NA,FALSE -DCHD.WTgt-In,30,90,1.0,NA,TRUE -DCHD.WinTms,41,66,1.0,NA,FALSE -DCHD.RmpTms,41,67,1.0,NA,FALSE -DCHD.RevtTms,41,68,1.0,NA,FALSE -DCHD.RmpUpRte,41,69,1.0,NA,FALSE -DCHD.RmpDnRte,41,70,1.0,NA,FALSE -DCHD.ChaRmpUpRte,41,71,1.0,NA,FALSE -DCHD.ChaRmpDnRte,41,72,1.0,NA,FALSE -DCHD.ModPrty,41,9,1.0,NA,FALSE -DCHD.VArAct,41,10,1.0,NA,FALSE -DCHD.ModEna,12,5,1.0,NA,FALSE diff --git a/deprecated/OldDnp3/OldDnp3Driverexamples/configurations/drivers/test_dnp3.config b/deprecated/OldDnp3/OldDnp3Driverexamples/configurations/drivers/test_dnp3.config deleted file mode 100644 index 7296eae4bc..0000000000 --- a/deprecated/OldDnp3/OldDnp3Driverexamples/configurations/drivers/test_dnp3.config +++ /dev/null @@ -1,13 +0,0 @@ -{ - "driver_config": { - "dnp3_agent_id": "dnp3agent" - }, - "campus": "campus", - "building": "building", - "unit": "dnp3", - "driver_type": "dnp3", - "registry_config": "config://dnp3.csv", - "interval": 15, - "timezone": "US/Pacific", - "heart_beat_point": "Heartbeat" -} \ No newline at end of file diff --git a/deprecated/OldDnp3/OldDnp3Driver/PlatformDriverAgent/platform_driver/interfaces/dnp3.py b/deprecated/PlatformDriverInterfaces/dnp3.py similarity index 100% rename from deprecated/OldDnp3/OldDnp3Driver/PlatformDriverAgent/platform_driver/interfaces/dnp3.py rename to deprecated/PlatformDriverInterfaces/dnp3.py