Hi All,
How are people monitoring device-published events in custom non-particle software like Visual Studio, or Labview?
I have a working particle system that publishes events when a target is achieved. Great, but I also want a desktop program to catch that event and do stuff based on that event as well.
I have the Cloud API fully implemented in Labview and I am working on VB, but I have no way of basically subscribing to a webhook in either.
Is it possible to get non-particle systems to subscribe to a web-hook (or the equivalent)?
@jventerprises, have you looked at the node-js tools (Particle-api-js) available from Particle?
interesting. i use the Particle API all the time, but I never considered wrapping it in a labview shell. Basically, I could call the API via labview (as an external program) and parse the response.
I think it would work, but it seems a little round-about.
I will give it a try. I will also post my results when I am sure things are working.
I receive Particle events into my own code by implementing the Server Sent Events (SSE) protocol directly in Java, but it can be done from any language that supports either HTTP or TCP connections. SSE works by having your software make an outbound connection to the Particle cloud servers and leaving it open. The Particle cloud pushes events in near real time down the connection when they occur. It’s fast and efficient, and doesn’t require messing with firewalls or NAT. It works great!
2 Likes
Hi,
thanks for the info. I started with SSE at first (via the Cloud API) but I just cant seem to get it to work. I will keep trying. I just cant seem to make that initial outbound connection.
in the meantime I just wrapped some particle CLI commands in a .bat file to open a stream, redirected the STDOUT to a file, and parsed the file for the events. not clean, but it does work.
I dont suppose you would want to post a snippet of code that shows how you connect the particle SSE?