{"record":{"id":"0040c10c4b7355b4","repo":"AlexxIT/go2rtc","slug":"expected-cmdid-10001-got-d","errorCode":null,"errorMessage":"expected cmdID 10001, got %d","messagePattern":"expected cmdID 10001, got (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/wyze/client.go","lineNumber":479,"sourceCode":"\treturn b\n}\n\nfunc (c *Client) parseK10001(data []byte) (challenge []byte, status byte, err error) {\n\tif c.verbose {\n\t\tfmt.Printf(\"[Wyze] parseK10001: received %d bytes\\n\", len(data))\n\t}\n\n\tif len(data) < 33 {\n\t\treturn nil, 0, fmt.Errorf(\"data too short: %d bytes\", len(data))\n\t}\n\n\tif data[0] != 'H' || data[1] != 'L' {\n\t\treturn nil, 0, fmt.Errorf(\"invalid HL magic: %x %x\", data[0], data[1])\n\t}\n\n\tcmdID := binary.LittleEndian.Uint16(data[4:])\n\tif cmdID != KCmdChallenge {\n\t\treturn nil, 0, fmt.Errorf(\"expected cmdID 10001, got %d\", cmdID)\n\t}\n\n\tstatus = data[16]\n\tchallenge = make([]byte, 16)\n\tcopy(challenge, data[17:33])\n\n\treturn challenge, status, nil\n}\n\nfunc (c *Client) parseK10003(data []byte) (*AuthResponse, error) {\n\tif c.verbose {\n\t\tfmt.Printf(\"[Wyze] parseK10003: received %d bytes\\n\", len(data))\n\t}\n\n\tif len(data) < 16 {\n\t\treturn &AuthResponse{}, nil\n\t}\n","sourceCodeStart":461,"sourceCodeEnd":497,"githubUrl":"https://github.com/AlexxIT/go2rtc/blob/c245815e75e2a5fd60b4290f12bfc04e55a984d3/pkg/wyze/client.go#L461-L497","documentation":"parseK10001 validated the HL magic but the command ID field is not KCmdChallenge (10001), meaning the packet is a different command than the expected auth challenge. The received cmdID is printed; raised during doKAuth.","triggerScenarios":"Thrown at pkg/wyze/client.go:479 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Reconnect to restart the K auth handshake from the challenge step","Update the parser if the firmware sends a revised challenge command"],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"c245815e75e2a5fd60b4290f12bfc04e55a984d3","analyzedAt":"2026-09-07T11:47:02.965Z","contentChangedAt":"2026-09-07T11:47:02.965Z","schemaVersion":2},"datasetVersion":"2026-09-16T04:17:20.429Z"}