AlexxIT/go2rtc · error
wyze: K10001 parse failed
Error message
wyze: K10001 parse failed: %w
What it means
After receiving the K10001 challenge payload, doKAuth parses it with parseK10001. If parsing fails (bad HL magic, payload shorter than 33 bytes, malformed fields), the error is wrapped as "wyze: K10001 parse failed".
Solutions
- Log the raw HL payload (verbose mode prints sizes; dump bytes) to inspect what the camera actually sent.
- Check the camera status field — a rejected auth may arrive in a non-challenge frame; verify credentials (authKey/enr).
- Compare the payload layout against the library's expected K10001 format for your firmware version.
- Retry the connection; if consistent, the firmware protocol likely differs and needs a library update.
Defensive patterns
Strategy: validation
Try / catch
if err := client.Dial(); err != nil {
if strings.Contains(err.Error(), "K10001 parse failed") {
// dump raw payload via verbose mode and report firmware incompatibility
return fmt.Errorf("camera K10001 response unrecognized: %w", err)
}
return err
} Prevention
- Enable verbose logging to capture unexpected payloads
- Verify credentials — rejection frames often parse as malformed challenges
- Track firmware versions known to work with the library
When it happens
Trigger: Camera returned a K10001 response that is not a valid HL-framed challenge (e.g., an error/status frame instead of a challenge); response truncated on the wire; firmware sends a different K10001 layout than expected.
Common situations: Firmware update changed the K10001 payload structure; camera returned an error/auth-reject frame the parser treats as a challenge; corrupted packet over a flaky connection.
Related errors
- wyze: K10003 parse failed
- data too short: bytes
- tlv8: zero item
- hap: wrong request: %#v
- hap: wrong response: %#v, on request: %#v
AI-assisted analysis of AlexxIT/go2rtc@c245815e75 (2026-09-07).
Data as JSON: /api/errors/933d81547f395c44.
Report an issue: GitHub.
Appendix: source
Thrown at pkg/wyze/client.go:345
}
if c.verbose {
fmt.Printf("[Wyze] AV Login response received\n")
}
return nil
}
func (c *Client) doKAuth() error {
// Step 1: K10000 -> K10001 (Challenge)
data, err := c.conn.WriteAndWaitIOCtrl(c.buildK10000(), c.matchHL(KCmdChallenge), 5*time.Second)
if err != nil {
return fmt.Errorf("wyze: K10001 failed: %w", err)
}
hlData := c.extractHL(data)
challenge, status, err := c.parseK10001(hlData)
if err != nil {
return fmt.Errorf("wyze: K10001 parse failed: %w", err)
}
if c.verbose {
fmt.Printf("[Wyze] K10001 challenge received, status=%d\n", status)
}
// Step 2: K10002 -> K10003 (Auth)
data, err = c.conn.WriteAndWaitIOCtrl(c.buildK10002(challenge, status), c.matchHL(KCmdAuthResult), 5*time.Second)
if err != nil {
return fmt.Errorf("wyze: K10002 failed: %w", err)
}
hlData = c.extractHL(data)
// Parse K10003 response
authResp, err := c.parseK10003(hlData)
if err != nil {
return fmt.Errorf("wyze: K10003 parse failed: %w", err)
}View on GitHub (pinned to c245815e75)