Title: SD Card Configuration Description: Automatically load WiFi and WiGLE settings from SD card URL: /v2.1/gps/sd-card-config/ Version: v2.1 Section: GPS & Wardriving Search index: /search-index.json # SD Card Configuration > Automatically load WiFi and WiGLE settings from SD card ## On this page - [Quick Start](#quick-start) - [Configuration File Format](#configuration-file-format) - [Configuration Fields](#configuration-fields) - [Notes](#notes) - [Getting Your WiGLE Token](#getting-your-wigle-token) - [Option 1: Encoded for Use Token (Recommended)](#option-1-encoded-for-use-token-recommended) - [Option 2: Legacy API Format](#option-2-legacy-api-format) - [Loading Configuration](#loading-configuration) - [Via GUI (Display Builds)](#via-gui-display-builds) - [Via Command Line](#via-command-line) - [How It Works](#how-it-works) - [JIT Mounting (Banshee Boards)](#jit-mounting-banshee-boards) - [Standard Mounting](#standard-mounting) - [Settings Storage](#settings-storage) - [Use Cases](#use-cases) - [Quick Device Setup](#quick-device-setup) - [Field Deployment](#field-deployment) - [Token Updates](#token-updates) - [Backup Configuration](#backup-configuration) - [Troubleshooting](#troubleshooting) - [“SD mount failed”](#sd-mount-failed) - [“Config file not found”](#config-file-not-found) - [“Failed to parse config”](#failed-to-parse-config) - [Settings Not Applying](#settings-not-applying) - [Example Configurations](#example-configurations) - [Minimal WiFi Only](#minimal-wifi-only) - [WiGLE Only](#wigle-only) - [Complete Configuration](#complete-configuration) - [Legacy API Format](#legacy-api-format) - [Security Considerations](#security-considerations) - [Related Commands](#related-commands) - [See Also](#see-also) --- Load WiFi credentials and WiGLE settings from a configuration file on your SD card for quick device setup. ## Quick Start - Create a file named config.cfg in the root of your SD card - Add your settings (see format below) - Load via Settings → WiGLE → Load Config from SD or CLI command loadconfig - Confirm loaded settings in the popup/output ## Configuration File Format Create config.cfg in the root directory of your SD card (/mnt/ghostesp/config.cfg): #------------- #-----WIFI---- #------------- SSID=YourNetworkName PASSKEY=YourWiFiPassword #------------ #------Wigle- #------------ # Encoded for Use token from Wigle.net/account # Auto Upload Values = true/false # Donate values = true/false (true preferred) EncodedForUseToken=YourBase64EncodedToken AutoUpload=true Donate=true ## Configuration Fields Field | Required | Description | SSID | Optional | WiFi network name to connect to | PASSKEY | Optional | WiFi password | EncodedForUseToken | Optional | WiGLE “Encoded for Use” token from [wigle.net/account](https://wigle.net/account) | AutoUpload | Optional | Enable automatic upload when WiFi connects (true/false) | Donate | Optional | Share wardriving data with WiGLE (true/false, recommended: true) | ### Notes - All fields are optional - only include what you want to configure - Lines starting with # are comments and ignored - Blank lines are ignored - Field names are case-insensitive (SSID = ssid = Ssid) ## Getting Your WiGLE Token ### Option 1: Encoded for Use Token (Recommended) - Log in to [wigle.net](https://wigle.net) - Go to [wigle.net/account](https://wigle.net/account) - Find the “Encoded for Use” token in the API section - Copy the entire base64-encoded string - Paste it as EncodedForUseToken= in your config.cfg Example: EncodedForUseToken=QUlEMTIzNDU2Nzg5MDphYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5eg== ### Option 2: Legacy API Format If you prefer the legacy format, you can still use APIName:APIToken: # Legacy format still works EncodedForUseToken=AID0123456789:abcdefghijklmnopqrstuvwxyz123456 The system automatically detects the format: - No colon: Treated as pre-encoded token (used directly) - With colon: Treated as APIName:APIToken (base64 encoded automatically) ## Loading Configuration ### Via GUI (Display Builds) - Insert SD card with config.cfg in root directory - Navigate to Settings → WiGLE - Select “Load Config from SD” - Review the confirmation popup showing loaded settings: WiFi SSID (if configured) - WiGLE token status (set/not set) - AutoUpload status - Donate status ### Via Command Line loadconfig Example Output: Loading config from SD card... WiFi SSID: MyHomeNetwork Wigle token: Set AutoUpload: true Donate: true Configuration loaded successfully ## How It Works ### JIT Mounting (Banshee Boards) On boards where the SD card and display share an SPI bus (like Wired Hatters Banshee), the system uses Just-In-Time (JIT) mounting: - Display SPI is suspended - SD card is mounted - Config file is read - Settings are saved to NVS - SD card is unmounted - Display SPI is resumed This prevents display freezes during SD access. ### Standard Mounting On boards with dedicated SPI buses, the SD card remains mounted during the entire operation. ### Settings Storage All settings from config.cfg are saved to Non-Volatile Storage (NVS), so they persist across reboots even if the SD card is removed. ## Use Cases ### Quick Device Setup Set up multiple devices quickly by copying the same config.cfg to each SD card. ### Field Deployment Pre-configure devices before deployment - no need to connect to CLI or navigate menus. ### Token Updates Easily update WiGLE credentials across multiple devices by updating config.cfg. ### Backup Configuration Keep a backup config.cfg with your preferred settings for easy restoration. ## Troubleshooting ### “SD mount failed” - Ensure SD card is properly inserted - Check that SD card is formatted (FAT32 recommended) - Verify SD card is not corrupted ### “Config file not found” - Verify file is named exactly config.cfg (case-sensitive) - Ensure file is in the root directory of SD card, not in a subfolder - Check that file path is /mnt/ghostesp/config.cfg ### “Failed to parse config” - Check file format matches the example above - Ensure no invalid characters in values - Verify field names are spelled correctly ### Settings Not Applying - Check NVS storage is not full (run settings list to verify CLI access) - Verify values are valid (e.g., true/false for boolean fields) - Try loading config again ## Example Configurations ### Minimal WiFi Only SSID=MyNetwork PASSKEY=MyPassword123 ### WiGLE Only EncodedForUseToken=QUlEMTIzNDU2Nzg5MDphYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5eg== AutoUpload=true Donate=true ### Complete Configuration #------------- #-----WIFI---- #------------- SSID=WarDriveNet PASSKEY=SecurePassword456! #------------ #------Wigle- #------------ EncodedForUseToken=QUlEMTIzNDU2Nzg5MDphYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5eg== AutoUpload=true Donate=true ### Legacy API Format # Using legacy APIName:APIToken format EncodedForUseToken=AID0123456789:abcdefghijklmnopqrstuvwxyz123456 AutoUpload=false Donate=true ## Security Considerations - Config file contains sensitive information (WiFi password, API tokens) - Keep SD card secure when not in device - Consider encrypting sensitive values if sharing config files - Delete config.cfg after loading if you’re concerned about physical access - Remember: Settings persist in NVS after loading, so config.cfg can be removed ## Related Commands Command | Description | loadconfig | Load settings from config.cfg on SD card | wigle show | Display current WiGLE settings | wifistatus | Display current WiFi connection and saved SSID status | settings list | List all available settings | ## See Also - [WiGLE Upload Guide](/v2.1/gps/wigle/) - Complete WiGLE integration documentation - [SD Card Setup](/latest/getting-started/sd-card/) - SD card formatting and mounting - [WiFi Configuration](/v2.1/wifi/) - WiFi setup and management