Search code examples
volttron

Volttron - object has no attribute 'vip'


While trying to call RPC method of another agent (pricepoint.agent) from one of my agent( smartstripui_srv.agent), there is an error - " INFO: 'SmartStripUI_Srv' object has no attribute 'vip'"

smartstripui_srv.agent is inheriting PublishMixin, BaseAgent.

I had tested calling RPC method of pricepoint.agent from a simple Agent and it is working.

In the case of an agent inheriting PublishMixin, BaseAgent, it seems that I might be missing setting some parameter.


Solution

  • PublishMixin and BaseAgent and everything else in volttron.platform.agent.base are for supporting backwards compatibility with VOLTTRON 2.0 Agents.

    Don’t use them.

    Inheriting from volttron.platform.vip.agent.Agent will give you everything you need to publish, subscribe, and do RPC calls and take full advantage of VOLTTRON 3.0 features and will make available the vip object in your agent.

    Unfortunately we failed to move everything that was not for backward compatibility out of volttron.platform.agent when we released VOLTTRON 3.0. There are things in there that are still vital to 3.0 Agents such as the utils module.