{"record":{"id":"c62526bc996ffd45","repo":"AlexxIT/go2rtc","slug":"can-t-get-device-sdp","errorCode":null,"errorMessage":"can't get device SDP","messagePattern":"can't get device SDP","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/roborock/client.go","lineNumber":171,"sourceCode":"\t}\n\n\tsendOffer.Done()\n\n\t// 6. Receive answer\n\tts := time.Now().Add(time.Second * 5)\n\tfor {\n\t\ttime.Sleep(time.Second)\n\n\t\tif desc, _ := c.GetDeviceSDP(); desc != nil {\n\t\t\t//log.Printf(\"[roborock] answer\\n%s\", desc.SDP)\n\t\t\tif err = c.conn.SetAnswer(desc.SDP); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tbreak\n\t\t}\n\n\t\tif time.Now().After(ts) {\n\t\t\treturn errors.New(\"can't get device SDP\")\n\t\t}\n\t}\n\n\tticker := time.NewTicker(time.Second * 2)\n\tfor {\n\t\tselect {\n\t\tcase <-ticker.C:\n\t\t\t// 7. Receive remote candidates\n\t\t\tif pc.ICEConnectionState() == pion.ICEConnectionStateCompleted {\n\t\t\t\tticker.Stop()\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\tif ice, _ := c.GetDeviceICE(); ice != nil {\n\t\t\t\tfor _, candidate := range ice {\n\t\t\t\t\t_ = c.conn.AddCandidate(candidate)\n\t\t\t\t}\n\t\t\t}","sourceCodeStart":153,"sourceCodeEnd":189,"githubUrl":"https://github.com/AlexxIT/go2rtc/blob/c245815e75e2a5fd60b4290f12bfc04e55a984d3/pkg/roborock/client.go#L153-L189","documentation":"Roborock Connect timeout: after sending the WebRTC offer, the client polled GetDeviceSDP every second for 5 seconds without receiving the device's answer SDP. The vacuum did not answer signaling in time, so SetAnswer was never possible and Connect gives up.","triggerScenarios":"The Roborock IoT call requesting the device SDP gets no response before the deadline — device offline, slow to respond, or the MQTT/RPC channel to the camera stalls.","commonSituations":"Robot vacuum sleeping or out of dock connectivity; weak Wi-Fi on the device; camera busy with another session so it ignores the SDP request.","solutions":["Verify the device is online and responsive in the Roborock app","Retry Connect once the device wakes up (off dock / out of sleep)","Increase the SDP wait deadline if your network is slow","Ensure no competing streaming session holds the camera"],"exampleFix":null,"handlingStrategy":"retry","validationCode":"if status, _ := c.GetHomesecConnectStatus(); status == \"\" {\n    return errors.New(\"device not reachable for SDP exchange\")\n}","typeGuard":null,"tryCatchPattern":"err := client.Connect(ctx)\nif err != nil && err.Error() == \"can't get device SDP\" {\n    time.Sleep(5 * time.Second)\n    err = client.Connect(ctx)\n}","preventionTips":["Wake the device / confirm it is docked-online before dialing","Use a reliable low-latency MQTT path to the device","Increase the SDP timeout on slow networks"],"tags":["sdp","webrtc","timeout"],"backgroundTag":"request-timeout","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"}