volttron csv driver agent troubleshoot

63 views Asked by At

Could anyone give me a tip or two for a volttron 7.0 environment where I am having some trouble trying to get a my modified CSV driver agent script to work to adjust a BACnet setpoint up and down on a BACnet controller with an instance ID set at 29. I think I may have an issue on line 182 (point_topic = self.topic + "/" + "ZN-SP") of the script trying to reference this setpoint to adjust: (sorry about the formatting)

nt.core ERROR: unhandled exception in periodic callback
Traceback (most recent call last):
File "/var/lib/volttron/volttron/platform/vip/agent/core.py", line 117, in _loopntmethod(*self.args, **self.kwargs)
File "/home/volttron/.volttron/agents/c531de8a-8b84-404c-8a15-5e2075bea98d/CsvDrAgentagent-0.1/CsvDriverAgent/agent.py", line 182, in actuate_point
result = self.vip.rpc.call(
File "src/gevent/event.py", line 305, in gevent._gevent_cevent.AsyncResult.get
File "src/gevent/event.py", line 335, in gevent._gevent_cevent.AsyncResult.get
File "src/gevent/event.py", line 305, in gevent._gevent_cevent.AsyncResult.get
File "src/gevent/event.py", line 305, in gevent._gevent_cevent.AsyncResult.get
File "src/gevent/event.py", line 323, in gevent._gevent_cevent.AsyncResult.get
File "src/gevent/event.py", line 303, in gevent._gevent_cevent.AsyncResult._raisng e_exception
File "/var/lib/volttron/env/lib/python3.8/site-packages/gevent/_compat.py", line
66, in reraise
raise value
tins.KeyError('devices/slipstream_internal/slipstream_hq/29')")

Would anyone have any advice how to troubleshoot this? On this device if I do a vctl config get platform.driver devices/slipstream_internal/slipstream_hq/29 this will print:

{
  "driver_config": {
    "device_address": "12:29",
    "device_id": 29
  },
  "driver_type": "bacnet",
  "registry_config": "config://registry_configs/29.csv"
}

This should be the saved registry config for this device during the BACnet discovery process. Filtering to show only ZN-SP:

Reference Point Name,Volttron Point Name,Units,Unit Details,BACnet Object Type,Property,Writable,Index,Write Priority,Notes
ZN-SP,ZN-SP,degreesFahrenheit,69.76 to 72.76 (default 72.5),analogValue,presentValue,TRUE,1103,,Zone Setpoint

Any tips greatly appreciated... Testing this point out with a BACnet scanning tool it is writeable..

1

There are 1 answers

0
jklarson On BEST ANSWER

Device instances are mapped in the PlatformDriver by the portion of the topic following devices/ - so in this instance self.topic = 'devices/slipstream_internal/slipstream_hq/29' should be self.topic = 'slipstream_internal/slipstream_hq/29' (this is why you see the KeyError above). It might be worth checking out the original CsvDriverAgent and it's config file to get a better feel for that pattern. Your point topic looks good, given the examples above. Additionally, I strongly recommend that you use vpkg --init to create a new control agent, that way you don't have any relics of the CsvDriverAgent to distract you as you develop. The CsvDriverAgent was created to demonstrate driver communication from the standpoint of the agnet, but it is not a very good basis for an agent as the configuration, and control algorithm are intentionally overly simple and not practical. Additionally, going through the agent creation process start to finish is likely to help you build out a stronger foundation of understanding, both of VOLTTRON Core, but also of your own product. And just to have another reference tool, here's our instructions on BACnet router addressing (what you have here does appear correct, but references are nice!)