Skip to content

Eclipse Dev Environment

Craig edited this page Oct 8, 2015 · 45 revisions

The only thing that is necessary to create a VOLTTRON agent is a text editor and the shell. However, we have found the Eclipse Development Environment (IDE) to be a valuable tool for helping to develop VOLTTRON agents. You can obtain the latest (MARS as fo 10/7/15) from http://www.eclipse.org/. Once downloaded the PyDev Plugin is a valuable tool for executing the platform as well as debugging agent code.

PyDev Plugin

Installing the PyDev plugin from the Eclipse Market place There is a python plugin for eclipse that makes development much easier. Install it from the eclipse marketplace.

Help -> Eclipse Marketplace...

Click Install

Cloning the Source Code

The VOLTTRON code is stored in a git repository. Eclipse (Luna and Mars) come with a git plugin out of the box. For other versions the plugin is available for Eclipse that makes development more convenient (note: you must have Git [already installed](VOLTTRON Prerequisites "wikilink") on the system and have built VOLTTRON):

If your version of Eclipse does not have the marketplace follow these instructions.

The project can now be checked out from the repository into Eclipse.

  1. Open the Git 1. view Select Git view
  2. Clone a Git Repository Clone existing repo
  3. Fill out the URI: https://github.com/VOLTTRON/volttron Clone existing repo
  4. Select 3.x branch for latest release ** master for latest stable version ** Clone existing repo
  5. Import the cloned repository as a general project Import project
  6. Pick a project name (default volttron) and hit Finish Finish import
  7. Switch to the PyDev perspective
  • VOLTTRON must now be built outside Eclipse. Please follow the directions here and skip the git clone portion.
  • Right-click on the project name and select Refresh so that Eclipse will pickup the filesystem changes
  • PyDev must now be pointed at the correct version of Python.
    • Window-> Preferences
    • Expand PyDev
    • Select Interpreter-Python
    • Hit New
    • Hit Browse and browse to the pydev-python file located in scripts directory off of the volttron source. Then hit Ok

Pick Python

-   Select All, then Hit Ok

Pick Python - You may need to redo this after a platform update and buildout

  • In the Project/PackageExplorer view on the left, right-click on the project, PyDev-> Set as PyDev Project
  • Switch to the PyDev perspective (if it has not already switched), Window -> Open Perspective -> PyDev Pick Python Eclipse should now be configured to use the project's environment.

To test the installation:

  • Setup a run configuration for the platform
    • In the Package Explorer view, open the env/bin folder
    • Create a new Run Configuration
    • On the menu bar, pick Run -> Run Configurations...
    • Create a new configuration and choose env/bin/volttron for the Main Module Pick Python
    • Click on the Argument tab
    • Change Working Directory to Default
    • Click Run, this launches the platform. If the run does not succeed, click the all stop icon (two red boxes overlaid) on the console and then retry.
  • Setup a run configuration for the ListenerAgent
    • In the Package Explorer view, open Agents -> ListenerAgent --> listener
    • Righ-click on agent.py and select Run As -> Python Run (this will create a run configuration but fail)
    • On the menu bar, pick Run -> Run Configurations...
    • Under Python Run pick "volttron agent.py"
    • Click on the Arguments tab
    • Change Working Directory to Default
    • In the Environment tab, add
    • AGENT_CONFIG = /home/<USER>/git/volttron/Agents/ListenerAgent/config
    • AGENT_PUB_ADDR = ipc:///home/<USER>/.volttron/run/publish
    • AGENT_SUB_ADDR = ipc:///home/<USER>/.volttron/run/subscribe Pick Python Pick Python
    • Click Run, this launches the agent
    • You should see the agent start to publish and receive its own heartbeat message

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