Add a hack to use `iw` instead of VintageNet for now

pull/974/head
Connor Rigby 2019-07-18 14:03:20 -07:00
parent 1f43240bd0
commit e6c7c6e0aa
No known key found for this signature in database
GPG Key ID: 29A88B24B70456E0
4 changed files with 6 additions and 8 deletions

View File

@ -97,6 +97,7 @@ defmodule FarmbotOS.MixProject do
{:nerves_firmware_ssh, "~> 0.4", targets: @all_targets},
{:circuits_gpio, "~> 0.4", targets: @all_targets},
{:toolshed, "~> 0.2", targets: @all_targets},
{:iw, "~> 0.2", targets: @all_targets},
# {:vintage_net, "~> 0.3.1", targets: @all_targets},
{:vintage_net,
github: "nerves-networking/vintage_net", tag: "master", targets: @all_targets},

View File

@ -30,6 +30,7 @@
"goldrush": {:hex, :goldrush, "0.1.9", "f06e5d5f1277da5c413e84d5a2924174182fb108dabb39d5ec548b27424cd106", [:rebar3], [], "hexpm"},
"hackney": {:hex, :hackney, "1.15.1", "9f8f471c844b8ce395f7b6d8398139e26ddca9ebc171a8b91342ee15a19963f4", [:rebar3], [{:certifi, "2.5.1", [hex: :certifi, repo: "hexpm", optional: false]}, {:idna, "6.0.0", [hex: :idna, repo: "hexpm", optional: false]}, {:metrics, "1.0.1", [hex: :metrics, repo: "hexpm", optional: false]}, {:mimerl, "~>1.1", [hex: :mimerl, repo: "hexpm", optional: false]}, {:ssl_verify_fun, "1.1.4", [hex: :ssl_verify_fun, repo: "hexpm", optional: false]}], "hexpm"},
"idna": {:hex, :idna, "6.0.0", "689c46cbcdf3524c44d5f3dde8001f364cd7608a99556d8fbd8239a5798d4c10", [:rebar3], [{:unicode_util_compat, "0.4.1", [hex: :unicode_util_compat, repo: "hexpm", optional: false]}], "hexpm"},
"iw": {:hex, :iw, "0.2.0", "f9f9890e1e050b0a7017def96e94efa0933fb472bf3095c111ef6c8bf9bf8532", [:make, :mix], [{:elixir_make, "~> 0.5", [hex: :elixir_make, repo: "hexpm", optional: false]}], "hexpm"},
"jason": {:hex, :jason, "1.1.2", "b03dedea67a99223a2eaf9f1264ce37154564de899fd3d8b9a21b1a6fd64afe7", [:mix], [{:decimal, "~> 1.0", [hex: :decimal, repo: "hexpm", optional: true]}], "hexpm"},
"jsx": {:hex, :jsx, "2.9.0", "d2f6e5f069c00266cad52fb15d87c428579ea4d7d73a33669e12679e203329dd", [:mix, :rebar3], [], "hexpm"},
"lager": {:hex, :lager, "3.6.5", "831910109f3fcb503debf658ca0538836b348c58bfbf349a6d48228096ce9040", [:rebar3], [{:goldrush, "0.1.9", [hex: :goldrush, repo: "hexpm", optional: false]}], "hexpm"},

View File

@ -15,9 +15,7 @@ defmodule FarmbotOS.Platform.Target.Configurator.VintageNetworkLayer do
@impl FarmbotOS.Configurator.NetworkLayer
def scan(ifname) do
VintageNet.get_by_prefix(["interface", ifname, "wifi", "access_points"])
|> Enum.at(0)
|> elem(1)
Iw.ap_scan(ifname)
|> Enum.map(fn {_bssid, %{bssid: bssid, ssid: ssid, signal_percent: signal, flags: flags}} ->
%{
ssid: ssid,
@ -26,6 +24,7 @@ defmodule FarmbotOS.Platform.Target.Configurator.VintageNetworkLayer do
security: flags_to_security(flags)
}
end)
|> Enum.uniq_by(fn %{ssid: ssid} -> ssid end)
|> Enum.sort(fn
%{level: level1}, %{level: level2} -> level1 >= level2
end)

View File

@ -14,12 +14,9 @@ defmodule FarmbotOS.Platform.Target.Network do
%{
type: CaptivePortal,
wifi: %{
mode: :host,
ssid: build_hostap_ssid(),
key_mgmt: :none,
scan_ssid: 1,
ap_scan: 1,
bgscan: :simple
mode: :host,
key_mgmt: :none
},
ipv4: %{
method: :static,