Refactor Pi Discovery to client-side with enhanced debugging and MAC masquerading support #92
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Overview
Complete refactoring of the Pi Discovery feature to run client-side with improved reliability, debugging capabilities, and network compatibility.
Major Changes
🔄 Architecture Changes
Client-side scanning: Pi Discovery now runs from the client machine instead of requiring connection to a Pi server
UI reorganization: Moved from main window tab to Tools menu dialog for better UX
🎛️ Enhanced Functionality
Configurable scan parameters: UI controls for timeout (1-10s) and batch size (1-50 hosts)
Verbose debug logging: Comprehensive per-host logging showing ping, MAC lookup, hostname resolution, and LabLink probing
Command-line debug flag: --debug flag for both client and server
🎉 Easter Egg Feature
Hidden debug mode: 7-click activation on launcher header
Funny discovery message with visual feedback
Automatically passes --debug to both server and client processes
🐛 Bug Fixes
MAC lookup reliability: Fixed arp command path issues by using ip neigh with fallback to full paths (/usr/sbin/arp, /sbin/arp)
MAC masquerading support: Fallback LabLink probing for hosts where routers hide real Pi MAC addresses in ARP cache
Now discovers Pis even when gateway presents its own MAC instead of the device's actual MAC
Technical Details
Async network scanning using asyncio
Cross-platform support (Windows/Linux/Mac)
Identifies Pis by MAC vendor prefixes: B8:27:EB, DC:A6:32, E4:5F:01, D8:3A:DD, 28:CD:C1
LabLink detection via HTTP probing on port 8000 (/api, /health, /api/system/version)
Batch processing to avoid overwhelming networks
Testing
Tested on network with MAC masquerading (WiFi router hiding device MACs) - successfully discovers all Pis including those with obscured MAC addresses.