Skip to content
unknown edited this page Oct 23, 2015 · 11 revisions

Deprecated

Controller Access

There are configuration files you must edit to use keys generated for your lab. Do not check these files into the repository. You should keep them private.

The example smap driver ini file is "driver.ini" in the drivers directory. Please edit this file to reflect your setup. Note, for testing purposes, ReportDeliveryLocation and uuid can be found at sMAP-Test-Instance.

  • ReportDeliveryLocation: requires an admin key from sMAP
  • Metadata/SourceName: The name of the source for your catalyst
  • uuid: A unique identifier (can be any generated by any means)

When configuring a Modbus device be sure to setup the following:

  • ip_address: IP address of the Modbus device.
  • register_config: the csv file use to configure the Modbus device. You should specify the absolute path name of the configuration file. See [Configure Modbus sMAP driver] (ModbusDriver "wikilink")

When configuring a BACnet device be sure to setup the following:

  • target_address: Address of the BACnet device.
  • self_address: IP address of the network interface used to communicate with the device. This is required as the BACnet driver creates a virtual device to do it's communication and it communicates via UDP.
  • register_config: the csv file use to configure the Modbus device. You should specify the absolute path name of the configuration file. See Configure BACnet sMAP driver
[report 0]
#Insert your SMAP key after add
ReportDeliveryLocation = http://<SMAP URL>/backend/add/<INSERT YOUR KEY HERE>

[/]
type = Collection
Metadata/SourceName = <PUT YOUR NAME HERE> Catalyst Data 2
uuid = <PUT YOUR UUID HERE>

[/campus1]
type = Collection
Metadata/Location/Campus = Campus Number 1

[/campus1/building1]
type = Collection
Metadata/Location/Building = Building Number 1

[/campus1/building1/modbus1]
type = volttron.drivers.modbus.Modbus
ip_address = <PUT YOUR CATALYST IP HERE>
Metadata/Instrument/Manufacturer = <PUT INSTRUMENT MANUFACTURER HERE>
Metadata/Instrument/ModelName = <PUT INSTRUMENT MODEL HERE>
#port = <DEVICE PORT if needed, defaults to 502>
#slave_id = <SLAVE ID of modbus device if needed, defaults to 0>
#see volttron/drivers/example.csv
#for an example of a catalyst register config file
register_config = <PUT YOUR REGISTER CONFIG HERE>

[/campus1/building1/bacnet1]
type = volttron.drivers.bacnet.BACnet
target_address = <PUT YOUR BACNET DEVICE ADDRESS HERE>
self_address = <PUT IP OF INTERFACE USED TO COMMUNICATE WITH DEVICE (THIS COMPUTER IP)>
Metadata/Instrument/Manufacturer = <PUT INSTRUMENT MANUFACTURER HERE>
Metadata/Instrument/ModelName = <PUT INSTRUMENT MODEL HERE>
#see volttron/drivers/bacnet_example_config.csv
#for an example of a bacnet register config file
register_config = <PUT YOUR REGISTER CONFIG HERE>

[/campus1/building1/logger]
#Currently this will only write to the file specified.
#Hopefully logging to historian is forthcoming.
type = volttron.drivers.smap_logging.Logger
file = 'test.log'

After configuring the Modbus/BACnet registry file(s) and the sMAP configuration file, the driver can now be launched. The driver can be run as a VOLTTRON agent or by directly calling Twisted. Running the device driver as an agent is the same process as the building and launching the Listener agent or the Weather agent. The following steps describe how to launch the sMAP driver via the TwistdLauncher agent:

  1. Edit the TwistdLauncher configuration file (~/volttron/services/core/TwistdLauncher/twisd.launcher). The file should contain the following entry where <smap.ini> is the name of the sMAP configuration file:

     {
    
     "exec": "~/volttron/env/bin/twistd -n smap  ~/volttron/<smap.ini>"
    
     }
    
  2. From the volttron directory enter the following commands in a terminal window:

    • Activate the project (if it is not currently activated):

      . env/bin/activate

  3. Package the agent:

    volttron-pkg package Agents/TwistdLauncher

  4. Set the configuration file:

    volttron-pkg configure ~/.volttron/packaged/launcheragent-0.1-py2-none-any.whl Agents/TwistdLauncher/twistd.launcher

  5. Install agent into platform (with the platform running):

    volttron-ctl install ~/.volttron/packaged/launcheragent-0.1-py2-none-any.whl

Upon successful completion of this command, the terminal output will inform one on the install directory, the agent uuid (unique identifier for an agent) and the agent name:

Installed ~/.volttron/packaged/launcheragent-0.1-py2-none-any.whl as launcheragent-0.1

To launch the the sMAP driver as a service from a terminal enter the following:

  1. Permanently add AGENT_PUB_ADDR and AGENT_SUB_ADDR (environment variable describing the path to the VOLTTRON message bus where “home/volttron/.volttron” is the path to the project directory). From a terminal in the volttron directory, complete the following steps (step 1 and step 2 are only required the first time the driver is launched):

    • Open the file containing the paths to set environment variables and edit as follows:

      sudo nano /etc/environment

  2. Append the following lines to the file and save:

    AGENT_PUB_ADDR="ipc:///home/volttron/.volttron/run/publish"
    AGENT_SUB_ADDR="ipc:///home/volttron/.volttron/run/subscribe"
    
  3. Activate the project (if it is not currently activated):

    . env/bin/activate

  4. The sMAP driver relies on Twistd, start this now:

    twistd -n smap <path to your smap configuration file>

Data should now be getting scraped from the Catalyst controller, published to the platform, and stored in the sMap historian. If you launch the ListenerAgent, you should see device data being published once a minute.

In order to set points, you must start the ActuatorAgent.

Please see the ExampleControllerAgent for making use of the ActuatorAgent .

Wiki Home

Quick Start Guide

Getting VOLTTRON

VOLTTRON Community

VOLTTRON Core Services

Historians

Drivers

Instance Management

Applications
  • ...
Examples
Developers
HOWTOS

VOLTTRON Versions and Features

Transactional Network Platform Overview

Platform Services

Volttron Restricted

Information Exchange Standards

FAQ

Project Home

Clone this wiki locally