volttron 故障排除 rpc 调用 get_point

volttron troubleshoot rpc call get_point

是否有机会获得有关如何对 BACnet 设备的简单 get_point rpc 调用进行故障排除的提示?我在 rpc 调用上做的事情抛出了这个错误:'DriverAgent\' object has no attribute \'interface\'

这是我的设备: vctl config get platform.driver registry_configs/33333.csv

打印:

[
  {
    "Reference Point Name": "signal_payload",
    "Volttron Point Name": "signal_payload",
    "Units": "percent",
    "Unit Details": "(default 0.0)",
    "BACnet Object Type": "analogValue",
    "Property": "presentValue",
    "Writable": "FALSE",
    "Index": "0",
    "Write Priority": "",
    "Notes": "Open ADR Payload Signal"
  },
  {
    "Reference Point Name": "int_signal_duration",
    "Volttron Point Name": "int_signal_duration",
    "Units": "percent",
    "Unit Details": "(default 0.0)",
    "BACnet Object Type": "analogValue",
    "Property": "presentValue",
    "Writable": "FALSE",
    "Index": "1",
    "Write Priority": "",
    "Notes": "Integer Signal Duration"
  }
]

设备地址: vctl config get platform.driver devices/slipstream_internal/slipstream_hq/33333 这将打印:

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

我认为我在 dr_level = self.vip.rpc.call 中的代理代码有问题,如下面的片段所示,因为代码在 ACTUATOR AGENT SCHEDULE SUCCESS 之后立即出错:

dr_status = self.vip.rpc.call(
    'platform.actuator', 'request_new_schedule', self.agent_id, 'my_test', 'HIGH', schedule_bac0_request).get(
    timeout=4)

_log.info(f'*** [Setter Agent INFO] *** - ACTUATOR AGENT SCHEDULE SUCCESS')

dr_level = self.vip.rpc.call('platform.actuator','get_point', dr_topic, point="signal_payload").get(timeout=15)

dr_topicslipstream_internal/slipstream_hq/33333

非常感谢任何尝试的想法...

完整追溯:

2021-06-15 14:36:27,597 (actuatoragent-1.0 403031) __main__ DEBUG: handle_get: slipstream_internal/slipstream_hq/33333
2021-06-15 14:36:27,598 (master_driveragent-4.0 403069) volttron.platform.vip.agent.subsystems.rpc ERROR: unhandled exception in JSON-RPC method 'get_point':
Traceback (most recent call last):
  File "/var/lib/volttron/volttron/platform/vip/agent/subsystems/rpc.py", line 158, in method
    return method(*args, **kwargs)
  File "/home/volttron/.volttron/agents/55fbfb56-beac-4e6d-a201-1ab17b11d42b/master_driveragent-4.0/master_driver/agent.py", line 448, in get_point
    return self.instances[path].get_point(point_name, **kwargs)
  File "/home/volttron/.volttron/agents/55fbfb56-beac-4e6d-a201-1ab17b11d42b/master_driveragent-4.0/master_driver/driver.py", line 341, in get_point
    return self.interface.get_point(point_name, **kwargs)
AttributeError: 'DriverAgent' object has no attribute 'interface'

2021-06-15 14:36:27,599 (actuatoragent-1.0 403031) volttron.platform.vip.agent.subsystems.rpc ERROR: unhandled exception in JSON-RPC method 'get_point':
Traceback (most recent call last):
  File "/var/lib/volttron/volttron/platform/vip/agent/subsystems/rpc.py", line 158, in method
    return method(*args, **kwargs)
  File "/home/volttron/.volttron/agents/8f4ee1c0-74cb-4070-8a8c-57bf9bea8a71/actuatoragent-1.0/actuator/agent.py", line 897, in get_point
    return self.vip.rpc.call(self.driver_vip_identity, 'get_point', path,
  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._raise_exception
  File "/var/lib/volttron/env/lib/python3.8/site-packages/gevent/_compat.py", line 66, in reraise
    raise value
volttron.platform.jsonrpc.RemoteError: builtins.AttributeError("'DriverAgent' object has no attribute 'interface'")


2021-06-15 14:36:27,600 (setteroccvavagent-0.1 471606) volttron.platform.vip.agent.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 _loop
    method(*self.args, **self.kwargs)
  File "/home/volttron/.volttron/agents/9c13ec66-7d7a-4f3d-a607-409a82e012ed/setteroccvavagent-0.1/setteroccvav/agent.py", line 252, in raise_setpoints_up
    dr_level = self.vip.rpc.call('platform.actuator','get_point', dr_topic, point="signal_payload").get(timeout=4)
  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._raise_exception
  File "/var/lib/volttron/env/lib/python3.8/site-packages/gevent/_compat.py", line 66, in reraise
    raise value
volttron.platform.jsonrpc.RemoteError: volttron.platform.jsonrpc.RemoteError('builtins.AttributeError("\'DriverAgent\' object has no attribute \'interface\'")')
        driver = DriverAgent(self, contents, slot, self.driver_scrape_interval, topic,
                             group, self.group_offset_interval,
                             self.publish_depth_first_all,
                             self.publish_breadth_first_all,
                             self.publish_depth_first,
                             self.publish_breadth_first)
        gevent.spawn(driver.core.run)
        self.instances[topic] = driver

当调用平台驱动程序的配置方法时(在配置存储回调期间发生),平台驱动程序根据传递的配置创建一个具有接口 class 的驱动程序实例。如果传递的配置不正确或传递不当,则平台驱动程序将无法实际实例化驱动程序,因此它不会被添加到“self.instances”字典(上文)中。当您调用平台驱动程序时,您会包含一个主题。该路径 必须 匹配映射到“self.instances”字典中的驱动程序实例值的键。

因此,我有几个地方建议进行调查。 1) 将配置重新加载到配置存储中,并在执行此操作时查看 VOLTTRON 日志文件。如果您在 VOLTTRON 日志中没有看到配置文件的字典表示(在详细日志记录模式下 运行),那么您可能给了它一个格式不正确的配置。 2) 仔细检查您在 RPC 调用中使用的主题。如果主题不在“self.instances”字典中,它将抛出错误,因为它要求的键不存在。

您上面发布的配置在我看来是正确的,因此在我看来,RPC 调用中的主题或用于存储配置的命令最有可能是罪魁祸首。

实际上解决这个问题的方法似乎是我同时重新启动了执行器代理、bacnet 代理和主代理。是不是主代理需要重启?

更新

如果您必须在设备的配置存储中更改某些内容,例如使 BACnet 点可写而不是只读;有些东西手指错误地变粗了,这也会导致同样的错误!而且也很难排除故障。

例如在实时系统上,如果您必须通过 vctl 修改如下内容:

vctl config edit platform.driver registry_configs/1100.csv

而且你用粗手指制造了一个语法错误,这也会抛出同样的错误!!!!!