-
Notifications
You must be signed in to change notification settings - Fork 218
PingPongAgent
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.
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:
-
Ensure the platform is active:
. env/bin/activate
-
Package the agent:
volttron-pkg package Agents/PingPongAgent
-
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
-
Sign the agent as soi:
volttron-pkg sign --soi /tmp/volttron_wheels/pingpongagent-0.1-py2-none-any.whl
-
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
-
Set the configuration file:
volttron-pkg configure /tmp/volttron_wheels/pingpongagent-0.1-py2-none-any.whl Agents/PingPongAgent/config.json
-
Install agent into platform (with the platform running):
volttron-ctl install /tmp/volttron_wheels/listeneragent-0.1-py2-none-any.whl
-
Check volttron status to verify agent is ready to start:
volttron-ctl status
-
The terminal will have output that looks similar to:
AGENT TAG STATUS 1f pingpongagent-0.1
-
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
-
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.
- Platform Agent
- VOLTTRON Central Agent
- Platform Commands
- Platform Configuration
- [Platform Hardening Security Recommendations] (Linux-Platform-Hardening-Recommendations-for-VOLTTRON-users)
- ...
- [Building VOLTTRON] (Building-VOLTTRON)
- Example Agents
- Agent Development
- [Shortcut Scripts] (Scripts)
- [VOLTTRON Conventions] (Conventions)
- [sMAP Test Server] (sMAP-Test-Instance)
- [Design Discussions] (Design Discussions)
- VIP
- VIP - VOLTTRON Interconnect Protocol
- RPC by example
- VIP - Known Identities
- VIP - Authentication
- VIP - Authorization
- Protecting Pub/Sub Topics
- Setup Eclipse for VOLTTRON
- Deployment Walkthrough
- Forward Historian Walkthrough
- [Create New Historian Agent] (Developing-Historian-Agents)
- [Create New Driver Agent] (Develop-Driver-Agent)
- [Developing With Eclipse] (Eclipse)
- Migrations
- [2.x to 3.x Migration](2.x-to 3.x-Migration)
- 1.2 to 2.0 Migration
- [Deployment Recommendations](Recommendations for Deployments)
VOLTTRON Versions and Features
Transactional Network Platform Overview
- Established Topics
- Working with the Actuator Agent
- Logging
- [Multi-Node Communication] (MultiBuildingMessaging)
Information Exchange Standards