jantman / python-wifi-survey-heatmap

A Python application for Linux machines to perform WiFi site surveys and present the results as a heatmap overlayed on a floorplan
GNU Affero General Public License v3.0
370 stars 87 forks source link

WARNING] Not associated to an AP #27

Open slate-1 opened 2 years ago

slate-1 commented 2 years ago

Examples looked great & wished to try this out.

Possible Bug Report

Not sure if this is a bug or my own error. If this can be resolved great, if not also ok.

Running wifi-survey with docker run command as specified runs successfully - But when starting tests (Left click on Plan) receive "Aborted : Not connected to an access point" in bottom of window.

Plan stays loaded & can click all over map but always returns Aborted error

Host is connected on wifi network.

Docker container appears to correctly receive wifi information from host - running "sudo docker exec ../sbin/iwconfig lists the connection details which includes the BSSID etc. - Although I believe this is not used by wifi-survey any more, thought this at least proved the container received the details from the host.

Version

Using docker image ID 27941809078c

Installation Method

Installed Docker on Debian Buster Debian 4.19.235-1 (First time ever used Docker)

Installed wifi survey with sudo docker run --net="host" --privileged --name survey -it --rm -v $(pwd):/pwd -w /pwd -e DISPLAY=$DISPLAY -v "$HOME/.Xauthority:/root/.Xauthority:ro" jantman/python-wifi-survey-heatmap wifi-survey -i wlp3s0 -s 192.168.x.x -p plan.png -t "Plan Heatmap"

Running iperf3 on separate system (Not in Docker) - Assuming the "Abort" issue is raised before any testing starts and I may have issues later if current issue can be resolved but one step at time.

Gtk-CRITICAL error - Don't think this error has anything to do with issue but does happen when launching.

Actual Output

Output from Terminal

(wifi-survey:1): Gtk-CRITICAL **: 21:29:57.664: gtk_distribute_natural_allocation: assertion 'extra_space >= 0' failed [2022-06-17 21:30:04,489 WARNING] Not associated to an AP

sudo docker run   --net="host"   --privileged   --name survey   -it   --rm -vv  -v $(pwd):/pwd   -w /pwd   -e DISPLAY=$DISPLAY   -v "$HOME/.Xauthority:/root/.Xauthority:ro"   jantman/python-wifi-survey-heatmap   wifi-survey -i wlp3s0 -s 192.168.3.200 -p Plan.png -t "Plan Heatmap"

Expected Output

Was hoping for the first test to run & reach 100%

Testing Assistance

Will help if I can, but may need detailed instructions to provide required information.

jantman commented 2 years ago

@slate-1 Sorry about that. Coupld you please insert a -vv (debug-level logging) in the command, i.e. change wifi-survey to wifi-survey -vv and post the full output here? Hopefully that will include enough information to figure out what's going on here.

This definitely is strange to me... I've never seen that error before when I was actually connected to a network.

slate-1 commented 2 years ago

No need to be sorry, probably an issue with my hardware - old kit re-purposed -only 2.4g capability.

Please find debug output

(wifi-survey:1): Gtk-CRITICAL **: 05:53:55.045: gtk_distribute_natural_allocation: assertion 'extra_space >= 0' failed 2022-06-18 05:53:55,128 [DEBUG ui.py:239 - root.OnEraseBackground() ] Scaling image to 396 x 420 2022-06-18 05:54:00,088 [DEBUG ui.py:239 - root.OnEraseBackground() ] Scaling image to 396 x 420 2022-06-18 05:54:00,183 [DEBUG collector.py:89 - wifi_survey_heatmap.collector.check_associated() ] Checking association with AP... 2022-06-18 05:54:00,195 [DEBUG libnl.py:577 - wifi_survey_heatmap.libnl.update_iface_details() ] Sent 28 bytes to the kernel. 2022-06-18 05:54:00,203 [DEBUG libnl.py:577 - wifi_survey_heatmap.libnl.update_iface_details() ] Sent 28 bytes to the kernel. 2022-06-18 05:54:00,204 [WARNING collector.py:91 - wifi_survey_heatmap.collector.check_associated() ] Not associated to an AP 2022-06-18 05:54:00,216 [DEBUG ui.py:239 - root.OnEraseBackground() ] Scaling image to 396 x 420 2022-06-18 05:54:00,238 [DEBUG ui.py:239 - root.OnEraseBackground() ] Scaling image to 396 x 420 2022-06-18 05:54:30,601 [DEBUG ui.py:239 - root.OnEraseBackground() ] Scaling image to 396 x 420

slate-1 commented 2 years ago

Sorry closed by mistake

jantman commented 2 years ago

Well... that's weird.

The pertinent output here is:

2022-06-18 05:54:00,183 [DEBUG collector.py:89 - wifi_survey_heatmap.collector.check_associated() ] Checking association with AP...
2022-06-18 05:54:00,195 [DEBUG libnl.py:577 - wifi_survey_heatmap.libnl.update_iface_details() ] Sent 28 bytes to the kernel.
2022-06-18 05:54:00,203 [DEBUG libnl.py:577 - wifi_survey_heatmap.libnl.update_iface_details() ] Sent 28 bytes to the kernel.
2022-06-18 05:54:00,204 [WARNING collector.py:91 - wifi_survey_heatmap.collector.check_associated() ] Not associated to an AP

Those logs - specifically the first and last of those lines, are coming from this tiny function on lines 88-95 of collector.py:

    def check_associated(self):
        logger.debug('Checking association with AP...')
        if self.scanner.get_current_bssid() is None:
            logger.warning('Not associated to an AP')
            return False
        else:
            logger.debug("OK")
            return True

There's not much room for something to go wrong there. So either the BSSID-getting logic in Scanner is broken, or something else is going on here.

@slate-1 Could you please post the full output of sudo iw dev right after getting this aborted error?

slate-1 commented 2 years ago

Output from command sudo iw dev phy#0 Interface wlp3s0 ifindex 3 wdev 0x1 addr 84:4b:f5:52:eb:76 ssid PLUSNET-KMNQQ3 type managed txpower 200.00 dBm

slate-1 commented 2 years ago

Although I know very little about coding my thoughts are turning to - how about instead of getting "Not Connnected to AP" but display this first time. Possibly set a flag for override = true to continue without BSSID check. Or would this cause further issues down the line? I am of course assuming that the iperf3 server test will function happily without a check. This of course may not affect anyone else but if it does then there is an option to continue regardless (If it works, it works).

I'm assuming iw dev should return the BSSID - in my case it's not.

Thanks for looking at this issue.