python-wifi-survey-heatmap icon indicating copy to clipboard operation
python-wifi-survey-heatmap copied to clipboard

Not associated to an access point

Open richb-hanover opened this issue 10 months ago • 6 comments

Revising this ticket because the new subject is the real problem... See https://github.com/jantman/python-wifi-survey-heatmap/issues/40#issuecomment-2625926100

I am attempting to bring this project up on a fresh install of Ubuntu 24.04. I created a survey.sh script that simply parrots the docker run ... command with the final line edited for the local parameters.

When I sh survey.sh, I get the following error:

sh survey.sh 
[2025-01-30 02:33:19,574 WARNING] You should not run this script as root.

(wifi-survey:1): dbind-WARNING **: 02:33:19.588: Couldn't connect to accessibility bus: Failed to connect to socket /run/user/1000/at-spi/bus_0: No such file or directory
Gtk-Message: 02:33:19.624: Failed to load module "canberra-gtk-module"
Gtk-Message: 02:33:19.626: Failed to load module "canberra-gtk-module"
richb@HP-Pavilion-g7-Notebook-PC:~/Documents/github/python-wifi-survey-heatmap$ 

History of this system: I have been wrasslin' it into submission:

  • Had to switch from Wayland to X11
  • Had to execute xhost +local:docker
  • Tried several variations on startx (with and without sudo)
  • xeyes runs fine

What other diagnostic information could I provide? Many thanks.

richb-hanover avatar Jan 30 '25 02:01 richb-hanover

But wait... There's more.

I meant to mention that the image file appeared in a window (the aspect ratio was screwed up, but I was able to resize).

When I click a point, I get a big red dot with "0%" and a message "Aborted: not connected to an access point".

I should also mention this is an ancient HP Pavilion g7 laptop. I don't know what kind of WiFi card/driver it uses, but the WiFi works fine.

richb-hanover avatar Jan 30 '25 02:01 richb-hanover

