WiFi Access Point Application
Overview
This application demonstrates how to configure a NetBurner device to operate as a WiFi Access Point (AP) with an integrated DHCP server. The application allows other devices to connect directly to the NetBurner module and automatically receive IP addresses.
Features
- WiFi Access Point mode operation
- Integrated DHCP server for automatic IP assignment
- Configurable network settings
- Client connection monitoring
- Serial interface for displaying connected clients
Default Configuration
The application uses the following default network settings:
- Access Point SSID:
NetBurnerAP
- Access Point Password:
password
- WiFi Interface IP:
192.168.3.1
- Subnet Mask:
255.255.255.0
- DHCP Start Address:
192.168.3.2
- WiFi Channel: 6 (802.11)
Network Setup
Recommended Configuration
For proper Access Point operation, configure your network settings as follows:
- WiFi Interface IP:
192.168.0.1 (or your preferred network)
- Subnet Mask:
255.255.255.0
- DHCP Start Address:
192.168.0.2
Configuration Methods
- IPSetup Tool: Use the NetBurner IPSetup utility to configure:
- WiFi interface IP address and subnet mask
- SSID and password settings
- Code Modification: Modify the default values in
main.cpp:
Used to store and manipulate IPv4 addresses in dual stack mode.
Definition nettypes.h:225
IPADDR4 AsciiToIp4(const char *p)
Convert an ASCII IPv4 string to an IP address.
How It Works
- Initialization: The application initializes the system and waits for network activation
- WiFi AP Setup: Configures the WiFi module in Access Point mode using SPI communication
- IP Configuration: Sets up the WiFi interface with IP address and subnet mask
- DHCP Server: Starts a DHCP server on the WiFi interface to assign IP addresses to connecting clients
- Monitoring: Provides serial interface to display connected DHCP clients
Function Parameters
The InitAP_SPI() function accepts the following parameters:
SSID: Network name (default from config if empty)
password: Network password (8-64 characters, default from config if empty)
channel: 802.11 channel (default: 6)
irqNum: Interrupt number (default: 3)
moduleNum: Module number (default: 1)
csNum: Chip select number
connectorNum: Connector number
gpioPinNum: GPIO pin number
resetPinNum: Reset pin number (default: 42)
Usage
- Compile and Deploy: Build and flash the application to your NetBurner device
- Connect: Use a WiFi-enabled device to connect to the
NetBurnerAP network with password password
- Access: The device will automatically receive an IP address via DHCP
- Monitor: Press any key in the serial terminal to display connected clients
- Web Access: Access the NetBurner web interface at the AP IP address (default:
192.168.3.1)
Serial Interface
The application provides a simple serial interface:
- Press any key to display currently connected DHCP clients
- System diagnostics are enabled for debugging (should be disabled in production)
Error Handling
The application includes error handling for:
- WiFi initialization failures
- DHCP server startup failures
- Network configuration issues
If errors occur, the application will display error messages and enter an infinite loop for debugging.
Production Considerations
- Security: Change the default SSID and password before deployment
- Diagnostics: Disable
EnableSystemDiagnostics() in production code
- Network Planning: Choose appropriate IP ranges that don't conflict with existing networks
- Channel Selection: Select an appropriate WiFi channel based on your environment
Troubleshooting
- WiFi fails to initialize: Check SPI connections and module configuration
- DHCP server fails: Verify IP configuration and ensure no conflicts
- Clients can't connect: Check SSID/password and WiFi channel settings
- No IP assignment: Verify DHCP start address is in the same subnet as the AP IP