AlexxIT/go2rtc · error

wyze: only DTLS cameras are supported

Error message

wyze: only DTLS cameras are supported

What it means

Returned by wyze.Dial() when the URL parses but its query string lacks dtls=true. This Wyze integration only supports DTLS-based transport; cameras/sessions negotiated over other transports are explicitly rejected at dial time rather than failing later mid-stream.

Solutions

  1. Append dtls=true (lowercase, exact) to the wyze:// URL query string
  2. Confirm the camera supports DTLS transport — non-DTLS models cannot be used with this integration
  3. Fix config templates that emit dtls=True/1 instead of true
  4. Validate the final URL with url.Parse and query.Get("dtls") == "true" before calling Dial
  5. Check go2rtc docs for the current required Wyze URL parameters

Example fix

// before
wyze://cam.local?uid=ABC&enr=XYZ&dtls=True
// after
wyze://cam.local?uid=ABC&enr=XYZ&dtls=true
Defensive patterns

Strategy: validation

Validate before calling

// Go: enforce the dtls flag before Dial
u, _ := url.Parse(rawURL)
if u.Query().Get("dtls") != "true" {
    return errors.New("wyze URL must include dtls=true (lowercase)")
}

Type guard

func isDtlsWyzeURL(raw string) bool { u, err := url.Parse(raw); return err == nil && u.Query().Get("dtls") == "true" }

Try / catch

client, err := wyze.Dial(rawURL)
if err != nil {
    if strings.Contains(err.Error(), "only DTLS") {
        return errors.New("camera does not support DTLS or URL lacks dtls=true")
    }
    return err
}

Prevention

When it happens

Trigger: Calling wyze.Dial(rawURL) on a URL whose query parameter dtls is missing or set to anything other than the exact string "true" (case-sensitive).

Common situations: Copy-pasted URL that dropped the dtls=true parameter; writing DTLS=True or dtls=1 (rejected by the strict string comparison); camera model known to require non-DTLS transport; template that omits the flag conditionally.

Understand the failure class

Background: UnsupportedOperationException and "is not supported" errors: when a library deliberately refuses a call — this error's family across 30 libraries.

Related errors


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

Appendix: source

Thrown at pkg/wyze/client.go:89

	audioSampleRate uint32
	audioChannels   uint8
}

type AuthResponse struct {
	ConnectionRes string         `json:"connectionRes"`
	CameraInfo    map[string]any `json:"cameraInfo"`
}

func Dial(rawURL string) (*Client, error) {
	u, err := url.Parse(rawURL)
	if err != nil {
		return nil, fmt.Errorf("wyze: invalid URL: %w", err)
	}

	query := u.Query()

	if query.Get("dtls") != "true" {
		return nil, fmt.Errorf("wyze: only DTLS cameras are supported")
	}

	c := &Client{
		host:    u.Host,
		uid:     query.Get("uid"),
		enr:     query.Get("enr"),
		mac:     query.Get("mac"),
		model:   query.Get("model"),
		verbose: query.Get("verbose") == "true",
	}

	c.authKey = string(dtls.CalculateAuthKey(c.enr, c.mac))

	if c.verbose {
		fmt.Printf("[Wyze] Connecting to %s (UID: %s)\n", c.host, c.uid)
	}

	if err := c.connect(); err != nil {

View on GitHub (pinned to c245815e75)