NetBurner 3.5.6
PDF Version
Configure AP with JSON

WiFi Configuration Access Point with JSON

Overview

This NetBurner application configures the WiFi interface as an access point to provide users with a convenient way to connect to local wireless networks. The application creates a web-based configuration interface that allows users to scan for and connect to available WiFi networks.

Note
The difference from the previous ConfigAP example is that the list of networks is generated using JavaScript to parse a JSON object sent by the NetBurner which contains the access point scan results.

For the user's convenience, the device's SSID and WiFi Interface IP address are printed out the serial port. These can be used to access the device's webpage, which allows the user to connect to a local network.

Key Features

  • Automatic Access Point Creation: If no network SSID is configured, the device automatically starts as a WiFi Access Point
  • Network Scanning: Scan for and display available local wireless networks
  • Web-based Configuration: User-friendly webpage for network selection and connection
  • JSON-based Communication: JavaScript parsing of JSON objects containing scan results
  • Custom Branding Support: Configurable SSID prefix for custom product branding
  • Serial Interface: Command-line interface for manual WiFi operations

How It Works

Initial Startup

  1. On boot, the application checks for a stored network SSID
  2. If no SSID is found, it creates a WiFi Access Point
  3. The access point SSID follows the format: NB_<last 6 bytes of MAC>
    • Example: NB_012345
  4. The device's SSID and IP address are printed to the serial port

Configuration Process

  1. Users connect to the NetBurner's access point using a WiFi-enabled device
  2. Navigate to the device's webpage using the provided IP address
  3. The webpage displays a list of available networks (generated via JavaScript)
  4. Users select their desired network and enter credentials
  5. The device connects to the selected network and stores the configuration

Custom Branding

To customize the access point SSID prefix, uncomment and modify this line in main.cpp:

extern const NB::SSID_t default_SSID_Prefix = { 4, "FOO_" };

Serial Commands

The application provides several serial commands for manual WiFi management:

  • C - Connect to WiFi network
  • D - Disconnect from current network
  • R - Reset stored WiFi SSID
  • S - Perform network scan
  • W - Display WiFi status and configuration
  • X - Reset WiFi module
  • Z - System reboot

Technical Details

WiFi Security Support

The application supports multiple security protocols:

  • Open (no security)
  • WEP
  • WPA
  • WPA2
  • WPS

Cipher Support

  • None
  • TKIP
  • AES
  • Mixed (TKIP/AES)

Network Information Display

When connected, the application displays:

  • SSID (network name)
  • BSSID (access point MAC address)
  • Signal strength (RSSI)
  • Channel
  • Security type
  • Cipher method
  • IP configuration (address, mask, gateway, DNS)

Configuration Options

The application allows customization of default settings by uncommenting and modifying these variables:

// Default DHCP lease start address for AP mode
// extern const IPADDR4 configAP_LeaseStart(192, 168, 0, 2);
// Default IP address for AP mode
// extern const IPADDR4 configAP_IPAddr(192, 168, 0, 1);
// Custom SSID prefix for branding
// extern const NB::SSID_t default_SSID_Prefix = { 4, "FOO_" };

Usage Instructions

  1. First Time Setup:
    • Power on the NetBurner device
    • Connect to the NB_XXXXXX access point
    • Open a web browser and navigate to the device's IP address
    • Select your WiFi network and enter credentials
  2. Subsequent Startups:
    • The device will automatically connect to the stored network
    • If connection fails, it will revert to access point mode
  3. Manual Configuration:
    • Use serial commands for direct control
    • Monitor connection status and network information

Development Notes

  • The application uses SPI communication for WiFi operations
  • Web server runs on default port 80
  • System diagnostics are enabled (should be disabled for production)
  • Configuration mirroring is enabled for debugging
  • The application includes comprehensive error handling and status reporting