- Project Overview
- Key Features
- Installation Instructions
- Usage Examples
- API Reference
- Customization
- License
NF_WiFiManager is a robust web-based Wi-Fi configuration manager designed for ESP32 devices running .NET nanoFramework. It allows dynamic and secure configuration of Wi-Fi settings through a built-in web portal, eliminating the need for hardcoded network credentials. If the device fails to connect to previously saved credentials, it automatically transitions into Access Point (AP) mode for easy configuration.
- Automatic Wi-Fi Connection: Tries to reconnect to known networks, and automatically falls back to AP mode if unsuccessful.
- Web-based Configuration Portal: Easy-to-use built-in web server accessible via any standard browser.
- Persistent Storage: Securely saves Wi-Fi credentials across device reboots.
- WPA2 Security: The configuration portal AP is secured by WPA2 encryption.
- Lightweight Implementation: Minimal resource usage tailored for .NET nanoFramework and ESP32.
- ESP32 board with the latest nanoFramework firmware installed.
- Visual Studio 2019/2022 with nanoFramework extension installed.
- Clone the repository
git clone https://github.com/unrealbg/NF_WiFiManager.git
- Open and Build
- Open
NF_WiFiManager.sln
in Visual Studio. - Ensure NuGet packages are restored, including:
nanoFramework.System.Device.Wifi
nanoFramework.Networking
nanoFramework.Runtime.Native
- Build the solution.
- Deploy
- Deploy the solution to your ESP32 device via the Visual Studio nanoFramework extension.
- Flash and reboot the device.
- The device enters AP mode, broadcasting
nF_Config
(default passwordpassword123
). - Connect your device (smartphone/laptop) to the AP network.
- Navigate to
http://192.168.4.1/
in a web browser. - Fill out the Wi-Fi SSID and password fields, then submit.
- The device saves the credentials and reboots automatically to connect to your network.
- Turn off the previously configured Wi-Fi network or force AP mode programmatically.
- Follow the same steps as the initial configuration to update Wi-Fi credentials.
Below is an example of integrating NF_WiFiManager into your application's startup logic:
using NF_WiFiManager.AP;
using NF_WiFiManager.WiFi;
using NF_WiFiManager.Web;
bool connected = WiFiConnectionManager.TryConnect(60000);
if (!connected)
{
AccessPointManager.SetupAccessPoint();
WebServer.Start();
}
TryConnect(int timeoutMilliseconds)
: Attempts to connect to stored Wi-Fi within a given timeout period.
SaveConfiguration(string ssid, string password)
: Saves new Wi-Fi network credentials.
SetupAccessPoint()
: Initializes and starts the device in AP mode for configuration.
Start()
: Launches the built-in web server and configuration portal.
- Provides HTML pages for Wi-Fi configuration, success messages, and error messages.
- Parses URL-encoded form submissions for the web server.
Modify AP settings (SSID/password) and other parameters by editing AccessPointManager.cs
before deployment.
NF_WiFiManager is released under the MIT License. For more information, see the LICENSE.txt file included in the repository.
Feel free to contribute, suggest features, or report issues through GitHub!