I want to turn my Arduino MKR1000 into an Access Point. My code is the following:
#include <SPI.h>
#include <WiFi101.h>
#define PubNub_BASE_CLIENT WiFiClient
#include <PubNub.h>
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.