What I want is to create an access point to which I can log in privately, but also where guests can log in with separate passwords.
Now I use the code below, but when I use it I only see 'GuestNetwork' and not 'MyNetwork' when I log in to my WiFi.
Is there a way to get this done?
#include <ESP8266WiFi.h>
const char* ssid = "MyNetwork";
const char* password = "password123";
const char* guestSsid = "GuestNetwork";
const char* guestPassword = "guestpassword456";
void setup() {
Serial.begin(115200);
WiFi.softAP(ssid, password);
delay(100); // Wait briefly to ensure the first network is set up before configuring the second one
WiFi.softAP(guestSsid, guestPassword);
WiFi.softAPConfig(IPAddress(192, 168, 1, 1), IPAddress(192, 168, 1, 1), IPAddress(255, 255, 255, 0));
Serial.println("Access Points started");
}
void loop() {
// Add any additional functionality here
delay(1000); // Prevent CPU overload
}
it is for a gate, I have the WiFi connection on my phone set to memorized and when I come close and unlock my phone, the gate is unlocked and that works well and I want I'd like to keep it that way.
Now I want guests with a code to be able to enter. and to be able to distinguish guests from admin without knowing MAC addresses, I thought I would do it that way.
You can add a password to the webserver. You have 1 AP with the same password, all can log onto, bit to access the webpages you need to enter a username + password. You ca in that way also set permissions fir different users.
Yes, the idea is certainly a good one, but the design is with an ESP-01 and I can still connect one via software serial, but I have very little space in that pillar and I also want to keep it neat.
you could take two ESP32 and you would heavily simplify your design... No need for a Nano + voltage adaptation + ESP01.
Some ESP32 have a builtin SD slot as well but if you don't need to remove the SD card, you could leverage the ESP32 flash drive to store information and get rid of the SD altogether...
You can really find small footprints, for example an XIAO ESP32C3 is pretty damn small...
I am now adjusting the code, WiFi without password, with WiFi connection it automatically goes to an HTML login page, where 1 password applies to the main user and 1 for the guest. let's see if I can make the password so that my phone can also save it, then it actually works as I thought without changing the hardware
There is a risk involving an open access point, being that the amount of devices connected is limited to 8, and that many phone will automatically connect to it, considering it a hotspot. That may not apply in your case, but it is information i want to add.
The issue is that it is actually your browser that needs to save it. (on desktop Chrome it can be done) But the good news is that the length is undefined, a 4 digit pin will also work (unlike wifi which requires a minimum of 8 characters)
Logging in with a laptop and remembering the password is no problem and he will be redirected immediately, I have not tried with Android. but iOS is indeed a problem. I'm still testing...
I (we) just experienced that open access points became in-accessible to us when there was a significant crowd at parties and festivals, which of course is hugely unpractical, so we switched to password protected SSID's My conclusion was that the 8 connecting devices were not one of ours anymore.
I am still programming and have certainly taken the security connections seriously, so I have a WiFi connection with a password, an HTML password for admin and guests with passwords stored in the memory of the ESP8266 so that they cannot be accessed from the HTML code. can be seen.
The only problem in the iPhone that does not want to automatically save and fill in the passwords. but I'm not ready and I don't plan on giving up. I will share how the codes are structured this week, then everything will be a lot clearer for everyone to think about. In any case, I thank everyone for their input so far.