Skip to content
rlutes edited this page Dec 12, 2014 · 14 revisions

The PingPongAgent demonstrates how to use the mobility feature within VOLTTRON. This simple agent moves back and forth between two VOLTTRON platforms. The agent will update a "count" file each time it moves to demonstrate the carrying of data along the agents journey. This agent code is available in the

Agents/PingPongAgent directory of the Volttron platform.

NOTE In order for this agent to be successfully used the platform must have enabled the Volttron Restricted package.

Configuration for the PingPong Agent

The PingPong requires that the VOLTTRON-Restricted module be installed and that the mobility feature has been enabled (creation of keys to verify authorization for communication between platforms). For instructions on enabling the mobility feature, creating security keys, and adding these keys for communication with other authorized platforms please see [Agent Mobility](Agent Mobility) section.

The ping pong agent requires hosts and how often a request to move should be sent. Within the host list add the IP for the two VOLTTRON platforms and how often to move the agent from one platform to the other. The configuration file should appear similar to this example:

Typical file location: ~/volttron/Agents/PingPongAgent/config.json

{
"hosts": ["1xx.x.x.1", "1yy.y.y.1"],
"period": 30
}

##Packaging and launching the PingPongAgent The following steps will show how to sign (VOLTTRON-Restricted agent verification feature) the PingPong Agent and launch the PingPongAgent. From a terminal, in the volttron directory, enter the following commands:

  1. Ensure the platform is active:

    . env/bin/activate

  2. Package the agent:

    volttron-pkg package Agents/PingPongAgent

  3. Sign the agent as creator (resource_contract is a text file containing the hardware and software requirements for the agent, see ):

    volttron-pkg sign --creator --contract resource_contract /tmp/volttron_wheels/pingpongagent-0.1-py2-none-any.whl

  4. Sign the agent as soi:

    volttron-pkg sign --soi /tmp/volttron_wheels/pingpongagent-0.1-py2-none-any.whl

  5. Sign the agent as initiator:

    volttron-pkg sign --initiator --config-file Agents/PingPongAgent/config.json /tmp/volttron_wheels/pingpongagent-0.1-py2-none-any.whl

  6. Set the configuration file:

    volttron-pkg configure /tmp/volttron_wheels/pingpongagent-0.1-py2-none-any.whl Agents/PingPongAgent/config.json

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

    volttron-ctl install /tmp/volttron_wheels/listeneragent-0.1-py2-none-any.whl

  8. Check volttron status to verify agent is ready to start:

    volttron-ctl status

  9. The terminal will have output that looks similar to:

    AGENT                       TAG STATUS
    1f  pingpongagent-0.1
    
  10. Start the agent (1f is the window above is the unique agent identifier. This identifier will only be as long as necessary to ensure uniqueness on the running platform):

    volttron-ctl start 1f

  11. Verify that agent is running:

       tail volttron.log```
    
    

In the run directory (VOLTTRON_HOME/run) one will see the incremented file appear and disappear as the PingPongAgent jumps back and forth between the two platforms.

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