go2rtc
go2rtc copied to clipboard
Source: Nest - "400 Bad Request"
Hey,
I'm trying to get my nest camera working on Version: 1.9.1 via the following method:
streams:
nest-doorbell: nest:?client_id=***&client_secret=***&refresh_token=***&project_id=***&device_id=***
However, I'm getting "400 Bad Request".
I've checked my: client_id client_secret refresh_token project_id device_id
All are correct and I've confirmed this via commands like:
curl -X GET \
'https://smartdevicemanagement.googleapis.com/v1/enterprises/YOUR_PROJECT_ID/devices/YOUR_DEVICE_ID' \
-H 'Authorization: Bearer YOUR_ACCESS_TOKEN' \
-H 'Content-Type: application/json'
Which provided a successful response. I'll keep checking as maybe I've made and missed a tiny mistake somewhere, but assuming I've not, any ideas what might be going on? Many Thanks.
Also worth noting that when I try entering details the camera via the "Add" > "Goggle Nest" UI, I get "no sources".
go2rtc v1.9.0 had a bug where consumer connections where not closed. It drained my nest doorbell battery. Have you checked it works on the Google Home app? v1.9.1 solved it for me.
go2rtc v1.9.0 had a bug where consumer connections where not closed. It drained my nest doorbell battery. Have you checked it works on the Google Home app? v1.9.1 solved it for me.
On version 1.9.1, I still get "400 Bad Request". Is there a good method of debugging this problem?
I've set the log level to debug and here is what I'm seeing:
5/11/2024, 10:08:58 AM | debug | [webrtc] new consumer src=nest-doorbell 5/11/2024, 10:09:00 AM | debug | [mp4] add consumer error=streams: nest: wrong status: 400 Bad Request 5/11/2024, 10:09:01 AM | debug | [webrtc] add consumer error=streams: nest: wrong status: 400 Bad Request 5/11/2024, 10:09:01 AM | warn | [streams] json locked 5/11/2024, 10:09:02 AM | debug | [mjpeg] add consumer error=streams: nest: wrong status: 400 Bad Request
Sorry for repeating myself but are you sure it works on the home app?
Is there a good method of debugging this problem?
I would try to make it work using Home Assistant first with the nest integration, then copy the exact credentials from ha (/config/.storage/core.config_entries if I remember correctly. Just search for the nest client id in the .storage folder and the relevant json will show up) including the exact same refresh token.
I don't have Nest cameras, so can't help with that
Ive got the same issue (nest doorbell wired), and I've triple checked my params:
- client_id
- client_secret
- refresh_token
- project_id
- device_id
Ive also made the API request to fetch the device with the access token and deviceId as per the original post here, and I get a good response back. Im using go2rtc 1.9.2 and Frigate (0.13.2-6476f8a)
"sdm.devices.traits.CameraLiveStream": {
"maxVideoResolution": {
"width": 640,
"height": 480
},
"videoCodecs": [
"H264"
],
"audioCodecs": [
"AAC"
],
"supportedProtocols": [
"RTSP"
]
},
But get this in Frigate go2rtc log
2024-05-31 13:41:35.827383741 13:41:35.827 WRN [rtsp] error="streams: nest: wrong status: 400 Bad Request" stream=Doorbell-camera
2024-05-31 13:41:45.873670924 13:41:45.873 WRN [rtsp] error="streams: nest: wrong status: 400 Bad Request" stream=Doorbell-camera
2024-05-31 13:41:55.833223943 13:41:55.832 WRN [rtsp] error="streams: nest: wrong status: 400 Bad Request" stream=Doorbell-camera
2024-05-31 13:42:05.912001824 13:42:05.911 WRN [rtsp] error="streams: nest: wrong status: 400 Bad Request" stream=Doorbell-camera
2024-05-31 13:42:16.042513558 13:42:16.042 WRN [rtsp] error="streams: nest: wrong status: 400 Bad Request" stream=Doorbell-camera
2024-05-31 13:42:26.163931089 13:42:26.163 WRN [rtsp] error="streams: nest: wrong status: 429 Too Many Requests" stream=Doorbell-camera
Eventually it gets throttled, HTTP 429.
I manage to get this working with HA Google Nest addon though.
I think maybe this is because Nest doorbell wired (legacy) only supports RTSP stream, and go2rtc only support Nest with webRTC stream?
Just to note, I just hit a "400 Bad Request" myself again with a Nest Doorbell (battery), this time was because I clicked the small "turn off video" button on the official Home app. Working fine as soon as I enabled it again.
I think maybe this is because Nest doorbell wired (legacy) only supports RTSP stream, and go2rtc only support Nest with webRTC stream?
Only Nest cameras with WebRTC are currently supported https://github.com/AlexxIT/go2rtc/blob/03956968667bba2febb6a513d159dc9a00b3e4c8/pkg/nest/client.go#L50 and was only initially tested with the doorbell battery version.
Just to note, I just hit a "400 Bad Request" myself again with a Nest Doorbell (battery), this time was because I clicked the small "turn off video" button on the official Home app. Working fine as soon as I enabled it again.
I think maybe this is because Nest doorbell wired (legacy) only supports RTSP stream, and go2rtc only support Nest with webRTC stream?
Only Nest cameras with WebRTC are currently supported
https://github.com/AlexxIT/go2rtc/blob/03956968667bba2febb6a513d159dc9a00b3e4c8/pkg/nest/client.go#L50 and was only initially tested with the doorbell battery version.
+1 exactly what happens in my environment also. I noticed that if the camera is down in the Google Home web app, Frigate won't be able to get the stream. Makes sense. I just wish it wasn't a 400 error :)