AlexxIT/go2rtc · error

miss: auth

Error message

miss: auth: %s

What it means

login reads the auth command response from the Miss camera and requires it to contain the JSON fragment "result":"success". If the device responds with anything else (error JSON, empty payload, firmware mismatch output), the raw data is wrapped in this error.

Solutions

  1. Inspect the embedded data in the error for the device's actual response
  2. Verify the Miss credentials and uid used for the connection
  3. Confirm you are connecting to the correct camera host/port
  4. Update the library or camera firmware if the auth protocol version differs

Example fix

// before
client, err := miss.Dial(ctx, "miss://host?vendor=tutk&uid=X") // wrong uid
// after
client, err := miss.Dial(ctx, "miss://host?vendor=tutk&uid=CORRECT_UID_FROM_APP")
Defensive patterns

Strategy: try-catch

Validate before calling

if uid == "" || host == "" { return errors.New("uid and host are required for miss Dial") }

Try / catch

client, err := miss.Dial(ctx, url)
if err != nil && strings.Contains(err.Error(), "miss: auth:") {
    log.Printf("auth rejected: %s", strings.TrimPrefix(err.Error(), "miss: auth: "))
    // verify credentials/uid and retry
}

Prevention

When it happens

Trigger: Calling NewClient (which performs login) when the camera's auth response does not contain "result":"success" — wrong credentials, wrong device, or a device that answered with an error payload.

Common situations: Wrong username/password for the Miss device; camera firmware with a different auth response format; connecting to the wrong host/port hitting a different service.

Related errors


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

Appendix: source

Thrown at pkg/xiaomi/miss/client.go:119

	cmdDevInfoRes        = 0x111
	cmdMotorReq          = 0x112
	cmdMotorRes          = 0x113
	cmdEncoded           = 0x1001
)

func login(conn Conn, clientPublic, sign string) error {
	s := fmt.Sprintf(`{"public_key":"%s","sign":"%s","uuid":"","support_encrypt":0}`, clientPublic, sign)
	if err := conn.WriteCommand(cmdAuthReq, []byte(s)); err != nil {
		return err
	}

	_, data, err := conn.ReadCommand()
	if err != nil {
		return err
	}

	if !bytes.Contains(data, []byte(`"result":"success"`)) {
		return fmt.Errorf("miss: auth: %s", data)
	}

	return nil
}

func (c *Client) Version() string {
	return fmt.Sprintf("%s (%s)", c.Conn.Version(), c.model)
}

func (c *Client) WriteCommand(data []byte) error {
	data, err := crypto.Encode(data, c.key)
	if err != nil {
		return err
	}
	return c.Conn.WriteCommand(cmdEncoded, data)
}

const (

View on GitHub (pinned to c245815e75)