TCP/Websocket Agent: Polling

Howdy community, I trust that you are well!

I have a BLE mesh network interface which runs on TCP or Websocket server. I moved to TCP because my websocket server does not receive messages from OR but it works with postman. I have a certain message in JSON format to get active energy from a BLE mesh device which is sent to my TCP server.

It all works, I can get the received data back (P.S when sending data back to OR via a TCP client make sure that you add a \n delimitter to the end of your message, by default OR uses this to determine the end of a message).

I also got all the filters etc working, if anyone is interested in this I can post a guide on how to get basic json filters working.

The ultimate question I have, is how do I get OR to automatically poll this data i.e. Send the message to my client say every 60s. I know you can do this with the HTTP agent as shown in the Weather asset tutorial, but it does not look like you can do this with other agents, at least not TCP and Websocket… I have seen a pollMillis attribute in these agents but it does not look like its doing anything…

Any help would be greatly appreciated!


I don’t believe we’ve built logic to support polling connections for other protocols than HTTP.

Of course writing a custom agent can fix this,
but let me ask @Rich here as I might forget about some functionality or workarounds haha

Hi Martin, thanks for the reply!

I don’t mind going down that route but I am not sure what the licensing implications would be.

I am trying to go with what is available as far as possible.

Perhaps some groovy rules could be used to do this, just feels a bit hacky…

Hopefully I’ve read this correct…

No built in support for periodically publishing content within an agent; as you mention HTTP allows periodic polling for the reason it is a request response protocol.

I’m not against having this functionality added but I think a rule could be an ok solution

Okay perfect, thanks for your feedback.