 
     case API.get(API.client(), "/api/device") do
       {:ok, _} ->
+        _ = Leds.blue(:solid)
         http_ping_timer = Process.send_after(self(), :http_ping, ms)
         {:noreply, %{state | http_ping_timer: http_ping_timer, ping_fails: 0}}
 
       _ ->
         ping_fails = state.ping_fails + 1
         FarmbotCore.Logger.error(3, "Ping failed (#{ping_fails})")
+        _ = Leds.blue(:off)
         http_ping_timer = Process.send_after(self(), :http_ping, ms)
         {:noreply, %{state | http_ping_timer: http_ping_timer, ping_fails: ping_fails}}
     end

    jwt = Keyword.fetch!(args, :jwt)
    http_ping_timer = Process.send_after(self(), :http_ping, 5000)

    state = %State{
      conn: nil,
      chan: nil,

  def terminate(reason, state) do
    FarmbotCore.Logger.error(1, "Disconnected from PingPong channel: #{inspect(reason)}")
    # If a channel was still open, close it.
    _ = Leds.blue(:off)
    if state.chan, do: ConnectionWorker.close_channel(state.chan)
  end