Further research (prompted by #27):

  • lspci shows this for the wireless card:

01:00.0 Network controller: Broadcom Inc. and subsidiaries BCM4313 802.11bgn Wireless Network Adapter (rev 01)

  • sudo iw dev shows:

    sudo iw dev
    #0
      Interface wlp1s0
      	ifindex 3
      	wdev 0x1
      	addr c0:18:85:07:89:cd
      	ssid HBTL
      	type managed
      	txpower 23.00 dBm
    
  • The GUI seems to work (I can see the map) but I always get the "not associated" error when I click.

  • WiFi is working great all the time.

What other info could I collect? Many thanks

richb-hanover avatar Jan 30 '25 23:01 richb-hanover

@richb-hanover it appears that this is in fact the same issue as #27.

Could you please provide the following full details:

Version

wifi-survey-heatmap version, as reported by wifi-survey-heatmap --version

Installation Method

How was wifi-survey-heatmap installed (provide as much detail as possible, ideally the exact command used and whether it was installed in a virtualenv or not).

Supporting Software Versions

The output of python --version and virtualenv --version in the environment that wifi-survey-heatmap is running in, as well as your operating system type and version.

Actual Output

Paste here the output of wifi-survey-heatmap (including the command used to run it),
run with the -vv (debug-level output) flag, that shows the issue.

Expected Output

Describe the output that you expected (what's wrong). If possible, after your description, copy the actual output above and modify it to what was expected.

jantman avatar Jan 31 '25 00:01 jantman

Yes - I agree that this seems identical to #27, but that was a two-year old post, so I decided to open a new issue instead of necro-posting.

I am running on an (ancient) HP Pavilion g7 notebook (core i3; 6GB RAM, BCM4313 wifi chip; EOL October 2013). I have a fresh install of Ubuntu Desktop 24.04, freshly updated. It works great (although not quickly) and WiFi seems to be working fine.

I installed python-wifi-survey-heatmap in a docker container, created with git clone ... from a personal repo (in github.com/richb-hanover) forked from the main @jantman repo (4eef361). I made a branch to create a shell script that mimics the docker run from the README (see Details below)

! /bin/sh

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 -vv -b HBTL -i wlp1s0 -s 192.168.253.225 -p HBTL.jpeg -t HBTL

I am connected to the "HBTL" SSID (no encryption, open access) and it's working just fine for everything both before and after. Using the survey.sh script, I see the HBTL.jpeg file open, and I click a point on it. That's when I see the "Not associated" message.

Here is the output from a run of the shell script. It shows:

  • "You should not run this script as root" (?)
  • other error messages
  • "Checking association" and then "Not associated" after a click on the map
  • A clean quit (using Ctl-Q)
richb:python-wifi-survey-heatmap (git: *) docker-compose$ sh survey.sh 
[2025-01-31 01:59:49,908 WARNING] You should not run this script as root.

(wifi-survey:1): dbind-WARNING **: 01:59:49.924: Couldn't connect to accessibility bus: Failed to connect to socket /run/user/1000/at-spi/bus_0: No such file or directory
Gtk-Message: 01:59:49.961: Failed to load module "canberra-gtk-module"
Gtk-Message: 01:59:49.962: Failed to load module "canberra-gtk-module"
2025-01-31 01:59:50,135 [DEBUG libnl.py:80 - wifi_survey_heatmap.libnl.__init__() ] Initializing Scanner for interface: None
2025-01-31 01:59:50,147 [DEBUG libnl.py:577 - wifi_survey_heatmap.libnl.update_iface_details() ] Sent 20 bytes to the kernel.
2025-01-31 01:59:50,166 [DEBUG collector.py:52 - wifi_survey_heatmap.collector.__init__() ] Initializing Collector for interface: wlp1s0; iperf server: 192.168.253.225
2025-01-31 01:59:50,274 [DEBUG ui.py:266 - root.OnEraseBackground() ] Scaling image to 400 x 201
2025-01-31 01:59:50,324 [DEBUG ui.py:266 - root.OnEraseBackground() ] Scaling image to 400 x 201
2025-01-31 01:59:56,291 [DEBUG ui.py:266 - root.OnEraseBackground() ] Scaling image to 400 x 201
2025-01-31 01:59:56,444 [DEBUG collector.py:89 - wifi_survey_heatmap.collector.check_associated() ] Checking association with AP...
2025-01-31 01:59:56,475 [DEBUG libnl.py:577 - wifi_survey_heatmap.libnl.update_iface_details() ] Sent 28 bytes to the kernel.
2025-01-31 01:59:56,502 [DEBUG libnl.py:577 - wifi_survey_heatmap.libnl.update_iface_details() ] Sent 28 bytes to the kernel.
2025-01-31 01:59:56,504 [WARNING collector.py:91 - wifi_survey_heatmap.collector.check_associated() ] Not associated to an AP
2025-01-31 01:59:56,516 [DEBUG ui.py:266 - root.OnEraseBackground() ] Scaling image to 400 x 201
2025-01-31 01:59:56,544 [DEBUG ui.py:266 - root.OnEraseBackground() ] Scaling image to 400 x 201
richb:python-wifi-survey-heatmap (git: *) docker-compose$ 

Other info: The previous post shows a lot of lower-level hardware info

Connecting to the running docker container to answer the other questions gives this:

richb:python-wifi-survey-heatmap (git: *) docker-compose$ docker exec -it ef86d56e1610  /bin/bash
root@HP-Pavilion-g7-Notebook-PC:/pwd# 
root@HP-Pavilion-g7-Notebook-PC:/pwd# 
root@HP-Pavilion-g7-Notebook-PC:/pwd# python --version
bash: python: command not found
root@HP-Pavilion-g7-Notebook-PC:/pwd# python3 --version
Python 3.9.2
root@HP-Pavilion-g7-Notebook-PC:/pwd# virtualenv --version
bash: virtualenv: command not found
root@HP-Pavilion-g7-Notebook-PC:/pwd# wifi-survey-heatmap --version
bash: wifi-survey-heatmap: command not found
root@HP-Pavilion-g7-Notebook-PC:/pwd# wifi-survey --version
[2025-01-31 02:11:57,789 WARNING] You should not run this script as root.
usage: wifi-survey [-h] [-v] [-S] [-s IPERF3_SERVER] [-d IPERF3_DURATION]
                   [-b BSSID] [--ding DING] [--ding-command DING_COMMAND]
                   [-i INTERFACE] [-p IMAGE] [-t TITLE] [--libnl-debug]
wifi-survey: error: unrecognized arguments: --version

I have dumped a lot of info here. What other info might be relevant? Many thanks!

richb-hanover avatar Jan 31 '25 02:01 richb-hanover

Update: I logged into the container using docker exec -it <container> /bin/bash and found the following:

  • iwconfig shows:

    lo        no wireless extensions.
    
    eno1      no wireless extensions.
    
    wlp1s0    IEEE 802.11  ESSID:"HBTL"  
              Mode:Managed  Frequency:2.412 GHz  Access Point: E8:9F:80:E3:C1:8E   
              Bit Rate=72 Mb/s   Tx-Power=23 dBm   
              Retry short limit:7   RTS thr:off   Fragment thr:off
              Encryption key:off
              Power Management:on
              Link Quality=53/70  Signal level=-57 dBm  
              Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0
              Tx excessive retries:0  Invalid misc:0   Missed beacon:0
    
    docker0   no wireless extensions.
    
  • iw dev wlp1s0 link shows bash: iw: command not found

  • nmcli dev wifi list shows bash: nmcli: command not found

  • cat /proc/net/wireless shows:

    Inter-| sta-|   Quality        |   Discarded packets               | Missed | WE
    face | tus | link level noise |  nwid  crypt   frag  retry   misc | beacon | 22
    wlp1s0: 0000   61.  -49.  -256        0      0      0      0      0        0
    
  • iwlist wlp1s0 scan shows a whole lot of information about each "Cell" (e.g., "Cell 01", "Cell 02", etc.)

What other information could I provide? Thanks

richb-hanover avatar Feb 01 '25 13:02 richb-hanover

I realize that I didn't provide all the info you requested above.

Version There is no wifi-survey-heatmap binary. I never got wifi-survey to print a version number, but here's its output:

root@HP-Pavilion-g7-Notebook-PC:/pwd# wifi-survey-heatmap --version
bash: wifi-survey-heatmap: command not found

root@HP-Pavilion-g7-Notebook-PC:/pwd# wifi-survey --version
[2025-02-05 02:04:14,418 WARNING] You should not run this script as root.
usage: wifi-survey [-h] [-v] [-S] [-s IPERF3_SERVER] [-d IPERF3_DURATION]
                   [-b BSSID] [--ding DING] [--ding-command DING_COMMAND]
                   [-i INTERFACE] [-p IMAGE] [-t TITLE] [--libnl-debug]
wifi-survey: error: unrecognized arguments: --version

root@HP-Pavilion-g7-Notebook-PC:/pwd# wifi-survey -v       
[2025-02-05 02:04:25,354 WARNING] You should not run this script as root.

(wifi-survey:17): dbind-WARNING **: 02:04:25.366: Couldn't connect to accessibility bus: Failed to connect to socket /run/user/1000/at-spi/bus_0: No such file or directory
Gtk-Message: 02:04:25.403: Failed to load module "canberra-gtk-module"
Gtk-Message: 02:04:25.404: Failed to load module "canberra-gtk-module"

(wifi-survey:17): Gtk-CRITICAL **: 02:04:25.502: gtk_box_gadget_distribute: assertion 'size >= 0' failed in GtkScrollbar

(wifi-survey:17): dconf-WARNING **: 02:04:30.857: failed to commit changes to dconf: Failed to execute child process “dbus-launch” (No such file or directory)

(wifi-survey:17): dconf-WARNING **: 02:04:31.070: failed to commit changes to dconf: Failed to execute child process “dbus-launch” (No such file or directory)

(wifi-survey:17): dconf-WARNING **: 02:04:31.144: failed to commit changes to dconf: Failed to execute child process “dbus-launch” (No such file or directory)

(wifi-survey:17): dconf-WARNING **: 02:04:31.178: failed to commit changes to dconf: Failed to execute child process “dbus-launch” (No such file or directory)

(wifi-survey:17): dconf-WARNING **: 02:04:31.216: failed to commit changes to dconf: Failed to execute child process “dbus-launch” (No such file or directory)

(wifi-survey:17): dconf-WARNING **: 02:04:31.232: failed to commit changes to dconf: Failed to execute child process “dbus-launch” (No such file or directory)

(wifi-survey:17): dconf-WARNING **: 02:04:31.250: failed to commit changes to dconf: Failed to execute child process “dbus-launch” (No such file or directory)

(wifi-survey:17): dconf-WARNING **: 02:04:31.264: failed to commit changes to dconf: Failed to execute child process “dbus-launch” (No such file or directory)

(wifi-survey:17): dconf-WARNING **: 02:04:31.282: failed to commit changes to dconf: Failed to execute child process “dbus-launch” (No such file or directory)

(wifi-survey:17): dconf-WARNING **: 02:04:31.302: failed to commit changes to dconf: Failed to execute child process “dbus-launch” (No such file or directory)

(wifi-survey:17): dconf-WARNING **: 02:04:31.317: failed to commit changes to dconf: Failed to execute child process “dbus-launch” (No such file or directory)

(wifi-survey:17): dconf-WARNING **: 02:04:31.333: failed to commit changes to dconf: Failed to execute child process “dbus-launch” (No such file or directory)

(wifi-survey:17): dconf-WARNING **: 02:04:31.349: failed to commit changes to dconf: Failed to execute child process “dbus-launch” (No such file or directory)

(wifi-survey:17): dconf-WARNING **: 02:04:33.332: failed to commit changes to dconf: Failed to execute child process “dbus-launch” (No such file or directory)

(wifi-survey:17): dconf-WARNING **: 02:04:33.361: failed to commit changes to dconf: Failed to execute child process “dbus-launch” (No such file or directory)

(wifi-survey:17): dconf-WARNING **: 02:04:33.374: failed to commit changes to dconf: Failed to execute child process “dbus-launch” (No such file or directory)

(wifi-survey:17): dconf-WARNING **: 02:04:33.383: failed to commit changes to dconf: Failed to execute child process “dbus-launch” (No such file or directory)

(wifi-survey:17): dconf-WARNING **: 02:04:33.393: failed to commit changes to dconf: Failed to execute child process “dbus-launch” (No such file or directory)

(wifi-survey:17): dconf-WARNING **: 02:04:33.404: failed to commit changes to dconf: Failed to execute child process “dbus-launch” (No such file or directory)

(wifi-survey:17): dconf-WARNING **: 02:04:33.420: failed to commit changes to dconf: Failed to execute child process “dbus-launch” (No such file or directory)

(wifi-survey:17): dconf-WARNING **: 02:04:33.437: failed to commit changes to dconf: Failed to execute child process “dbus-launch” (No such file or directory)

(wifi-survey:17): dconf-WARNING **: 02:04:33.455: failed to commit changes to dconf: Failed to execute child process “dbus-launch” (No such file or directory)

(wifi-survey:17): dconf-WARNING **: 02:04:33.470: failed to commit changes to dconf: Failed to execute child process “dbus-launch” (No such file or directory)

(wifi-survey:17): dconf-WARNING **: 02:04:33.487: failed to commit changes to dconf: Failed to execute child process “dbus-launch” (No such file or directory)

(wifi-survey:17): dconf-WARNING **: 02:04:33.503: failed to commit changes to dconf: Failed to execute child process “dbus-launch” (No such file or directory)

(wifi-survey:17): dconf-WARNING **: 02:04:33.520: failed to commit changes to dconf: Failed to execute child process “dbus-launch” (No such file or directory)

(wifi-survey:17): dconf-WARNING **: 02:04:33.537: failed to commit changes to dconf: Failed to execute child process “dbus-launch” (No such file or directory)

(wifi-survey:17): dconf-WARNING **: 02:04:33.556: failed to commit changes to dconf: Failed to execute child process “dbus-launch” (No such file or directory)

(wifi-survey:17): dconf-WARNING **: 02:04:33.915: failed to commit changes to dconf: Failed to execute child process “dbus-launch” (No such file or directory)

(wifi-survey:17): dconf-WARNING **: 02:04:34.615: failed to commit changes to dconf: Failed to execute child process “dbus-launch” (No such file or directory)

(wifi-survey:17): dconf-WARNING **: 02:04:34.722: failed to commit changes to dconf: Failed to execute child process “dbus-launch” (No such file or directory)

(wifi-survey:17): dconf-WARNING **: 02:04:34.723: failed to commit changes to dconf: Failed to execute child process “dbus-launch” (No such file or directory)
root@HP-Pavilion-g7-Notebook-PC:/pwd# 

Installation Method Installed entirely using Docker. I created a shell script that invokes the docker run command from the README, localized for my environment. Here is the script:

! /bin/sh

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 -vv -b HBTL -i wlp1s0 -s 192.168.253.225 -p HBTL.jpeg -t HBTL

The initial run pulled in all the bits and pieces, then the container executed as expected. (I had to use xhost +local: to get X to speak to the Docker container.)

Supporting software Versions

This is running on a Ubuntu 24.04 Desktop machine. I'm running current versions of Docker - Docker version 27.5.1, build 9f9e405

The Docker container doesn't have python or virtualenv, but the python3 version is shown below:

bash: python: command not found

root@HP-Pavilion-g7-Notebook-PC:/pwd# python3 --version
Python 3.9.2

root@HP-Pavilion-g7-Notebook-PC:/pwd# virtualenv --version
bash: virtualenv: command not found

Actual output

The logs (above) show what I see. The previous posts show other diagnostic commands I issued within the Docker container environment to see whether I could see the WiFi card (I could).

My question I peeked at the code to see what commandswifi-survey issues to query the WiFi subsytem, but couldn't figure it out. (The libnl code is pretty abstract...) What command(s) does wifi-survey issue to query the WiFi subsystem? I'll run them from inside the Docker container and report back. Thanks.

richb-hanover avatar Feb 05 '25 02:02 richb-hanover