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

Source: Nest - "400 Bad Request" #1097

Open
Lockie85 opened this issue May 8, 2024 · 6 comments
Open

Source: Nest - "400 Bad Request" #1097

Lockie85 opened this issue May 8, 2024 · 6 comments
Labels
bug Something isn't working

Comments

@Lockie85
Copy link

Lockie85 commented May 8, 2024

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".
image

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.

@Lockie85
Copy link
Author

Lockie85 commented May 8, 2024

Also worth noting that when I try entering details the camera via the "Add" > "Goggle Nest" UI, I get "no sources".

@miguelangel-nubla
Copy link
Contributor

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.

@Lockie85
Copy link
Author

Lockie85 commented May 11, 2024

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

@miguelangel-nubla
Copy link
Contributor

miguelangel-nubla commented May 12, 2024

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.

@AlexxIT AlexxIT added the bug Something isn't working label May 12, 2024
@AlexxIT
Copy link
Owner

AlexxIT commented May 12, 2024

I don't have Nest cameras, so can't help with that

@jasjeetsuri
Copy link

jasjeetsuri commented May 31, 2024

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants