Is Core able to connect to a Java Socket?

Hi Folks, now that I have gotten past some initial connection issues, I would like to get some ideas from the folks here. It would seem that part of architecture of the spark core is the use of the cloud to manage events from sensors. I have a very simple Java Program running that accepts socket connections. Would it be relatively straight forward to establish a connection to this socket from the Spark Core…is that supported? I would like to have the Spark Core send sampling data every X seconds to the Java Socket and have the Core Listening for web commands that could change the sampling interval?

Any thoughts…going to start reading the documentation but thought someone might be able to give me a jump start :slight_smile:

Thanks,
Scott

1 Like

Java has nothing to do with it. The Spark can create and receive TCP connections and UDP packets without issue.

(To clarify, Java opens TCP sockets, just like the Spark Core can. The Spark Core can connect to TCP sockets, independent of the actual language that is controlling them.)

Refer to the API docs on how to do it. http://docs.spark.io/firmware/#communication-tcpclient

Thanks for the reply. I will try this function call and see how it goes. I have a small Java program written that I would like to be the receiver of all events that the spark core generates. I will keep you posted on my progress or lack thereof :smile:

1 Like

Please do. If you have issues, post your code and we can take a look and help.