volttron - volttron 对 rpc 调用 get_point 进行故障排除
问题描述
有没有机会对如何解决get_point
对 BACnet 设备的简单 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_topic
是_slipstream_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\'")')
解决方案
实际上解决这个问题的方法是我同时重新启动了执行器代理、bacnet 代理和 masteragent。可能是需要重新启动的主代理吗?
更新
如果您必须更改设备的配置存储中的某些内容,例如使 BACnet 点可写而不是只读;并且错误地手指变胖了,这也会导致同样的错误!而且也很难排除故障。
例如,在实时系统上,如果您必须通过 vctl 修改类似这样的内容:
vctl config edit platform.driver registry_configs/1100.csv
而且你用粗手指创建了一个语法错误,这也会引发同样的错误!!!!!!
推荐阅读
- printing - 适用于多个用户/平台的本机 VPN 服务器
- angular - Angular中的树节点选择
- javascript - nuxt项目中如何实现svelte组件?
- hive - import-hive.sh:将 Hive 导入 Apache Atlas 不会导入现有的 Hive 数据库
- python - 如何在同一数据框中划分行
- ansible - Ansible 从组中找到一个健康的主机名
- vba - 是否有一种等效的方法可以自动填充到 vba 中一行的最后一列,就像一列中的最后一行一样?
- python - 函数缺少 2 个必需的位置参数:“X_train”和“y_train”
- ios - 如果 Webview 无法加载 URL,则切换视图?
- javascript - 增加 HERE 地图中的渲染距离 javascript api