nerves_network
nerves_network copied to clipboard
Show debug information regarding the connection state of WpaSupplicant
This resulted from a conversation in the nerves slack channel. As far as I understand one would like to register for the events the WpaSupplicant
emits and handle them accordingly.
connor-rigby:
{:ok, _} = Elixir.Registry.register(Nerves.WpaSupplicant, interface, [])
def handle_info({Nerves.WpaSupplicant, {:INFO, "WPA: 4-Way Handshake failed - pre-shared key may be incorrect"}, _})
def handle_info({Nerves.WpaSupplicant, :"CTRL-EVENT-NETWORK-NOT-FOUND", _}, state)
def handle_info({Nerves.WpaSupplicant, :"CTRL-EVENT-NETWORK-NOT-FOUND"}, state)
Something like
:ok = Nerves.Network.setup(interface, settings)
Nerves.Network.subscribte(interface)