12-27-2022, 02:17 PM
12-28-2022, 01:01 AM
Yes of course, the only you have to do is to change the code in the function connectToWiFiNetwork.
Code:
//================================================================= connectToWiFiNetwork
void connectToWiFiNetwork(){
Serial.print("Access Point"); // Default IP: 192.168.4.1
WiFi.mode(WIFI_AP); // Config module as Access point only.
boolean result = WiFi.softAP("Virtuino AP","my_password"); // set the Access point SSID and password
if(result == true) {
Serial.println("Server Ready");
Serial.println(WiFi.softAPIP());
}
else Serial.println("Failed!");
}
12-28-2022, 05:57 PM
(12-28-2022, 01:01 AM)iliaslamprou Wrote: [ -> ]Yes of course, the only you have to do is to change the code in the function connectToWiFiNetwork.
Code://================================================================= connectToWiFiNetwork
void connectToWiFiNetwork(){
Serial.print("Access Point"); // Default IP: 192.168.4.1
WiFi.mode(WIFI_AP); // Config module as Access point only.
boolean result = WiFi.softAP("Virtuino AP","my_password"); // set the Access point SSID and password
if(result == true) {
Serial.println("Server Ready");
Serial.println(WiFi.softAPIP());
}
else Serial.println("Failed!");
}
Hi iliaslamprou
Thx
One thing, when I want add a second client the Virtuino stops on he client that was working, and the new one doesn't connect.
Is it possible to connect more than one client or is this a ESP32 issue?
12-28-2022, 10:37 PM
Hello, you have to replace the WiFi with WiFiMulti
For ESP8266 declare the following lines on the top of the code
#include <ESP8266WiFiMulti.h>
ESP8266WiFiMulti WiFiMulti;
For ESP32 add the lines:
#include <WiFiMulti.h>
WiFiMulti WiFiMulti;
then replace the connection function with this
You can see some examples on the WebSockets library
For ESP8266 declare the following lines on the top of the code
#include <ESP8266WiFiMulti.h>
ESP8266WiFiMulti WiFiMulti;
For ESP32 add the lines:
#include <WiFiMulti.h>
WiFiMulti WiFiMulti;
then replace the connection function with this
Code:
//===================================================== connectToWiFiNetwork
void connectToWiFiNetwork(){
WiFiMulti.addAP("SSID", "passpasspass");
while(WiFiMulti.run() != WL_CONNECTED) {
delay(100);
}
Serial.println("\nWiFi connected");
}
You can see some examples on the WebSockets library