wifi-connect icon indicating copy to clipboard operation
wifi-connect copied to clipboard

Error: Getting access points failed

Open marclennox opened this issue 5 years ago • 6 comments

I'm seeing the following error about 50% of the time after choosing a WiFi network in the captive portal. It happens both if I enter a correct and incorrect WiFi password.

27.01.20 18:07:33 (-0500)  main  Connecting to access point 'Home Guest'...
27.01.20 18:07:49 (-0500)  main  [wifi_connect::network:WARN] Connection to access point not activated 'Home Guest': Activating
27.01.20 18:07:50 (-0500)  main  Error: Getting access points failed
27.01.20 18:07:50 (-0500)  main    caused by: D-Bus failure: Get org.freedesktop.NetworkManager.AccessPoint::WpaFlags property failed on /org/freedesktop/NetworkManager/AccessPoint/569: No such interface “org.freedesktop.DBus.Properties” on object at path /org/freedesktop/NetworkManager/AccessPoint/569
27.01.20 18:07:50 (-0500)  main    caused by: "No such interface “org.freedesktop.DBus.Properties” on object at path /org/freedesktop/NetworkManager/AccessPoint/569"
27.01.20 18:07:50 (-0500)  main  Error: Getting access points failed
27.01.20 18:07:50 (-0500)  main    caused by: D-Bus failure: Get org.freedesktop.NetworkManager.AccessPoint::WpaFlags property failed on /org/freedesktop/NetworkManager/AccessPoint/569: No such interface “org.freedesktop.DBus.Properties” on object at path /org/freedesktop/NetworkManager/AccessPoint/569
27.01.20 18:07:50 (-0500)  main    caused by: "No such interface “org.freedesktop.DBus.Properties” on object at path /org/freedesktop/NetworkManager/AccessPoint/569"

marclennox avatar Jan 27 '20 23:01 marclennox

I'm encountering the same problem. I can observe this behaviour everytime I provide a invalid PSK for a WLAN to connect. @marclennox Did you find any solution or hints?

crzdg avatar Oct 08 '20 12:10 crzdg

@crzdg I feel like the problem went away in later versions of wifi-connect. That being said I'm not sure on this. But the way we ended up using wifi-connect is to use a script with nmcli to clear out any wifi connection "residue" and then run wifi-connect in a timed loop, so that it's always starting with a clean slate. This approach is working well for us.

marclennox avatar Oct 08 '20 12:10 marclennox

@marclennox Thanks for the fast reply. I'm encoutering the problem with the latest versions 4.4.0 and 4.4.1. I also though about approaching a clean state before wifi-connect being launched, happy to hear this could be a valid approach. I will have a deeper look into it. Thanks again!

crzdg avatar Oct 08 '20 13:10 crzdg

@crzdg No problem, let me know how it works out for you. I definitely found that a problems seemed to happen when there was left over residue in terms of nmcli connections.

marclennox avatar Oct 08 '20 13:10 marclennox

I ended up using a conditional while loop around the WiFi connect part. This way I can check if my desired state is present as soon the WiFi Connect program exits. No matter if the exit was caused by DBus error or successful connection. If no error is thrown, the WiFi Connect does not exit but properly restart the wifi-connect. For anyone interested the scripts steps are as follows.

  1. sleep 15 seconds (wait for devices)
  2. scan APs with iwlist scan
  3. check if WLAN connection is present with iwgetid -r
  4. check if ping to environment is possible with ping HOSTNAME -c 2
  5. If both checks equal 0 do not start WiFi-Connect. Just start the main application
  6. If one checks fails (OR condition) start the while loop.
  7. In the while loop
  8. scan APs again with iwlist scan
  9. sleep 5seconds (updating AP list)
  10. start wifi-connect
  11. wifi-connect exits
  12. sleep 5seconds (give interfaces some time)
  13. recheck if WLAN connection is present with iwgetid -r
  14. recheck if ping to environment is possible with ping HOSTNAME -c 2
  15. If both checks are successful and return 0 exit the loop otherwise go to 8.
  16. When loop is exited, start main application

crzdg avatar Oct 08 '20 15:10 crzdg