diff --git a/templates/index.html b/templates/index.html index c987640..fea5064 100644 --- a/templates/index.html +++ b/templates/index.html @@ -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) {