I'm using this code to create an access point on arduino rev 4 wifi, but I would like to increase the number of wifi networks for educational purposes and in particular I would like to create 2 wifi networks with different names and 2 wifi networks with the same names, could anyone tell me how to do it? thanks
(using the instruction WiFi.beginAP(ssid, pass);
several times it doesn't create wifi anymore but I always only get one)
#include "WiFiS3.h"
///////please enter your sensitive data in the Secret tab/arduino_secrets.h
char ssid[] = "Test12345"; // your network SSID (name)
char pass[] = "Test12345"; // your network password (use for WPA, or use as key for WEP)
int keyIndex = 0; // your network key index number (needed only for WEP)
int status = WL_IDLE_STATUS;
void setup() {
//Initialize serial and wait for port to open:
Serial.begin(9600);
while (!Serial) {
; // wait for serial port to connect. Needed for native USB port only
}
Serial.println("Access Point Web Server");
// check for the WiFi module:
if (WiFi.status() == WL_NO_MODULE) {
Serial.println("Communication with WiFi module failed!");
// don't continue
while (true);
}
String fv = WiFi.firmwareVersion();
if (fv < WIFI_FIRMWARE_LATEST_VERSION) {
Serial.println("Please upgrade the firmware");
}
// by default the local IP address will be 192.168.4.1
// print the network name (SSID);
Serial.print("Creating access point named: ");
Serial.println(ssid);
// Create open network. Change this line if you want to create an WEP network:
status = WiFi.beginAP(ssid, pass);
if (status != WL_AP_LISTENING) {
Serial.println("Creating access point failed");
// don't continue
while (true);
}
// you're connected now, so print out the status
printWiFiStatus();
}
void loop() {}
void printWiFiStatus() {
// print the SSID of the network you're attached to:
Serial.print("SSID: ");
Serial.println(WiFi.SSID());
// print your WiFi shield's IP address:
IPAddress ip = WiFi.localIP();
Serial.print("IP Address: ");
Serial.println(ip);
// print where to go in a browser:
Serial.print("To see this page in action, open a browser to http://");
Serial.println(ip);
}