问题标签 [volttron]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
1 回答
397 浏览

python - 如何将 RPC 与 Volttron 一起使用

我想在我的 volttron 应用程序中使用 RPC 调用,但我无法让任何调用正常工作。所有调用都失败并出现“没有路由到主机”错误

本质上,有两个代理,一个导出 RPC 过程的“服务器”代理,以及一个调用该过程的“客户端”代理。

在“服务器”代理中,我导出了代理类的方法,如下所示:

“客户端”代理调用导出的方法如下:

其中“sender”是“server”代理的 VIP 身份(结果是“rpcserver.agent_1”并且对应于从 rpcserver.agent 接收 pubsub 消息时的“sender”参数的值。我已经定义了IDENTITY 文件中的 rpcserver.agent_{n} 身份)。

我的问题是: 1. 我是在做一些明显错误的事情还是错过了正确设置 RPC 子系统的某些步骤?2. “peer”参数是否self.vip.rpc.call(peer, method, ...)预期是代理的身份?这在文档中并不清楚(我尝试了其他选项,例如代理名称或 uuid,但没有一个有效)

我在 Ubuntu VM 中运行 volttron 5.1.0。

对此的任何帮助将不胜感激。此致

细节:

这适用于互连多个设备的控制应用程序。代理根据网络中的可用设备动态加载。我想尝试 RPC 而不是只使用 pubsub。到目前为止,我已经彻底搜索了 Volttron 代码和文档以获取有关 RPC API 的详细信息,但无济于事。

最小的“服务器”类:

最小的“客户”类:

预期行为:调用导出的函数并发布主题为“rpc/clientready”的 pubsub 消息。

实际行为:RPc 调用失败并出现错误“无法访问:VIP 错误(113):没有到主机的路由:rpcclient.agent_1”

编辑 我最终发现问题在于 volttron 中的代理身份以“\n”字符结尾。这是由于 gedit 自动附加它,显然字符串没有被 volttron 剥离。

0 投票
1 回答
77 浏览

volttron - volttron.platform.vip.agent.core 错误:10 秒后没有响应 hello 消息

我正在删除一些 volttron 代理,但我一直遇到错误。当我执行“vctl status”或尝试删除或停止一些已安装的代理时,通常会出现这种情况。我在关机的时候也遇到过,所以我不得不手动进入.volttron目录并删除keystore文件,并删除代理的所有目录。

我在这里看到了一个几乎类似的问题:volttron.platform.vip.agent.core ERROR: Possible conflicting identity。但是我通过安装过程来安装我的代理并且根本不从 Eclipse 运行。

这些是错误:

2019-08-06 11:00:12,070 () volttron.platform.vip.agent.core 错误:10 秒后没有响应 hello 消息。
2019-08-06 11:00:12,070 () volttron.platform.vip.agent.core 错误:常见原因是 VIP 身份冲突。
2019-08-06 11:00:12,070 () volttron.platform.vip.agent.core 错误:另一个常见原因是目标实例上没有身份验证条目。
2019-08-06 11:00:12,071 () volttron.platform.vip.agent.core 错误:关闭代理。
2019-08-06 11:00:12,071 () volttron.platform.vip.agent.core 错误:可能的冲突身份是:control.connection 删除:操作超时

0 投票
1 回答
49 浏览

volttron - Volttron 进入了一个几乎无止境的循环

我已经安装了大约 40 个代理来运行一些模拟。但是我遇到了一些线程错误。错误如下所示。

2019-08-06 10:56:24,120(socialagent-3.0 16231)错误:线程 Thread-31 中的异常:2019-08-06 10:56:24,124(socialagent-3.0 16231)错误:回溯(最近一次通话最后) :2019-08-06 10:56:24,135(socialagent-3.0 16231)错误:文件“/usr/lib/python2.7/threading.py”,第 801 行,在 __bootstrap_inner

2019-08-06 10:56:24,162(socialagent-3.0 16231)错误:
self.run()

2019-08-06 10:56:24,177(socialagent-3.0 16231)错误:文件“/usr/lib/python2.7/threading.py”,第 1073 行,正在运行

2019-08-06 10:56:24,198(socialagent-3.0 16231)错误:
self.function(*self.args,**self.kwargs)

2019-08-06 10:56:24,201(socialagent-3.0 16231)错误:文件“/home/jenny/.volttron/agents/50b42ee5-b6af-4a25-aa89-97e2b1a823e1/socialagent-3.0/social/agent.py” ,第 145 行,在 enter_phase3 中

