This guide explains how to use the enhanced logging to debug WiFi detection issues in the Home Assistant plugin.
The plugin has been enhanced with comprehensive logging to help diagnose issues where:
- WiFi networks appear to be in range but aren't detected by the plugin
- Automatic network switching doesn't work as expected
- Data transmission conditions aren't being met
- Open the plugin settings in AndrOBD
- Enable "Enable Logging" option
- Use the "View Logs" button to see real-time logs
When the plugin starts, you'll see:
[timestamp] INFO: Android version: 33 (13), Device: Samsung SM-G998B
[timestamp] INFO: WiFi enabled: true
[timestamp] INFO: Plugin initialization complete
What to check:
- Confirm Android version matches your device
- Verify WiFi is enabled
- If WiFi is disabled, the plugin cannot scan for networks
Every 30 seconds (in ssid_in_range mode), the plugin checks WiFi state. Look for this structure:
[timestamp] DEBUG: === WiFi State Check Started ===
[timestamp] DEBUG: Transmission mode: ssid_in_range
[timestamp] DEBUG: Configured Home SSID: 'MyHomeNetwork'
[timestamp] DEBUG: Configured OBD SSID: 'OBDII' (auto-switch enabled)
What to check:
- Verify transmission mode is correct (realtime, ssid_connected, or ssid_in_range)
- Confirm configured SSIDs match your networks exactly (case-sensitive)
- Check if SSIDs have any special characters or spaces
When scanning for networks, you'll see detailed output:
[timestamp] DEBUG: Scanning for WiFi SSID: 'MyHomeNetwork'
[timestamp] DEBUG: WiFi enabled: true
[timestamp] DEBUG: WiFi scan started: true (Android 33)
[timestamp] DEBUG: WiFi scan found 8 networks:
[timestamp] DEBUG: - SSID: 'MyHomeNetwork' Signal: -45 dBm
[timestamp] DEBUG: - SSID: 'NeighborWiFi' Signal: -72 dBm
[timestamp] DEBUG: - SSID: 'OBDII' Signal: -38 dBm
[timestamp] DEBUG: - SSID: '<hidden>' Signal: -80 dBm
[timestamp] INFO: Target WiFi found in range: 'MyHomeNetwork' (Signal: -45 dBm)
What to check:
- If "WiFi scan found 0 networks" appears, the device isn't detecting ANY networks
- This could indicate location permissions are not granted (required on Android 6+)
- WiFi scanning may be throttled (Android 9+ limits background scans)
- If networks are found but your target isn't listed:
- Verify the SSID spelling matches exactly (including capitalization)
- Check if your network is hidden (will show as
<hidden>) - For hidden networks, the plugin cannot detect them by SSID
- Signal strength indicators:
- -30 to -50 dBm: Excellent signal
- -50 to -60 dBm: Good signal
- -60 to -70 dBm: Fair signal
- -70+ dBm: Weak signal (may have connectivity issues)
If the target WiFi isn't found:
[timestamp] DEBUG: Target WiFi 'MyHomeNetwork' NOT found in scan results
Common causes:
- SSID mismatch: Double-check spelling and capitalization
- Hidden network: Plugin cannot detect hidden SSIDs by name
- Out of range: Device is too far from the access point
- Network disabled: The access point is turned off
- 5GHz vs 2.4GHz: Some devices can't scan 5GHz networks
When checking if connected to a specific network:
[timestamp] DEBUG: Connection check: Currently connected to 'OBDII', target is 'MyHomeNetwork', match: false
What to check:
- Verify you're connected to the expected network
- If "No active network" appears, device has no internet connection
- If "Not connected to WiFi (type: MOBILE)", device is using cellular data
If you see security exceptions:
[timestamp] ERROR: Security exception during WiFi scan - location permission may be required (Android 33): ...
What to do:
- Go to Android Settings → Apps → AndrOBD Plugin Home Assistant
- Grant Location permission (required for WiFi scanning on Android 6+)
- Restart the plugin
When checking if data should be sent:
[timestamp] DEBUG: Checking if data should be sent - Mode: ssid_in_range, Internet: true, Home connected: false, Home in range: true
[timestamp] DEBUG: SSID in range mode check: connected=false, in_range=true, internet=true -> SKIP
[timestamp] INFO: Home WiFi in range but not connected - switch networks to transmit buffered data
Understanding transmission modes:
-
realtime: Sends whenever internet is available
- Check: "Internet: true"
-
ssid_connected: Only sends when connected to home WiFi
- Check: "Home connected: true" AND "Internet: true"
-
ssid_in_range: Sends when connected to home WiFi (not just in range)
- Check: "Home connected: true" AND "Internet: true"
- If "Home in range: true" but "Home connected: false", you need to switch networks
If scans consistently return empty:
[timestamp] WARNING: WiFi scan results are empty - no networks detected (0 networks)
Possible causes:
- Android 9+ throttling: Background WiFi scans are limited
- Apps can only scan 4 times per 2-minute period when in background
- Solution: Keep AndrOBD in foreground or wait between scans
- Location services disabled: Required for WiFi scanning
- Enable Location in Android settings
- WiFi disabled: Turn on WiFi in Android settings
- Permission denied: Grant location permission to the app
Debug steps:
- Check if scan found ANY networks at all
- Verify SSID spelling matches exactly
- Confirm location permission is granted
- Check if network is hidden
- Verify WiFi is enabled on device
- Check Android version for scan throttling (Android 9+)
Debug steps:
- Compare configured SSID with scan results list exactly
- Check for extra spaces or special characters
- Try connecting to the network manually, then check logs to see the exact SSID format
- For hidden networks, you cannot use SSID-based detection
[timestamp] DEBUG: WiFi scan started: false (Android 33)
This means:
- On Android 9+, scan request was throttled (too many recent scans)
- Wait 2 minutes and try again
- Keep app in foreground to avoid throttling
Solution:
- Open Android Settings
- Go to Apps → AndrOBD Plugin Home Assistant
- Go to Permissions
- Grant Location permission (Fine Location or Coarse Location)
- Restart the app
-
Test with logs enabled:
- Enable logging in plugin settings
- Configure your Home WiFi SSID
- Wait for next WiFi check cycle (30 seconds)
- View logs and verify your network appears in scan results
-
Verify SSID matching:
- Connect to your home WiFi manually
- Check logs for "Connection check: Currently connected to 'XXX'"
- Copy the exact SSID format (including quotes if any)
- Use that exact format in plugin settings
-
Test transmission modes:
- Try each mode (realtime, ssid_connected, ssid_in_range)
- Check "Checking if data should be sent" log entries
- Verify the conditions match your expectations
- Search for "=== WiFi State Check Started ===" to find the beginning of each check cycle
- Look for "WARNING" or "ERROR" entries to find problems quickly
- Check the "WiFi scan found X networks" count to verify scanning is working
- Compare configured SSIDs with the actual scan results list
- Watch "Internet: true/false" to understand connectivity issues
When reporting WiFi detection problems, include:
- Full log section from "=== WiFi State Check Started ===" to "=== WiFi State Check Complete ==="
- Your Android version (from initialization logs)
- Your transmission mode setting
- Configured Home and OBD SSIDs (you can redact the actual names but show the format)
- Expected behavior vs actual behavior
- README.md - Plugin setup and configuration
- TROUBLESHOOTING_PLUGIN_DISCOVERY.md - Plugin visibility issues
- QUICK_START.md - Getting started guide