wifi-connect
wifi-connect copied to clipboard
Error: Getting access points failed
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"
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 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 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 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.
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.
- sleep 15 seconds (wait for devices)
- scan APs with
iwlist scan
- check if WLAN connection is present with
iwgetid -r
- check if ping to environment is possible with
ping HOSTNAME -c 2
- If both checks equal 0 do not start WiFi-Connect. Just start the main application
- If one checks fails (OR condition) start the while loop.
- In the while loop
- scan APs again with
iwlist scan
- sleep 5seconds (updating AP list)
- start wifi-connect
- wifi-connect exits
- sleep 5seconds (give interfaces some time)
- recheck if WLAN connection is present with
iwgetid -r
- recheck if ping to environment is possible with
ping HOSTNAME -c 2
- If both checks are successful and return 0 exit the loop otherwise go to 8.
- When loop is exited, start main application