Introduction 

 

Itron recommends that a developer should not start developing an Agent from scratch. A Reference Agent including full source code is supplied as part of the DI package file (distributedintelligence.tgz). This package file includes a script: “Clone_ThirdPartyReferenceAgent.sh” to clone the Reference Agent. This page describes how to clone the Reference Agent in order to begin Agent development. 

 

 

Clone Agent Instructions 

 

Step 1 – Edit the Clone Script 

 

Edit the clone script to fix a small issue regarding the copying of Feature IDs. This is done by: 

  1. ssh to the Ubuntu VM as user: “dev” 

  1. Navigate to the “Agents” directory using: “cd ~/DistributedIntelligence/source/Agents” 

  1. Using a Terminal text editor such as vi on nano, replace the line “FEATUREID_HEX=`cat info.sh |grep "FEATURES="|cut -d'=' -f2| cut -d' ' -f2`” with “FEATUREID_HEX=`cat info.sh |grep "FEATURES="|cut -d'=' -f2| cut -d' ' -f1| cut -d'"' -f2`” in the file “Clone_ThirdPartyReferenceAgent.sh” as per Figure 1.   

 

Figure 1: Script: “Clone_ThirdPartyReferenceAgent.sh” After Step 3 

 

Step 2 – Clone the Reference Agent 

 

Clone the Reference Agent using the script: Clone_ThirdPartyReferenceAgent.sh <Agent Name> <Description> <Agent ID> <Overlay ID> <Feature ID> <SDK Version> 

For a production Agent Itron will provide values for the Agent ID, Overlay ID and Feature ID. For development Agents use: 23050000, 23020000 and 23030000 for these values respectively. The SDK Version should be: SDK1. 

 

Cloning the Reference Agent is done by: 

  1. ssh to the Ubuntu VM as user: “dev” 

  1. Navigate to the “Agents” directory using: “cd ~/DistributedIntelligence/source/Agents” 

  1. Clone the Reference Agent to create a new agent “TestAgent” using: “./Clone_ThirdPartyReferenceAgent.sh TestAgent "Test Agent" 23050000 23020000 23030000 SDK1” as per Figure 2 

 

Figure 2: Successfully Cloning the Reference Agent to Create a New Agent: “TestAgent”