 
     connected = match?({:ok, {:hostent, 'nerves-project.org', [], :inet, 4, _}}, test_dns())
     if connected do
+      Logger.info 1, "Connected to network!"
       not_found_timer = cancel_not_found_timer(state.not_found_timer)
       {:noreply, %{state | ip_address: ip, connected: true, not_found_timer: not_found_timer, ntp_timer: ntp_timer}}
     else

  defp cancel_not_found_timer(timer) do
    # If there was a timer, cancel it.
    if timer do
      Process.cancel_timer(timer)
    end
    nil

      delay_timer > 0 ->
        Logger.warn 1, "Network not found. Starting timer."
        timer = Process.send_after(self(), :network_not_found_timer, round(delay_timer))
        {:noreply, %{state | not_found_timer: timer, connected: false}}
      is_nil(delay_timer) ->
        Logger.error 1, "Network not found"
        Farmbot.System.factory_reset("WIFI Authentication failed. (network not found)")
