Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

wifiScanner.ts doesn't work on Win11 (English) #14

Open
richb-hanover opened this issue Feb 21, 2025 · 7 comments
Open

wifiScanner.ts doesn't work on Win11 (English) #14

richb-hanover opened this issue Feb 21, 2025 · 7 comments

Comments

@richb-hanover
Copy link

richb-hanover commented Feb 21, 2025

I attempted to use heat-mapper on my Win11 system, and got an error that the wifi data had changed. A little debugging showed that the WiFi info returned was all wrong (one of the values was NaN, and that probably triggered the error message because NaN is never == NaN...)

Reading the code, there is a lot of work to find values relative to the BSSID line. But that doesn't work on my English system. Here's the output of netsh wlan show interfaces: I wonder if different language systems display the parameters in a different order...?

PS C:\Users\richb> netsh wlan show interfaces

There is 1 interface on the system:

    Name                   : Wi-Fi
    Description            : Intel(R) Wi-Fi 6 AX201 160MHz
    GUID                   : f899e530-fd03-44a9-8307-4d4fc4827eab
    Physical address       : f0:77:c3:e4:ac:50
    Interface type         : Primary
    State                  : connected
    SSID                   : HBTL5
    AP BSSID               : 20:05:b6:ff:1f:29
    Band                   : 5 GHz
    Channel                : 44
    Network type           : Infrastructure
    Radio type             : 802.11ax
    Authentication         : WPA2-Personal
    Cipher                 : CCMP
    Connection mode        : Auto Connect
    Receive rate (Mbps)    : 432
    Transmit rate (Mbps)   : 29
    Signal                 : 65%
    Profile                : HBTL5
    QoS MSCS Configured         : 0
    QoS Map Configured          : 0
    QoS Map Allowed by Policy   : 0

    Hosted network status  : Not available

PS C:\Users\richb>
``
@richb-hanover
Copy link
Author

richb-hanover commented Feb 21, 2025

Alas: It's as bad as we feared (that is, the lines aren't positional). Here's a CSV file comparing the original English and Italian, and my Win11 American English system...

Win WiFi Info.csv

I wonder if we will be forced to come up with a translation table... Sigh.

I'm now just speculating - help me out here... "All we need to do" is come up with a table holding each common language (which ones?) and maybe later create an "Advanced Advanced configuration" that lets people give the proper string. Sigh x2...

@hnykda
Copy link
Owner

hnykda commented Feb 21, 2025

Hey @richb-hanover . Thanks for submitting the issue and actually comparing the language order. Yeah, this is an issue, see the readme if you haven't (and #8).

Who the hell thought a different order per language is a good idea 😢 .

I would really really like to avoid language specific confs, that will be hard to maintain... Any chance we could get around with position-based parsing . isn't there some switch or something? Maybe we could just grep specific fields?

@hnykda
Copy link
Owner

hnykda commented Feb 21, 2025

I would probably rather used some free LLM based parsing, e.g. gemini that could do it just fine. Could be optional switch

@richb-hanover
Copy link
Author

I've been thinking more about alternative solutions. Here's what I have come up with, from easiest-to-implement to most complete/seamless:

  • (Wacky thought, but I blame ChatGPT...) Use Powershell command to switch the system language to English, grab the output from netsh wlan show interfaces, then switch back . (Conceptually simple, but totally terrifying because of other system effects)
  • Hard-code a bunch of languages: English, Italian, French, German, ??? - this covers a wide use case/large number of people. (Reasonably easy to implement, but kinda yucky.)
  • Allow people to import a wifi-translation.txt file that gives the localized translations for the necessary property names.
  • If we placed translation files for the hard-coded languages (above) in a folder, people would have a template for creating their own. (Attractive because it combines both these points into a single mechanism.)
  • create .po files in the style of the localization tools used to localize entire programs (Only attractive because it uses an existing localization mechanism. But we'd all have to learn it.)
  • Fully localize the program. (Only if someone provides $1M :-)

@hnykda
Copy link
Owner

hnykda commented Feb 21, 2025

Cool, thanks for the ideas.

What about using powershell in the first place then, if that is guaranteed to be in the same language? Claude gave me this:


Yes, you can use the following PowerShell command which will always return results in English:

Get-NetAdapter | Where-Object {$_.PhysicalMediaType -eq 'Native 802.11'} | Select-Object Name,Status,LinkSpeed,MediaConnectionState

Or for more detailed wireless info:

(Get-NetAdapter | Where-Object {$_.PhysicalMediaType -eq 'Native 802.11'} | Get-NetConnectionProfile).Name

If you specifically need the SSID and connection details like netsh provides, use:

(Get-CimInstance -Namespace root/StandardCimv2 -ClassName MSFT_WLANConnectionProfile).Ssid

The advantage of these commands is they:

  • Always return English output
  • Return structured data (objects) rather than formatted text
  • Can be filtered and formatted programmatically
  • Are more reliable for parsing

Note that I don't have access to a windows machine right now, so can't test it.

@richb-hanover
Copy link
Author

richb-hanover commented Feb 21, 2025

Hmmm... I read something yesterday or today that made it look as if you couldn't force Powershell to use English, but I can't find it now.

Strategy question: When is the best time to integrate this? I have been working on other changes (mostly to learn the code base and to tweak the display of survey points to show the % signal strength with an associated color in the "dot"; no major changes to the underlying program.) This allows me to (attempt to) correlate the measurements at the various points with the colors shown in the heatmap. I expect to create a PR with these changes soon (this weekend).

My plan is then to change the configuration/database code so all that stuff is in one React "context provider" that can pass down all the settings to each of the components on page.tsx. At that point, I believe I can create the tabbed interface that I mentioned a while back.

So, getting back to the original question: When would be a good time to tackle wifiScanner() for Windows? I develop on Mac, so this is not blocking me. I imagine this work would be a well-contained but fussy effort that could be taken on at nearly any point (and possibly by another developer).

PS I have not yet tried heat-mapper on a Linux box, so have no opinion about how it might work there. I have access to Win10 and Win11 boxes running US English that I could use for testing. Thanks

Update: There are indications see stackoverflow that it may be possible. But this can come separately from other development work

@hnykda
Copy link
Owner

hnykda commented Feb 22, 2025

I feel like this is independent, i.e. can be worked on any time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants