1

Can somebody please provide an example for sending (and if possible also receiving) messages using basic ZMQ socket from some external python script. I understand that we can use Agent objects and their vip.pubsub.publish and vip.pubsub.subscribe methods to do this, but I feel like having a whole agents objects, and letting them run in background adds unnecessary complexity to scripts that just need a simple way to access the VIP message bus.

Thank you.

Craig
  • 949
  • 1
  • 5
  • 13
rajendra
  • 472
  • 3
  • 18
  • I do not understand what you are trying to acheive ? Are you trying to make a driver in volttron or an agent in volttron ? Because in volttron as far as I have seen they make the socket connection and not the agents. Plus agents as far as I understand have only the task to subscribe another devices topics via drivers. – Priyank Kapadia Jul 02 '16 at 20:08
  • I have python based web server application. I need a simple way to send and receive messages from the message bus from python program in the web server. – rajendra Jul 02 '16 at 20:31
  • In the case I assume that you are trying to send and receive from the message bus. There are two possibilities: 1. What are trying to send from message bus ? Is it specific device information or is it everything ? – Priyank Kapadia Jul 02 '16 at 22:07
  • It could be anything really. I am looking for a generic solution. – rajendra Jul 02 '16 at 22:58

1 Answers1

0

While this is possible, it would require re-implementing the vip protocol. The best way to do this is to use the internal web service that is available through the platform itself.

Your agent will register with the master web service either a python callback or a static directory and a regular expression for routing.

Craig
  • 949
  • 1
  • 5
  • 13