Add debug logging for channel recommendation

Temporary console.log statements to diagnose why channel
recommendation always shows 1 and 36.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Smittix
2026-01-08 14:37:33 +00:00
parent 370c46bddb
commit 5f4d1b05a8

View File

@@ -4252,8 +4252,12 @@
channels5g.forEach(ch => channelCounts5[ch] = 0);
// Count networks per channel
console.log('Channel recommendation - networks:', Object.keys(wifiNetworks).length);
Object.values(wifiNetworks).forEach(net => {
const ch = parseInt(net.channel);
if (isNaN(ch)) {
console.warn('Invalid channel for network:', net.essid, 'channel value:', net.channel);
}
if (ch >= 1 && ch <= 13) {
// 2.4 GHz channels overlap, so count neighbors too
for (let i = Math.max(1, ch - 2); i <= Math.min(13, ch + 2); i++) {
@@ -4293,6 +4297,12 @@
}
});
// Debug: show final counts
console.log('Channel counts 2.4GHz:', channelCounts24);
console.log('Channel counts 5GHz:', channelCounts5);
console.log('Best 2.4GHz:', best24, 'count:', minCount24);
console.log('Best 5GHz:', best5, 'count:', minCount5);
// Update UI with more context
document.getElementById('rec24Channel').textContent = best24;
if (totalNetworks === 0) {