WiFi/Bluetooth Map Viewer - Quickstart Guide
Overview
The Map Viewer (start_plot_gui.py) is an interactive map visualization tool for WiFi and Bluetooth scan data from the WIFIGEOGRABBER project. It creates a browser-based, interactive map with extensive filtering and search capabilities.
Features
Main Functions
- Interactive Map: Visualize all WiFi and Bluetooth devices on OpenStreetMap
- Advanced Search: Search by SSID or MAC address
- Smart Filters: Filter by device type, encryption, signal strength
- Bluetooth Proximity Search: Automatic display of Bluetooth devices within 50m radius of WiFi APs
- Movement Tracking: Visualize device movements between scan positions
- Drag & Drop: Movable markers for GPS coordinate correction
- Highlight Function: Click-to-Highlight with Middle Mouse Button or Right Click
Advanced Features
- Automatic duplicate detection
- Vendor/Manufacturer recognition via OUI (MAC prefix)
- Signal-based circle sizes
- Toggle function for highlights
- Export position changes as JSON
Installation
Prerequisites
pip install folium sqlite3 tkinter
System Requirements
- Python 3.7+
- Modern web browser (Chrome, Firefox, Edge)
- Internet connection for map tiles (OpenStreetMap)
Quick Start
1. Launch Program
python Python/start_plot_gui.py
2. Select Database
A file selection dialog opens:
- Navigate to your
.db files folder
- Select a database
- Click “Open”
3. Map Opens in Browser
The map opens automatically in your default browser with all scanned devices.
User Interface
Marker Types
| Icon |
Color |
Meaning |
| đź“¶ (WiFi) |
đź”´ Red |
Open WiFi network |
| đź”’ (Lock) |
🟢 Green |
Encrypted WiFi network |
| 📱 (Bluetooth) |
🔵 Blue |
Bluetooth device |
| đź“¶ (WiFi) |
đź”´ Dark Red |
Open WiFi with movement data |
| đź”’ (Lock) |
🟢 Dark Green |
Encrypted WiFi with movement data |
| 📱 (Bluetooth) |
🔵 Dark Blue |
Bluetooth with movement data |
Signal-Based Circles
Each marker has a circle whose radius represents signal strength:
- Small (10m): Very strong signal (≥ -50 dBm)
- Medium (20m): Strong signal (-50 to -70 dBm)
- Large (30m): Medium signal (-70 to -80 dBm)
- Very Large (40m): Weak signal (< -80 dBm)
Main Functions
1. Marker Control (Top Left)
Reset Markers
Resets all moved markers to their original positions (reloads page).
Save Positions
Exports all position changes as JSON file:
- Click “Save Positions”
- Confirm changes
- The file
wifi_scanner_updates.json will be downloaded
- Place the file in the program folder
- Updates will be automatically written to database on next startup
Debug Markers
Shows debug information about visible and hidden markers.
BT Proximity Mode
Toggle between three modes for Bluetooth devices when highlighting:
- Known Only: Shows only Bluetooth devices with names (default)
- All: Shows all Bluetooth devices including “Unknown Device”
- None: No Bluetooth proximity display
2. Filters (Top Left)
Multiple filters can be active simultaneously:
Device Type Filters
- WiFi Open: Only open WiFi networks
- WiFi Encrypted: Only encrypted WiFi networks
- Bluetooth: All Bluetooth devices
- Bluetooth without Unknown: Only Bluetooth devices with names
Special Filters
- Devices with Movement: Only devices with movement tracking
- Vodafone Homespot/Hotspot: Only Vodafone hotspots
- WiFi Open without Vodafone: Open WiFi excluding Vodafone
Signal Strength Filters
- Signal Very Strong (≥ -50 dBm)
- Signal Strong (-50 to -70 dBm)
- Signal Medium (-70 to -80 dBm)
- Signal Weak (< -80 dBm)
Filter Buttons:
- All On: Enables all filters
- All Off: Disables all filters (hides all markers)
3. Search Function (Top Center)
Search by SSID or MAC Address:
- Enter at least 2 characters
- Substring search works (e.g., “Eduard” or “db:7a”)
- With one result, it’s automatically highlighted
- With multiple results, a selection list appears
Search Results:
- Name (SSID)
- MAC Address (BSSID)
- Signal Strength
- Encryption
Automatic Highlighting:
- Golden ring around device
- Pulsing outer ring
- Zoom to position
- For WiFi: 50m search radius with nearby Bluetooth devices
4. Legend (Top Right)
Shows statistics:
- Count WiFi Open
- Count WiFi Encrypted
- Count Bluetooth devices
- Count Bluetooth without “Unknown”
- Count Vodafone Homespots
- Count WiFi Open without Vodafone
- Total device count
- Database name
Highlight Button:
When you click on a marker, it’s displayed in the legend with a “Highlight” button for re-highlighting.
Interactive Features
Move Markers (Drag & Drop)
Step by Step:
- Click on a marker and hold the mouse button
- Drag the marker to the desired position
- Release the mouse button
- A confirmation dialog appears with new coordinates
- Confirm with “OK”
- The change is queued
Save Changes:
- Click “Save Positions” to export all changes as JSON
- The file will be automatically processed on next program start
Discard Changes:
- Click “Reset Markers” to discard all changes
Method 1: Middle Mouse Button
- Click with middle mouse button (scroll wheel) on a marker
- The device is highlighted
- The SSID is automatically entered in the search bar
- Another click on the same marker removes the highlight (Toggle)
Method 2: Right Click
- Right-click on a marker
- The context menu is blocked
- The device is highlighted like with middle mouse button
Highlighting Effects:
- Golden ring (80m radius)
- Pulsing outer ring (120m radius)
- For WiFi: 50m search radius (orange dashed)
- For WiFi: Automatic display of nearby Bluetooth devices
- Zoom to position (Zoom level 18)
Display Movement Tracking
When clicking on a marker with movement data:
- A gray marker appears at the last known position
- A dashed black line connects both positions
- The distance is shown in the popup
- Timestamps of both positions are displayed
Movement Data in Popup:
- Last Position: GPS coordinates of previous sighting
- Last Sighting: Timestamp
- Movement: Distance in meters
Bluetooth Proximity Search (only for WiFi highlight)
Automatic:
When you highlight a WiFi network, all Bluetooth devices within 50m radius are automatically displayed:
- Violet markers for Bluetooth devices
- Name label above each Bluetooth marker
- Small violet circle around each Bluetooth device
- Popup with Bluetooth information
Modes:
- Known Only (default): Shows only Bluetooth devices with names
- All: Shows all Bluetooth devices including “Unknown Device”
- None: No Bluetooth display
Toggle:
Click the “BT Proximity” button at top left to switch between modes.
Use Cases
Use Case 1: Find Open WiFi Networks
- Enable the “WiFi Open” filter
- The map shows only open networks (red markers)
- Optional: Enable “WiFi Open without Vodafone” to exclude Vodafone hotspots
Result: Quick overview of all open WiFi networks in your area.
Use Case 2: Find Strong Signals in Specific Area
- Enable “Signal Very Strong” or “Signal Strong”
- Zoom into the desired area
- Click on markers to see details
Result: Identification of the best WiFi hotspots in a specific region.
Use Case 3: Bluetooth Devices Near a WiFi AP
- Search for a WiFi network (e.g., “Starbucks”)
- The network is highlighted
- All Bluetooth devices within 50m radius are automatically displayed
- Use the “BT Proximity” button to switch between “Known Only”, “All”, or “None”
Result: Analysis of device density and possible device owners near an AP.
Use Case 4: Track Device Movements
- Enable the “Devices with Movement” filter
- Click on a marker
- The movement line and previous position are displayed
- Popup shows distance and timestamps of both positions
Result: Tracking of mobile devices (e.g., smartphones, tablets).
Use Case 5: Correct GPS Coordinates
- Drag a marker to the correct position
- Confirm the new position
- Repeat for all incorrectly positioned markers
- Click “Save Positions”
- The JSON file is downloaded
- Place the file in the program folder
- Restart the program
Result: Corrected GPS data in the database for future visualizations.
Keyboard Shortcuts
| Key |
Action |
Escape |
Clear search bar + remove highlights |
Enter |
In search bar: Highlight first result |
Ctrl + F |
Focus search bar (browser default) |
Tips and Best Practices
- Many Markers: With > 1000 devices, the map can become slow
- Use filters to show only relevant markers
- Disable filters you don’t need
- Bluetooth Proximity Search: With many Bluetooth devices (> 100), display may be delayed
- Use “Known Only” mode to filter out “Unknown Devices”
Accuracy
- GPS Accuracy: Marker accuracy depends on GPS quality of scan device
- Use Drag & Drop function to correct inaccurate positions
- Signal Circles: Circle sizes are only estimates
- Real-world signal range depends on many factors (walls, interference, etc.)
Workflow
- Filter First, Then Search: Enable relevant filters before searching
- Highlight Toggle: Use toggle function (click again) to quickly remove highlights
- Batch Corrections: Correct multiple positions at once and save at the end
The program reads from the following tables:
wifi_data: WiFi networks
device_data: Bluetooth devices
Output: HTML + JSON
- HTML Map: Interactive Leaflet map (temporary in browser)
- JSON Export: Position changes for database update
[
{
"address": "AA:BB:CC:DD:EE:FF",
"type": "WIFI",
"latitude": 51.123456,
"longitude": 7.654321,
"timestamp": "2025-10-30T12:34:56.789Z"
}
]
Vendor Recognition (OUI)
The program recognizes manufacturers based on the first 6 characters of the MAC address (OUI):
- Apple, Samsung, Google
- Intel, Cisco, NETGEAR
- VMware, VirtualBox (virtual machines)
- Linksys, D-Link, etc.
Note: The OUI database is embedded in the code and can be extended.
Troubleshooting
Problem: Map shows no markers
Solution:
- Check if filters are active (deactivate all filters with “All Off” and then activate individually)
- Check if database has entries with valid GPS coordinates (
latitude != 0, longitude != 0)
Problem: “No valid GPS coordinates found”
Solution: The database only contains entries with latitude = 0 and longitude = 0. Ensure the Android app records GPS data.
Problem: Map doesn’t load in browser
Solution:
- Check your internet connection (for OpenStreetMap tiles)
- Check browser console for JavaScript errors (F12 → Console)
- Try a different browser
Problem: Drag & Drop doesn’t work
Solution:
- Wait until map is fully loaded (approx. 1-2 seconds after opening)
- Ensure JavaScript is enabled in browser
- Check browser console for errors
Problem: Bluetooth Proximity Search shows no devices
Solution:
- Check BT Proximity mode (should not be set to “None”)
- Ensure Bluetooth devices exist in database
- Check if Bluetooth devices exist within 50m radius of WiFi AP
Solution:
- Wait until drag handlers are loaded (approx. 2 seconds after opening)
- Check browser console for JavaScript errors
- Try using search function instead
Advanced: localStorage and JSON Export
localStorage (Browser)
The program uses localStorage to store position changes:
- Key:
pendingLocationUpdates
- Format: JSON array with position updates
Manual Reading:
// Browser Console (F12)
let updates = JSON.parse(localStorage.getItem('pendingLocationUpdates'));
console.log(updates);
Manually Process JSON File
If you want to manually write the JSON file to the database:
import json
import sqlite3
# Load JSON
with open('wifi_scanner_updates.json', 'r') as f:
updates = json.load(f)
# Open database
conn = sqlite3.connect('your_database.db')
cursor = conn.cursor()
# Process updates
for update in updates:
if update['type'] == 'WIFI':
cursor.execute("""
UPDATE wifi_data
SET latitude = ?, longitude = ?
WHERE bssid = ?
""", (update['latitude'], update['longitude'], update['address']))
elif update['type'] == 'BLUETOOTH':
cursor.execute("""
UPDATE device_data
SET latitude = ?, longitude = ?
WHERE device_address = ? AND device_type = 'BLUETOOTH'
""", (update['latitude'], update['longitude'], update['address']))
conn.commit()
conn.close()
Browser Compatibility
Tested with:
- âś… Google Chrome 90+
- âś… Mozilla Firefox 88+
- âś… Microsoft Edge 90+
- âś… Safari 14+ (macOS)
Limitations:
- Internet Explorer is NOT supported
- Mobile browsers have limited Drag & Drop support
Support
For issues or questions:
- Check browser console (F12 → Console) for errors
- Check terminal output of Python script
- Verify database structure
- Create an issue in the GitHub repository
- Folium Documentation: https://python-visualization.github.io/folium/
- Leaflet.js (underlying JavaScript library): https://leafletjs.com/
- OpenStreetMap: https://www.openstreetmap.org/
- SQLite Documentation: https://www.sqlite.org/docs.html