dgreif / ring

Unofficial packages for Ring Doorbells, Cameras, Alarm System, and Smart Lighting
MIT License
1.2k stars 161 forks source link

Live Streaming of camera fails after HomeKit architecture upgrade #1382

Closed ne0nex closed 7 months ago

ne0nex commented 8 months ago

Is there an existing issue for this?

Describe The Bug

After upgrading homekit architecture, when attempting to view the camera live stream, the window eventually fails with "No response" and never shows the camera feed. Homebridge logs show:

[02/01/2024, 01:09:19] [Ring] Error: Cannot get schema for 'SubjectPublicKeyInfo' target

more complete log included below.

To Reproduce

Upgrade homekit home to new architecture Attempt to livestream the camera from any device, AppleTV, Mac, iPhone, anything.

Expected behavior

Camera stream should load and not spit out this error detail

Relevant log output

[02/01/2024, 01:09:18] [Ring] Preparing Live Stream for Front Door
[02/01/2024, 01:09:18] [Ring] Stream Prepared for Front Door (0.418s)
[02/01/2024, 01:09:19] [Ring] Activating stream for Front Door (0.553s)
[02/01/2024, 01:09:19] [Ring] WebSocket connected for Front Door (Cloud)
[02/01/2024, 01:09:19] [Ring] Error: Cannot get schema for 'SubjectPublicKeyInfo' target
    at AsnSchemaStorage.get (/var/lib/homebridge/node_modules/.pnpm/@peculiar+asn1-schema@2.3.6/node_modules/@peculiar/asn1-schema/build/cjs/schema.js:17:19)
    at Function.fromASN (/var/lib/homebridge/node_modules/.pnpm/@peculiar+asn1-schema@2.3.6/node_modules/@peculiar/asn1-schema/build/cjs/parser.js:26:52)
    at Function.parse (/var/lib/homebridge/node_modules/.pnpm/@peculiar+asn1-schema@2.3.6/node_modules/@peculiar/asn1-schema/build/cjs/parser.js:16:26)
    at Function.parse (/var/lib/homebridge/node_modules/.pnpm/@peculiar+asn1-schema@2.3.6/node_modules/@peculiar/asn1-schema/build/cjs/convert.js:13:35)
    at Function.create (/var/lib/homebridge/node_modules/.pnpm/@peculiar+x509@1.9.5/node_modules/@peculiar/x509/build/x509.cjs.js:2396:61)
    at processTicksAndRejections (node:internal/process/task_queues:95:5)
    at Function.value [as createSelfSignedCertificateWithKey] (/var/lib/homebridge/node_modules/.pnpm/werift@0.18.17/node_modules/dtls/src/context/cipher.ts:108:18)
    at RTCDtlsTransport.setupCertificate (/var/lib/homebridge/node_modules/.pnpm/werift@0.18.17/node_modules/werift/src/transport/dtls.ts:77:9)
    at ensureCert (/var/lib/homebridge/node_modules/.pnpm/werift@0.18.17/node_modules/werift/src/peerConnection.ts:1307:34)
    at RTCPeerConnection.ensureCerts (/var/lib/homebridge/node_modules/.pnpm/werift@0.18.17/node_modules/werift/src/peerConnection.ts:1315:7)
[02/01/2024, 01:09:19] [Ring] connectionStateChange: closed
[02/01/2024, 01:09:19] [Ring] iceConnectionStateChange: closed
[02/01/2024, 01:09:19] [Ring] Call ended before answered
[02/01/2024, 01:09:22] [Ring] Used cached snapshot for Front Door
[02/01/2024, 01:09:22] [Ring] Loading new snapshot into cache for Front Door
[02/01/2024, 01:09:22] [Ring] Snapshot cached for Front Door (0.351s)
[02/01/2024, 01:09:28] [Ring] Stopped Live Stream for Front Door

Screenshots

No response

Homebridge Ring Config

Nothing I changed in here. went from working to not working without any other changes so it's not config related I don't think.

Additional context

Like I mentioned above. this went from working 100% to suddenly not after upgrading HomeKit architecture. Of note is that when upgrading architecture I some family members that were added to the hope had to get dropped until they updated their devices and stuff and they did complete that and were re-added to my HomeKit home.

Other issues seem kind of related but their error output was different and their solutions don't work for this one.

OS

idk. whatever the raspberrypi imager installs when selecting "homebridge" for the image type

Node.js Version

v18.18.0

NPM Version

ppm 7.1.7

Homebridge/HOOBs Version

v1.7.0

Homebridge Ring Plugin Version

v12.1.0

Operating System

idk. whatever the raspberrypi imager installs when selecting "homebridge" for the image type

aalencia commented 8 months ago

I can confirm mine has also stopped working in the same fashion.

aalencia commented 8 months ago

If you refresh your long token you will get a login error as well. the error itself is malformed.

tsightler commented 8 months ago

The error above doesn't appear to have anything to do with HomeKit architecture and instead looks like an issue with a dependent package. It would not have anything to do with tokens since the plugin is already authenticated.

ne0nex commented 8 months ago

Be that as it may, I don't have anything on this raspberry pi bridge set to auto-update, nor did I update any packages manually or anything. Plugin, Homebridge, UI, npm, and core OS were all one version with this working fine. Updated home architecture and the issue started. Could be coincidental, but regardless, here we are.

tsightler commented 8 months ago

All I can go by is the logs, and the logs seem quite clear and have absolutely nothing to do with the Homekit side of things, the error is from werift which handles the backend WebRTC connection to Ring. This connection is not related to the Homekit architecture and there are known issues that can cause that error when there are mismatched versions of @peculiar/asn1-schema.

Not only that, but the new Homekit architecture is not that new, it's been around for almost a while now and a significant percentage of users have been on it for some time, including myself. While I appreciate that's when you were impacted, I don't see any way it can be related to the failure above, nor can I reproduce any similar issue. I guess the next best suggestion is to remove and reinstall the plugin, but that's just a total shot in the dark.

tsightler commented 7 months ago

Unfortunately this can't be reproduced and seems unrelated to the issue reported, so closing this for now.