UDP over WiFi stops after a few minutes


I am having problems with sending short UDP packets from MKR1000. The code runs for between 5000 and 7000 sends. Then the loop keeps going but no UDP packets appear on the WiFi (I have been using Wireshark to monitor the packets on the WiFi).

I also tried an Adafruit Feather M0 WiFi with ATWINC1500 which has the same problem.

I would very much appreciate some help, I have tried everything I can think of.

Here is a short test program that shows the problem:

#include <SPI.h>
#include <WiFi101.h>
#include <WiFiUdp.h>

char ssid[] = "xxx";     //  your network SSID (name)
char pass[] = "yyy";  // your network password
int status = WL_IDLE_STATUS;     // the Wifi radio's status

IPAddress remIP(192, 168, XX, XX); // Remote IP address of UDP receiver 

int c = 0;

WiFiUDP Udp;

void setup() {
  while (!Serial) {

  if (WiFi.status() == WL_NO_SHIELD) {
    Serial.println("WiFi shield not present");
    // don't continue:
    while (true);

  while ( status != WL_CONNECTED) {
    status = WiFi.begin(ssid, pass);

 Serial.println("Connected to the network");


void loop() {

  c += 1;
  Udp.beginPacket(remIP, 8001);




I met the same problem, Have your problem solved?