Closed stephen304 closed 3 years ago
The log for error when calling /seek-to
uses debug level :roll_eyes: . I changed it to error level and I added the error from go-chromecast in the message. You can use master (or latest docker images), if it happens again we will see the error.
Anyway the timing is weird. watch
is set to send a message every second, and the code just react to those messages, but thoses log indicate that it is trying to seek every 10 or 13s. It seems like something (the httpserver probably) is either slow to timeout or does automatic retries. I need to dig that.
I just add the same bug as you!
This is what I saw:
/devices
still see the device/connect?uuid=...
says the device is already connected/seek-to
complains with "unable to seek-to device: unable to write binary format: write tcp 192.168.1.42:58146->192.168.1.36:8009: write: broken pipe"Unfortunately I didn't try to call /disconnect
, then /connect
again, then /seek-to
. If you do have the error again could you try to do that please?
The error comes from here: https://github.com/vishen/go-chromecast/blob/0795e28217f8b18586ebb69c1569c46451dbab0b/cast/connection.go#L121. It seems like the connection is just broken. I will implement a disconnect / reconnect mechanism.
Sounds good, I was too slow to reproduce the issue :)
Got it to happen again, this is what happens when I try to disconnect / reconnect: It still doesn't seem to fix the issue
Yes, go-chromecast can't disconnect from a broken connection. I am opening an issue on their side.
Looks like that fix makes disconnecting and reconnecting work to fix the issue. I guess all that's needed is to auto reconnect when it gets disconnected
Tell me if it happens again. I spotted a weird bug in go-chromecast where the /seek-to endpoint can return a 200 even if the connection is broken (https://github.com/vishen/go-chromecast/issues/106). If that happens we will not do a disconnect / reconnect.
But I suspect that in real life conditions the endpoint would return an error, and in that case the code will try to reconnect.
Ran into this just now - It looks like it's trying to skip the same segment but nothing actually happened:
Unfortunately I wasn't running in debug mode. Also worth noting that it seems to be permanently stuck in this state.
I'm not familiar at all with the go-chromecast http api, any ideas on what might be the cause?
Edit: Could it be that the watch thread is still connected but the http api used for skipping lost the device?