2019-08-06 10:56:24,240 (socialagent-3.0 16231) 错误:
self.vip.pubsub.publish('pubsub', ids_topic, message=message)

2019-08-06 10:56:24,265(socialagent-3.0 16231)错误:文件“/home/jenny/workspace/volttron/volttron/platform/vip/agent/subsystems/pubsub.py”,第 607 行,在发布中

2019-08-06 10:56:24,267 (socialagent-3.0 16231) 错误:
self.vip_socket.send_vip(b'', 'pubsub', frames, result.ident, copy=False)

2019-08-06 10:56:24,279(socialagent-3.0 16231)错误:文件“/home/jenny/workspace/volttron/volttron/platform/vip/socket.py”,第 404 行,在 send_vip

2019-08-06 10:56:24,326 (socialagent-3.0 16231) 错误:
以 self._sending(flags) 作为标志:

2019-08-06 10:56:24,327(socialagent-3.0 16231)错误:文件“/usr/lib/python2.7/contextlib.py”,第 17 行,在 __enter__

2019-08-06 10:56:24,377(socialagent-3.0 16231)错误:
返回 self.gen.next()

2019-08-06 10:56:24,402(socialagent-3.0 16231)错误:文件“/home/jenny/workspace/volttron/volttron/platform/vip/green.py”,第 78 行,在 _sending

2019-08-06 10:56:24,413(socialagent-3.0 16231)错误:
虽然不是 lock.acquire(不是标志和 NOBLOCK):

2019-08-06 10:56:24,422(socialagent-3.0 16231)错误:文件“/home/jenny/workspace/volttron/env/local/lib/python2.7/site-packages/gevent/lock.py”,第 210 行,在获取中

2019-08-06 10:56:24,427(socialagent-3.0 16231)错误:rc = self._block.acquire(阻塞)

2019-08-06 10:56:24,442 (socialagent-3.0 16231) 错误:文件“gevent/_semaphore.py”,第 198 行,在 gevent._semaphore.Semaphore.acquire (gevent/gevent._semaphore.c:4117)

2019-08-06 10:56:24,451(socialagent-3.0 16231)错误:
def 获取(自我,阻塞=真,超时=无):

2019-08-06 10:56:24,485 (socialagent-3.0 16231) 错误:文件“gevent/_semaphore.py”,第 226 行,在 gevent._semaphore.Semaphore.acquire (gevent/gevent._semaphore.c:3944)

2019-08-06 10:56:24,493 (socialagent-3.0 16231) 错误:
timeout = self._do_wait(timeout)

2019-08-06 10:56:24,503 (socialagent-3.0 16231) 错误:文件“gevent/_semaphore.py”,第 166 行,在 gevent._semaphore.Semaphore._do_wait (gevent/gevent._semaphore.c:3178)

2019-08-06 10:56:24,546(socialagent-3.0 16231)错误:
结果 = get_hub().switch()

2019-08-06 10:56:24,552(socialagent-3.0 16231)错误:文件“/home/jenny/workspace/volttron/env/local/lib/python2.7/site-packages/gevent/hub.py”,第 609 行,在开关中

2019-08-06 10:56:24,574(socialagent-3.0 16231)错误:
返回 greenlet.switch(self)

2019-08-06 10:56:24,589(socialagent-3.0 16231)错误:LoopExit:('此操作将永远阻塞',)

2019-08-06 10:56:24,640(socialagent-3.0 16231)错误:

这正是我在 agent.py 文件中第 145 行的内容: self.vip.pubsub.publish('pubsub', ds_topic, message=message) 我已经将消息定义为 message = “something”</p>

当我安装较少的代理时,我根本不会遇到这个问题。我正在运行一台 1.9GHz Intel core i3 机器;这有关系吗?为了提供尽可能多的信息以帮助诊断问题,我在这里展示了我的代理的一些片段:

另外,可能timer = Timer(8, self.enter_phase)是问题的一部分吗?我不是这样的开发大师,我会感谢任何帮助(用简单的语言:))。

0 投票
1 回答
87 浏览

volttron - Volttron 平台在设置期间不接受 IP 地址

我正在尝试将 Linux 中的 matlab 代理连接到 Windows 中的独立代理。我首先在 Volttron 上建立一个平台(使用 vcfg)。但是,当我尝试在 volttron 实例上定义 IP 地址和端口时出现此错误:

vip地址是什么?[tcp://127.0.0.1]: tcp://192.168.56.101 vip地址的端口是什么?[22916]:

错误:该地址已绑定。vip地址是什么?[tcp://192.168.56.101]: tcp://192.168.56.155 vip地址的端口是什么?[22916]:错误:该地址已绑定。

不管我给什么地址,它都说它已经被绑定了。我删除了包含 known_hosts 等的 .volttron 目录,但无济于事。唯一可行的 IP 地址是 127.0.0.2。但是,独立代理不会连接到 Volttron 平台。我在 volttron 中添加了独立代理的身份验证凭据,并确保正确配置了密钥。这就是我得到的全部:

过了一会儿,它超时:

我错过了表明已建立连接的这一行。

另外,我已经将我的网络适配器设置为仅主机。有人可以帮我知道我做错了什么吗?

0 投票
1 回答
49 浏览

volttron - Volttron 在尝试发布时抛出属性错误

我正在将 Scapy 与 Volttron 结合起来,并且我想在数据包进入并具有某些功能时发布到主题。但是,我一直遇到这个错误:

Traceback(最近一次调用最后一次):文件“sniff.py”,第 373 行,在 sys.exit(main()) 文件“sniff.py”,第 342 行,在 main utils.vip_main(sniffer, version= version ) 文件中"/home/jenny/workspace/volttron/volttron/platform/agent/utils.py",

第 314 行,在 vip_main version=version,**kwargs) 文件“sniff.py”,第 336 行,在嗅探器中 Sniffer(**kwargs) 文件“sniff.py”,第 138 行,在init self.vip.pubsub.publish ('pubsub', "some/topic", message="blah")
文件 "/home/jenny/workspace/volttron/volttron/platform/vip/agent/subsystems/pubsub.py",

第 602 行,在发布 self._save_parameters(result.ident, **kwargs)
文件“/home/jenny/workspace/volttron/volttron/platform/vip/agent/subsystems/pubsub.py”,第 706 行,在 _save_parameters 事件 = self.core().schedule(end_time, self._cancel_event, result_id)
文件“/home/jenny/workspace/volttron/volttron/platform/vip/agent/core.py”,第 409 行,在计划中 self._schedule_callback(deadline ,事件)文件“/home/jenny/workspace/volttron/volttron/platform/vip/agent/core.py”,第417行,在_schedule_callback self._schedule_event.set()

AttributeError:“NoneType”对象没有属性“设置”

我找到的最接近解决方案的是RPC crash with AttributeError: 'NoneType' object has no attribute 'call'。但是,我注意到它们不是完全相同的问题,因此当我尝试那里提供的解决方案并且它对我不起作用时并没有太大的惊喜。

我的代码如下所示:

有人可以让我知道我做错了什么吗?

编辑:我没有添加我想运行这个脚本,因为我会在终端上运行一个简单的 python 脚本(例如 python somescript.py):没有安装。我尝试这样做的原因是我在安装代理并启动它时遇到错误。该平台不允许 Scapy 创建和连接套接字。

0 投票
1 回答
57 浏览

volttron - 如何从 Volttron 代理加载存储在配置存储中的 csv?

我有一个包含系列数据的 CSV/Raw 文件,我希望我的代理在启动时从配置存储中读取。

我正在遵循的步骤:

  1. 存储配置:

    volttron-ctl config store myagent mycsv.csv -c mycsvfile.csv --csv

  2. 然后我可以得到内容:

    volttron-ctl 配置获取 myagent my.csv

  3. 在我的代理配置中,我指定:

{ "mycsv": "config://myagent/mycsv.csv" }

在我的代理中,我尝试存储配置。

mycsv 始终返回字符串“config://myagent/mycsv.csv”

0 投票
0 回答
123 浏览

modbus - 如何将 modbus 设备连接到 volttron 实例?

我有一个使用 TCP/IP 连接的 modbus 设备,我正在尝试将它连接到 volttron,以便我可以读/写数据。

我存储了主驱动程序配置、注册表配置和设备配置。

modbustest-master-driver.agent {“driver_scrape_interval”:0.05,“publish_breadth_first_all”:假,“publish_depth_first”:假,“publish_breadth_first”:假}

modbusttest.config {“driver_config”:{“device_address”:“10.0.1.7”,“port”:26,“slave_id”:5},“driver_type”:“modbus”,“registry_config”:“config://modbuspoints .csv", "interval": 60, "timezone": "US/Pacific", "heart_beat_point": "heartbeat" }

我没有收到任何错误,但是当我启动 Web 浏览器并转到 volttron 仪表板时。我的 modbus 设备不存在,并且出现此错误“以下设备主题无效,无法添加到树中:devices/modbus/test”

浏览器中的错误 - 在 Ubuntu 桌面上使用 Firefox

0 投票
1 回答
111 浏览

volttron - Are there any conflicts betweenusing Pyenv and installing the VOLTTRON Reference Application?

I'm having a hell of a time installing the Volttron Reference Application, and can't figure out what I'm doing wrong.

I've been using Pyenv to manage running multiple versions of Volttron at once -- I've been able to install the versions that use both Python 2.7.x (the current 'master' branch) and the version using Python 3.6.x (the 'volttron-7-preview' branch), but I'm having a hell of a time getting the Reference Application up and running.

Specifically, I can't get Celery to play nicely with the OpenADR VTN server (installation instructions) mentioned in the jupyter notebook. I've followed the instructions to the letter (with the exception of the rabbit-mq step, since that gets installed as part of Volttron and would then be installed twice in different ways), and I've been making sure to link directly to specific versions of Python (3.6.9) to avoid any weirdness with pyenv, but when I run this command

celery -A openadr worker -B

I get this error:

and the thing dies after a few additional errors get thrown while trying to handle the above exception (at bottom, since it's a bit long).

Anybody have any suggestions on what I might be doing wrong?

(Separately: I hear there's a Slack channel, but the sign-up link (https://volttron-community.signup.team/) seems to be broken. Any links there, either?)

My setup: Using current master of Volttron (which uses Python 2.7) and current master of Volttron-applications (link) on Ubuntu 18.04 inside a VirtualBox; Python versions managed with pyenv.

0 投票
1 回答
56 浏览

raspberry-pi - [VOLTTRON]:bootstrap.py 无法运行虚拟环境

我无法创建虚拟环境来运行VOLTTRON。每次我运行时bootstrap.py,我都会收到一条错误消息[SSL: CERTIFICATE_VERIFY_FAILED]。截图附在下面。

这是VOLTTRON版本的问题还是我需要额外的依赖项来运行文件?

在此处输入图像描述

0 投票
0 回答
83 浏览

matlab - Matlab 到 volttron 集成

下面的步骤是集成一个假建筑 - 假 modbus 设备 (Ubuntu 18.04 LTS) 与基于 matlab 的界面。

按照以下文档步骤操作:https ://volttron.readthedocs.io/en/6.0/devguides/walkthroughs/DrivenMatlabAgent-Walkthrough.html

运行Matlab的系统安装步骤:安装python(我的Python版本:2.7.12) 运行Matlab的系统安装步骤:安装python -done 安装pyzmq -done

安装 Matlab--完成 (R2019b) 运行 pyversion --done

版本:'2.7' 可执行文件:'/home/USER_NAME/volttron/env/bin/python' 库:'libpython2.7.so.1.0' 主页:'/home/USER_NAME/volttron/env' 已加载:0

当我运行 py.zmq.pyzmq_version() 我得到

答案=

Python str 没有属性。

15.4.0

我将 example.m 复制到桌面。

运行和测试 Matlab VOLTTRON 集成:运行和测试集成:假设

设备驱动代理已经开发(安装了master_driveragent-3.1.1-)

安装:安装 VOLTTRON –done 使用以下命令在 volttron/applications 下添加子树 volttron-applications – 添加子树:我使用了代码:git subtree add --prefix applications https://github.com/VOLTTRON/volttron-applications .git develop --squash 错误(工作树有修改。无法添加。)

配置 将示例配置文件 applications/pnnl/DrivenMatlabAgent/config_waterheater 复制到 volttron/config。完毕

在 applications/pnnl/DrivenMatlabAgent 中安装 Drivenmatlabagent 时出错

(volttron)whygrene@ip-172-31-8-77:~/volttron$ python scripts/install-agent.py -s ./applications/pnnl/DrivenMatlabAgent/setup.py --start ERROR:install-agent.py :指定的代理源目录无效。

并在 matlab 服务器中运行 example.m 文件?我错过了什么吗