UDP connection lost

What is the best way to reestablish a UDP connection?

I have tried using System.reset() but it does not always work and it loses any debugging information that I have stored.

Hi @rjd47

Generally you call Udp.stop() and then call Udp.begin(…) again. You can check the return values from many of the Udp methods to see if they succeeded.

If you having a specific problem and can post your code, lots of folks here can help.


Thank you for the quick response, I will try your suggestion.

My Spark Cores are controlling my heating using the relay shield so the code is too big to expect anyone to wade through it. However, using your suggestion should give me more chance to get debugging information back.

I will post to say how I get on.


My heating app stopped just before midnight, at 23:59:15, and the Udp.stop() Udp.begin(…) sequence did not work. I have noticed before that the Udp on the core has stopped just before midnight.

The only code activated at midnight is the following

today = Time.weekday(); // Sunday = 1, Monday = 2, ..., Saturday = 7 today = (today + 5) % 7; // Monday = 0, Sunday = 6

that I use to get the current day as an integer.

The other thing that I have noticed is that the core running my heating app can still be pinged. Of the four cores that I am using it is the only one that can be pinged. I am surprised if the deep_update has not been done on it as it is a recent purchase.

Hey @rjd47,

That’s weird. Did the Web IDE prompt you to update? If it did not, the latest patch is already on the CC3000

No, the Web IDE did not prompt me to do the deep_update.

If that’s the case, it has been detected that your CC3000 patch is of the latest. ie. 1.29

You can always patch it again just to be sure and hopefully improve stability :smile: