No WiFi connection without Arduino IDE serial monitor

I recently have an Arduino MKR1000. I use the WiFi Shield 101 Library Example: WiFi Web Client Repeating

The MKR1000 is connected through USB. When I view the serial monitor in the Arduino software IDE, the MKR1000 connects to the wireless network perfectly. However, when the Arduino software IDE and serial monitor is not running, the MKR1000 doesn't connect to the wireless network at startup. Until I start the Arduino software IDE serial monitor, the MKR1000 connects again.

This issue makes it currently impossible to connect the MKR1000 to a wireless network with an external power source.

Hi @jandever.

The example sketch is waiting for something to connect to a Serial monitor. If you remove the following from the setup function, it will no longer do so.

  while (!Serial) {
    ; // wait for serial port to connect. Needed for native USB port only
  }