           cb.()
         end
 
-        {:ok, %{logging_in: false, context: context}}
+        {:ok, %{logging_in: false, context: context, retries: 0}}
       end
 
       # don't start this interface

        {:noreply, state}
      end

      def handle_info({Nerves.WpaSupplicant, event, %{ifname: iface}}, state) when is_atom(event) do
        event = event |> Atom.to_string
        wrong_key? = event |> String.contains?("reason=WRONG_KEY")

        password, or an unsupported network type.
        """)

        if not_found? do
          {:noreply, %{state | retries + 1}}
        else
          {:noreply, state}
        end
      end

      def handle_info(info, state) do
