Closed tclev closed 2 years ago
Was about to report the same crash. In my case the AP setup is called in Farmbot OS to run their Configurator.
In my environment it was an eero mesh router pair that triggered the crash . . for whatever reason these routers broadcast their mesh peer capability on a 'hidden' network ( though it has some hex SSID string matching the mesh_id ).
@tclev, I notice you also have a eero MAC in your last message :)
I do also have an Eero mesh system. So it may also be that. Would be wonderful if it was just this fix. 😀
@tclev @jsimmonds2 These are great hints. Thank you!
I was able to reproduce the reported stack traces via a unit test. It looked like the best fix for now was to ignore the special mesh network in the access point results. I don't think it would be possible to connect anyway.
It's getting late here, so I'm going to let the fix sit until tomorrow. I have one other bug with vintage_net_wifi that I want to investigate tomorrow. Hopefully I get a fix for it in, but if not, I'll push out a release anyway for both of you. Thanks again for the detailed report. It made it pretty easy to see what was happening.
I grabbed your latest branch and I'm now able to connect to the internet via wifi!
Awesome!!! Thanks for letting me know that it worked. I got distracted at work, but will merge now. And with confidence thanks to your report. :)
Describe the bug When either scanning for networks or trying to connect to a wireless network VintageNet throws an error and does not connect to the AP.
To Reproduce Steps to reproduce the behavior:
log_attach
VintageNet.scan("wlan0")
Expected behavior It should connect to the AP, or in the case of scan return available APs (or at least not throw an error).
VintageNet Info
Output of
VintageNet.info
(please hide any sensitive information like WiFi PSKs)Environment
Nerves environment: (
mix nerves.env --info
)|nerves_bootstrap| Loadpaths Start
Nerves environment MIX_TARGET: rpi3 MIX_ENV: dev
|nerves_bootstrap| Environment Variable List target: rpi3 toolchain: /home/tclev/.nerves/artifacts/nerves_toolchain_armv7_nerves_linux_gnueabihf-linux_x86_64-1.5.0 system: /home/tclev/.nerves/artifacts/nerves_system_rpi3-portable-1.18.1 app: .
|nerves_bootstrap| Loadpaths End
iex(2)> VintageNet.scan("wlan0") :ok
17:40:28.009 [info] WPASupplicant ignoring {:event, "WPS-AP-AVAILABLE"}
17:40:28.009 [info] WPASupplicant ignoring {:event, "CTRL-EVENT-NETWORK-NOT-FOUND"}
17:40:28.017 [error] GenServer {VintageNet.Interface.Registry, {VintageNetWiFi.WPASupplicant, "wlan0"}} terminating ** (FunctionClauseError) no function clause matching in VintageNetWiFi.WPASupplicant.add_access_point/2 (vintage_net_wifi 0.10.6) lib/vintage_net_wifi/wpa_supplicant.ex:481: VintageNetWiFi.WPASupplicant.add_access_point(%{access_points: %{"f8:bb:bf:0a:f7:86" => %VintageNetWiFi.AccessPoint{band: :wifi_2_4_ghz, bssid: "f8:bb:bf:0a:f7:86", channel: 1, flags: [:wpa2_psk_ccmp, :wpa2, :psk, :ccmp, :ess], frequency: 2412, signal_dbm: -33, signal_percent: 94, ssid: "Alias"}, "f8:bb:bf:0a:f7:8f" => %VintageNetWiFi.AccessPoint{band: :wifi_2_4_ghz, bssid: "f8:bb:bf:0a:f7:8f", channel: 1, flags: [:wpa2_psk_ccmp, :wpa2, :psk, :ccmp, :ess], frequency: 2412, signal_dbm: -33, signal_percent: 94, ssid: "Alias Guest"}}, ap_mode: false, bssid_requester: #PID<0.1171.0>, clients: [], control_dir: "/tmp/vintage_net/wpa_supplicant", current_ap: nil, eap_status: %VintageNet.Interface.EAPStatus{method: nil, remote_certificate_verified?: false, status: nil, timestamp: nil}, ifname: "wlan0", keep_alive_interval: 60000, ll: #PID<0.1169.0>, peers: [], verbose: false, wpa_supplicant: "wpa_supplicant", wpa_supplicant_conf_path: "/tmp/vintage_net/wpa_supplicant.conf.wlan0"}, %VintageNetWiFi.MeshPeer{active_path_selection_metric_id: 1, active_path_selection_protocol_id: 1, age: 0, authentication_protocol_id: 1, band: :wifi_2_4_ghz, beacon_int: 100, bss_basic_rate_set: "10 20 55 110 60 120 240", bssid: "f8:bb:bf:0a:f7:83", capabilities: 16, channel: 1, congestion_control_mode_id: 0, est_throughput: 65000, flags: [:rsn, :sae, :ccmp, :mesh], frequency: 2412, id: 2, mesh_capability: %VintageNetWiFi.MeshPeer.Capabilities{accepting_peerings: true, forwarding: true, mbca_enabled: false, mcca_enabled: false, mcca_supported: false, power_slave_level: false, tbtt_adjusting: true}, mesh_formation_info: %VintageNetWiFi.MeshPeer.FormationInformation{connected_to_as: false, connected_to_mesh_gate: false, number_of_peerings: 2}, mesh_id: "4e044", noise_dbm: -89, quality: 0, signal_dbm: -34, signal_percent: 93, snr: 55, ssid: "4e044", synchronization_method_id: 1}) (vintage_net_wifi 0.10.6) lib/vintage_net_wifi/wpa_supplicant.ex:198: VintageNetWiFi.WPASupplicant.handle_info/2 (stdlib 3.17) gen_server.erl:695: :gen_server.try_dispatch/4 (stdlib 3.17) gen_server.erl:771: :gen_server.handle_msg/6 (stdlib 3.17) proc_lib.erl:226: :proc_lib.init_p_do_apply/3 Last message: {:bssid_result, %VintageNetWiFi.MeshPeer{active_path_selection_metric_id: 1, active_path_selection_protocol_id: 1, age: 0, authentication_protocol_id: 1, band: :wifi_2_4_ghz, beacon_int: 100, bss_basic_rate_set: "10 20 55 110 60 120 240", bssid: "f8:bb:bf:0a:f7:83", capabilities: 16, channel: 1, congestion_control_mode_id: 0, est_throughput: 65000, flags: [:rsn, :sae, :ccmp, :mesh], frequency: 2412, id: 2, mesh_capability: %VintageNetWiFi.MeshPeer.Capabilities{accepting_peerings: true, forwarding: true, mbca_enabled: false, mcca_enabled: false, mcca_supported: false, power_slave_level: false, tbtt_adjusting: true}, mesh_formation_info: %VintageNetWiFi.MeshPeer.FormationInformation{connected_to_as: false, connected_to_mesh_gate: false, number_of_peerings: 2}, mesh_id: "4e044", noise_dbm: -89, quality: 0, signal_dbm: -34, signal_percent: 93, snr: 55, ssid: "4e044", synchronization_method_id: 1}, #Function<4.102249467/2 in VintageNetWiFi.WPASupplicant."-fun.add_access_point/2-">} State: %{access_points: %{"f8:bb:bf:0a:f7:86" => %VintageNetWiFi.AccessPoint{band: :wifi_2_4_ghz, bssid: "f8:bb:bf:0a:f7:86", channel: 1, flags: [:wpa2_psk_ccmp, :wpa2, :psk, :ccmp, :ess], frequency: 2412, signal_dbm: -33, signal_percent: 94, ssid: "Alias"}, "f8:bb:bf:0a:f7:8f" => %VintageNetWiFi.AccessPoint{band: :wifi_2_4_ghz, bssid: "f8:bb:bf:0a:f7:8f", channel: 1, flags: [:wpa2_psk_ccmp, :wpa2, :psk, :ccmp, :ess], frequency: 2412, signal_dbm: -33, signal_percent: 94, ssid: "Alias Guest"}}, ap_mode: false, bssid_requester: #PID<0.1171.0>, clients: [], control_dir: "/tmp/vintage_net/wpa_supplicant", current_ap: nil, eap_status: %VintageNet.Interface.EAPStatus{method: nil, remote_certificate_verified?: false, status: nil, timestamp: nil}, ifname: "wlan0", keep_alive_interval: 60000, ll: #PID<0.1169.0>, peers: [], verbose: false, wpa_supplicant: "wpa_supplicant", wpa_supplicant_conf_path: "/tmp/vintage_net/wpa_supplicant.conf.wlan0"}
17:40:29.052 [debug] wpa_supplicant: Successfully initialized wpa_supplicant
17:40:31.268 [info] cam1-reg: disabling
17:40:31.269 [info] cam-dummy-reg: disabling