Is the Spark Core WiFi a good choice for real-time sampling of data?

Let’s say I have the Spark Core connected to an accelerometer, and I want to sample and plot data continuously. I know I can use the Serial interface to do just that.

But is it practical to do the same over WiFi? My understanding is that you cannot talk directly from your phone/computer to the Spark Core. It has to always go through the cloud?

So my thinking is that if you need real time data collection ability (wireless) for a device that uses the Spark Core, you need add some other mechanism like Bluetooth?


I don’t know if it’s useful for this type of application, but you can use TCP/UDP connections, which don’t require the cloud. That way you have ‘direct’ connection. Some others may need to chime in here for further clarification, so don’t take my word on this one.

1 Like

So the core could run a TCP server, or broadcast UDP packets? It would be great to hear from someone who has used it this way for data acquisition. Thanks.

Yes it can do TCP and UDP (with some glitches) and if you use the forum search and have a look at the official firmware documentation you’ll find plenty of input.



I tried this with a TCPServer and it’s working nicely. You can pass on the IP address/port number via a Spark.variable to the client.

You could always buffer the data to the storage on the spark, and then retrieve the buffer from the web service. This is generally a good way to provide some tolerance around connectivity failures. The Flashee library provides a circular buffer API.

1 Like