Arduino MKR1000 as Access Point I want to turn my Arduino MKR1000 into an Access Point. My code is the following:

#include &lt;SPI.h&gt;
#include &lt;WiFi101.h&gt;
#define PubNub_BASE_CLIENT WiFiClient
#include &lt;PubNub.h&gt;

WiFiServer server(80);
char ssid[] = "MKR1000";
int status = WL_IDLE_STATUS;

void setup() {
  delay(1000);
  Serial.begin(9600);
  Serial.print("Creating access point named: ");
  Serial.println(ssid);
  if (WiFi.beginAP(ssid) != WL_CONNECTED) {
    Serial.println("Creating access point failed");
    while (true);
  }
  server.begin();
  printStatus();
}

void loop() {

}

void printStatus() {
  Serial.print("SSID: ");
  Serial.println(WiFi.SSID());
  IPAddress ip = WiFi.localIP();
  Serial.print("IP Address: ");
  Serial.println(ip);
  long rssi = WiFi.RSSI();
  Serial.print("signal strength (RSSI):");
  Serial.print(rssi);
  Serial.println(" dBm");
  Serial.print("To connect, join the network and open a browser to http://");
  Serial.println(ip);
}


After uploading this, in the serial monitor I get this:

Creating access point named: MKR1000
Creating access point failed


I'm new to this so I really don't know what's the problem. I hope someone knows what's going on.Thank you in advance.
I found this reference for Wifi.beginAP() in the Wifi101 library, which I hope is the correct one - apologies if it's not.

It says that beginAP() returns either WL_AP_LISTENING or WL_CONNECT_FAILED, so checking for WL_CONNECTED is not sensible.

Try this:

if (WiFi.beginAP(ssid) != WL_AP_LISTENING) {
  Serial.println("Creating access point failed");
  while (true);
}