Core does not run 24/7

I have an Arduino controlled WiFi lighting system that uses MiLight LED bulbs and I’m trying to set up motion controlled lighting zones controlled by Spark Cores (I have two). Communication to the Arduino is via UDP which on my network is quite reliable. The Arduino controller (a Uno at the moment) runs 24/7 and controls the light zones in my house using programmed schedules and a light level.

At the moment the Cores run for some hours but eventually lose the local network, i.e. their IPs do not show in a network scanner. The Core appears to be functioning as it pulses cyan but the Cores do not respond to a UDP message nor do they send any. I have tried using the Core Management functions to disconnect the Core from the Cloud but the network connection is still lost.

Any help will be appreciated and if needed I can post my code.

Richard

Were your cores patched recently with deep_update?

Maybe some code to check whether the core is assigned an IP_address would be nice. :wink:

If it’s not, it can probably try to disconnect and connect to Wifi again for a couple of times before restarting itself as the final option.

Thanks for the quick reply. I forgot to say that the Cores are the black ones so I assumed that the deep_update was not required.

Maybe some code to check whether the core is assigned an IP_address would be nice.

where would this code be run? It would have to be on the core if it is to be useful in my application.

If it's not, it can probably try to disconnect and connect to Wifi again for a couple of times before restarting itself as the final option.

I know how to program a disconnect/connect sequence but how do I restart the Core?

I haven’t tested but something like System.reset(); should work.

You can check the status of WiFi.ready() and see if it returns a false. If that’s the case, perform a WiFi.disconnect() followed by WiFi.connect()

Documented here: http://docs.spark.io/firmware/#wifi-ready

Would recommend that you perform a deep_update even on the new cores to make sure that they are patched :wink:

Thanks for all the suggestions. I will certainly give them a go. I had overlooked all those WiFi functions in the documentation :blush:

They are fresh out of the oven 1-2 days back :wink:

I have been doing a lot of testing and I still end up puzzled!

I use the iOS app iNet on my iPhone to look at my network connections and with the same code running on my two Cores sometimes neither show on the network yet the UDP messages to my Uno are received and the acknowledgments are received back on the Cores. I also run the app UDP test tool on my iPhone and connect to the Cores, sometimes one will respond whilst the other doesn’t. So you can see why I’m puzzled.

I can also Ping IP addresses from the iNet app but most of the time the Cores do not respond. Should the Core respond to a ping sent from the iPhone app?

The latest CC3000 firmware patch disabled the ping function and the core should not be responding at all.

Have you already done the deep_update patch? We will have to wait for the Elites to chime in as i’m no way any experienced with TCP/UDP. :smiley: