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

wifi-heatmap --ap-names seems not working #22

Closed
ggruening opened this issue Mar 27, 2022 · 10 comments · Fixed by #24
Closed

wifi-heatmap --ap-names seems not working #22

ggruening opened this issue Mar 27, 2022 · 10 comments · Fixed by #24

Comments

@ggruening
Copy link

Hello everyone,

Thanks for all the work!

I'm trying to use the -a / --ap-names option. Unfortunately I can't find any documentation about the structure of the json file. I tried something like this:

{
    "aa:bb:cc:dd:ee:01": "AP1 5",  
    "aa:bb:cc:dd:ee:02": "AP1 24",  
    "aa:bb:cc:dd:ee:03": "AP2 5",   
    "aa:bb:cc:dd:ee:04": "AP2 24",  
    "aa:bb:cc:dd:ee:05": "AP3 24", 
    "aa:bb:cc:dd:ee:06": "AP3 5"     
}

A wifi-heatmap --ap-names ap-mapping.json [TITLE] does not change the images at all. Is this a bug or am I doing something wrong?

Best regards,
Gregor

@jantman
Copy link
Owner

jantman commented Mar 27, 2022

Gregor,

I don't actually use that option myself. I just looked through the code and it looks like, while this is not documented, --ap-names only works if wifi-heatmap is run with --show-points. Could you please give that a try and let me know if that causes the AP names to show up?

Thanks,
Jason

@ggruening
Copy link
Author

Thanks for the hint.

The measurement points are displayed with --show-points, but their labeling is in the form <SSID> (<frequency>). The name of the access points is still missing.

There is actually no difference between wifi-heatmap --show-points [TITLE] and wifi-heatmap --show-points --ap-names ap-mapping.json [TITLE].

Are there any further ideas?

@jantman
Copy link
Owner

jantman commented Mar 29, 2022

Hmmm... I'll need to take a look after work today. I don't use the ap names feature myself, so it could just be broken in a way that I haven't noticed yet.

Is there any chance that you could upload one of the resulting heatmaps, and also the output of running that command with -vv for debug-level output?

@ggruening
Copy link
Author

You're welcome :-)

heatmap.log

tcp_download_Mbps_example json

@jantman
Copy link
Owner

jantman commented Mar 30, 2022

Looking at the code, I think the JSON file expects SSID keys, not BSSID.

In wifi-heatmap, the contents of ap-mapping.json is [loaded(https://github.com/jantman/python-wifi-survey-heatmap/blob/master/wifi_survey_heatmap/heatmap.py#L151-L156) into self._ap_names, with the keys converted to upper-case. When processing the survey data (survey_points list in the JSON file, i.e. example.json), for each item in survey_points, we look at the ssid value in the result dictionary. If there's a matching key (upper case to upper case) in the AP names, we display that value. If not, we display the SSID.

@ggruening
Copy link
Author

Maybe I'm confused, but I do not see the point. A network that is broadcast from several access points has the same SSID everywhere, and the information that would be helpful is which access point I am actually connected to despite the same SSID. What am I missing?

@jantman
Copy link
Owner

jantman commented Apr 3, 2022

You're not confused. It appears that this is a bug.

Looking back in the git history, it originally used BSSIDs like you'd expect. The README even has a line about that:

You can optionally pass the path to a JSON file mapping the access point MAC addresses (BSSIDs) to friendly names via the -a / --ap-names argument. If specified, this will annotate each measurement dot on the heatmap with the name (mapping value) and frequency band of the AP that was connected when the measurement was taken. This can be useful in multi-AP roaming environments.

However, v1.0.0 / #4 was a PR that included a massive rewrite of the wireless-handling code to move from iwlist to nl80211. It appears that a commit in that PR switched these labels from BSSID to SSID.

jantman added a commit that referenced this issue Apr 3, 2022
@jantman
Copy link
Owner

jantman commented Apr 3, 2022

I have a fix for this currently in a branch: https://github.com/jantman/python-wifi-survey-heatmap/tree/issues/22

I'll try to get that released in the next few days.

@ggruening
Copy link
Author

Just checked out the new branch... it works! Thank you very much. It makes this great software even more great :-) I'll stay tuned for the new release.

jantman added a commit that referenced this issue Apr 5, 2022
Fixes #22 - Survey point labels should use BSSID/MAC, or AP name from mapping if specified
@jantman
Copy link
Owner

jantman commented Apr 5, 2022

This has been released as 1.1.0 and should be live on Docker Hub as well. Thank you so much for taking the time to report the issue and help with troubleshooting!

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