Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Devices disconnect when my phone goes to sleep #155

Open
joymyr opened this issue Feb 16, 2022 · 0 comments
Open

Devices disconnect when my phone goes to sleep #155

joymyr opened this issue Feb 16, 2022 · 0 comments

Comments

@joymyr
Copy link

joymyr commented Feb 16, 2022

Every time my phone goes to sleep I see messages like this:

1|cast-web-api  | 2022-02-16T11:03:36.594Z 4647135ec8e8308b2a3eef50598bbdf0 CastMedia.disconnect(): host: 192.168.1.186, port: 8009
1|cast-web-api  | 2022-02-16T11:03:36.648Z 4647135ec8e8308b2a3eef50598bbdf0 ReconnectionManager.stop():
1|cast-web-api  | 2022-02-16T11:03:36.671Z 4647135ec8e8308b2a3eef50598bbdf0 removeDevice(): deviceExists: false
1|cast-web-api  | deviceDown: {"id":"2111a3fe16a639b340771fb91d7d2d16","name":"Gangen","address":{"port":8009,"host":"192.168.1.114"},"groups":[]}
1|cast-web-api  | 2022-02-16T11:03:36.704Z 2111a3fe16a639b340771fb91d7d2d16 removeDevice():

And the device call returns an empty list. All devices are still working, and I can ping them.

If I wake my phone up again, I see messages like this within a few seconds:

1|cast-web-api  | 2022-02-16T11:10:50.986Z 2111a3fe16a639b340771fb91d7d2d16 CastDevice.constructor(): autoConnect
1|cast-web-api  | 2022-02-16T11:10:51.008Z 2111a3fe16a639b340771fb91d7d2d16 CastDevice.connect(): connecting
1|cast-web-api  | 2022-02-16T11:10:51.029Z 2111a3fe16a639b340771fb91d7d2d16 CastReceiver.connect(): host: 192.168.1.114, port: 8009
1|cast-web-api  | deviceUp: {"id":"2111a3fe16a639b340771fb91d7d2d16","name":"Gangen","address":{"port":8009,"host":"192.168.1.114","rejectUnauthorized":false},"groups":[]}
1|cast-web-api  | 2022-02-16T11:10:51.145Z 2111a3fe16a639b340771fb91d7d2d16 addDevice():

And the api starts working again.

I guess my phone sends a request that makes the devices broadcast their status which is also picked up by the cast-web-api.
Why does the cast-web-api think my devices is disconnected? Is there some way I can make it reconnect automatically or just never disconnect my devices?

BTW the assistant functionality is fully reliable for me, but I prefer the device APIs if only I can make it reliable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant