AlexxIT/go2rtc · error

tapo: wrond status

Error message

tapo: wrond status: ${res.Status}

What it means

Tapo dial guard: the preliminary request did not return the expected 401 with a Digest WWW-Authenticate challenge (status appended, note the source typo 'wrond'). Tapo cameras are expected to demand Digest auth; getting 200/403/anything else means the endpoint or firmware behaves differently, so credentials cannot be negotiated.

Solutions

  1. Verify the URL hits the camera's stream endpoint ('/stream0' style paths)
  2. Check firmware — non-Tapo devices on the same protocol may not use Digest
  3. Handle 403 by confirming device time/credentials, then retry
Defensive patterns

Strategy: try-catch

When it happens

Trigger: Thrown at pkg/tapo/client.go:327 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of AlexxIT/go2rtc@c245815e75 (2026-09-07). Data as JSON: /api/errors/7c3fdac75d8ee668. Report an issue: GitHub.

Appendix: source

Thrown at pkg/tapo/client.go:327

	}

	if err = req.Write(conn); err != nil {
		return nil, nil, err
	}

	r := bufio.NewReader(conn)

	res, err := http.ReadResponse(r, req)
	if err != nil {
		return nil, nil, err
	}
	_, _ = io.Copy(io.Discard, res.Body) // discard leftovers
	_ = res.Body.Close()                 // ignore response body

	auth := res.Header.Get("WWW-Authenticate")

	if res.StatusCode != http.StatusUnauthorized || !strings.HasPrefix(auth, "Digest") {
		return nil, nil, errors.New("tapo: wrond status: " + res.Status)
	}

	if brand == "tapo" && password == "" {
		// support cloud password in place of username
		if strings.Contains(auth, `encrypt_type="3"`) {
			password = fmt.Sprintf("%32X", sha256.Sum256([]byte(username)))
		} else {
			password = fmt.Sprintf("%16X", md5.Sum([]byte(username)))
		}
		username = "admin"
	} else if brand == "vigi" && username == "admin" {
		password = securityEncode(password)
	}

	realm := tcp.Between(auth, `realm="`, `"`)
	nonce := tcp.Between(auth, `nonce="`, `"`)
	qop := tcp.Between(auth, `qop="`, `"`)
	uri := req.URL.RequestURI()

View on GitHub (pinned to c245815e75)