Anybody have SparkCore Consistently sending data to Xivley for more than 24 hours without issues?

I would like to try to use the Spark Core to forward sensor data to Xivley for recording and graphing over time.

Has anybody successfully used the Spark Core to send data to Xivley for longer than 24 hours straight without any errors or a need to reset the Spark Core?

I see a few threads with people getting it setup but it seems the data send to Xivley is off for some reason or the Spark Core needs reset eventually.

I would like to start by sending temp and humidity sensor data to Xivley but wanted to see if anybody does this already successfully and if any tweaks were needed what they were.

I basically want to do this but with the Spark Core:

I have figured out that you can’t use any delays longer than 15 seconds or the connection to the wifi will not be stable. I had a 60 second delay and the core would not maintain a wifi connection. I backed the delay down to 1000ms and it will maintain the wifi connection and core cloud connection successfully so far which is good.

Any help is appreciated.

What if instead of a 60 seconds delay you have a 10 iterations loop over a 6 seconds delay? May be this would allow the core to maintain the connection?

I have just started a prototype sending data to Xively a couple of hours ago, I’ll tell you how it turns

I didn’t really need the 60 second delay, I was just playing around with the LED blink sketch and just happened to find out that a delay that long caused the WiFi connection to drop out. I’m going to assume that there are must be ways of accomplishing the same delay function with another method that does not cause WiFi dropout.

About the Xivley and the testing your about to do please do post your results here for everyone to see. I think Xivley or Plotly would be great platforms for the Spark Core to work with to store, plot, and graph sensor data sent over the web.

I’m short on free time right now so getting your feedback will help me save time if there issues that you encounter that need solved by people alot smarter than I am at this.

Best to avoid a delay and use something like this to do something at regular intervals:


unsigned long lastMillis = 0;
  if(millis() > lastMillis + (INTERVAL_IN_SECONDS * 1000)){
     //Do your task here

     lastMillis = millis();

This approach allows the core to do other things in between intervals, a kind of pseudo multitasking. :smile:

So, basically I’ve just merged two pieces of existing code: the one adapted from the DHT library and another posted in this forum showing an example of publishing data to Xively.

It’s running continuously since yesterday evening and now it’s close to 24 hours. I see from time to time the heartbeat led blinking green, but this may be because of both pieces of code using delay(). Needs refactoring :wink:

Though, the graphs of the uploaded data shows nicely and provide interesting information, basically you can see a peak in humidity this morning during the breakfast / shower time and then later tonight when I opened the windows to get some fresh air.

Usually the blinking green just means that it has lost connection to your Wifi and it will then quickly reconnect to it without issues. I get problems if my Wifi data stream to the net gets lost and then the blue LED flashes and the Spark Core needs reset.

Try pulling the Internet Feed to your wireless router so your WiFi looses a connection to the internet and see if the Spark Core starts flashing Blue and locks up. That’s what is happening to everybody it seems.

If you unplug your WiFi completely then the Spark should flash green and successfully connect to the Wifi and Spark Cloud without issues.

Here are my Xivley graphs: