Search code examples
pythonpython-2.7bacnetvolttron

VOLTTRON Failing Bacnet Proxy agent


I am trying to configure bacnet proxy agent in Volttron Project and for some reason i am getting this error in volltron.log when i start the proxy agent:

Can you please guide whether I am doing anything wrong in configuration files ? For IP address of device I have tried three variants in config files:

  1. IPADDRESS/24
  2. IPADDRESS
  3. IPADDRESS:PORT(47808)

Where <> is the ip address of device.

Unfortunately none of these work.

Here is the following description of various files:

============================VOLTTRON LOG================================

2016-06-28 13:55:31,888 (bacnet_proxyagent-0.1 7777) <stderr> 
ERROR: socket.error: [Errno 99] Cannot assign requested address

==========================================================================

=====================BACNET PROXY AGENT CONFIG==========================

"agentid": "bacnet_proxy",

#Maximum APDU legnth accepted
#This setting determines the largest APDU accepted by the Volttron BACnet virtual device.
    #Valid options are 50, 128, 206, 480, 1024 (default), and 1476
    "max_apdu_length": 480,

    #ID of the Device object of the virtual bacnet device.
    #Defaults to 599
    "object_id": 570009,

    #Name of the bacnet network object
    #Defaults to "Volttron BACnet driver"
    #"object_name": "Volttron BACnet driver",

    #Vendor ID of the virtual bacnet device.
    #Defaults to 15
    "vendor_id": 24,

    #Required, use this network interface for the virtual device.
    "device_address": "192.168.1.9"

I ran the volttron/scripts/bacnet/bacnet_scan.py and the following was the result:

Device Address        = <Address 192.168.1.9>
Device Id             = 570009
maxAPDULengthAccepted = 480
segmentationSupported = segmentedBoth
vendorID              = 24
Device Address        = <RemoteStation 5701:37>
Device Id             = 990037
maxAPDULengthAccepted = 480
segmentationSupported = segmentedBoth

vendorID = 24


Solution

  • This is a common mistake. When you setup the bacnet proxy you are, in essence, creating a new BACnet device and putting it on the network. The VOLTTRON platform BACnet drivers then use this device to communicate with the devices on your network.

    This device will have nothing in common with any other device on the network except the port over which it will communicate.

    From the BACnet proxy documentation:

    device_address - Address bound to the network port over which BACnet communication will happen on the computer running VOLTTRON. This is NOT the address of any target device.

    http://volttron.readthedocs.io/en/develop/core_services/drivers/BACnet-Proxy-Agent.html

    For instance if your VOLTTRON installation is on a machine with an IP of 192.168.1.2 you would use that for the device_address setting in the BACnet Proxy configuration file.

    It will be the same value you used in volttron/scripts/bacnet/BACpypes.ini for the "address" setting to make the bacnet_scan.py script work.

    This is necessary are the BACnet protocol uses UDP for all communications and must open a port to listen to responses.

    You must also change the "object_id" setting back to 599 in your proxy's configuration. Based on the output of bacnet_scan using 570009 would cause a conflict with the device you are trying to setup. In BACnet parlance this is the device ID. All device IDs on a BACnet network must be unique.

    The address of the device you wish to communicate with is used in the configuration of the specific device in the MasterDriverAgent configurations.

    For example with MasterDriverAgent configuration like this:

    {
        "agentid": "master_driver",
        "driver_config_list": [
            "/home/volttron/volttron/examples/configurations/drivers/bacnet.config"                 
        ]
    }
    

    You would put the target device address in bacnet.config:

    {
        "driver_config": {"device_address": "192.168.1.9",
                          "device_id": 570009},
        "campus": "campus",
        "building": "building",
        "unit": "bacnet1",
        "driver_type": "bacnet",
        "registry_config":"/home/volttron/volttron/examples/configurations/drivers/bacnet.csv",
        "interval": 60,
        "timezone": "UTC"
    }