jeffreydwalter / arlo

Python module for interacting with Netgear's Arlo camera system.
Apache License 2.0
517 stars 123 forks source link

localhost:7788 not found error after "Arlo wants access to your Google Account" screen #180

Closed kskenyon closed 2 years ago

kskenyon commented 2 years ago

Please answer these questions before submitting your issue. Thanks!

What version of Python are you using (python -V)?

Python 3.9.9

What operating system and processor architecture are you using (python -c 'import platform; print(platform.uname());')?

uname_result(system='Darwin', node='MacBook-Pro.local', release='21.2.0', version='Darwin Kernel Version 21.2.0: Sun Nov 28 20:28:41 PST 2021; root:xnu-8019.61.5~1/RELEASE_ARM64_T6000', machine='arm64')

Which Python packages do you have installed (run the pip freeze or pip3 freeze command and paste output)?

arlo==1.2.57
bitstring==3.1.9
cachetools==4.2.4
certifi==2021.10.8
cffi==1.15.0
charset-normalizer==2.0.9
cryptography==36.0.0
ecdsa==0.17.0
esptool==3.2
google-api-core==2.3.2
google-api-python-client==2.33.0
google-auth==2.3.3
google-auth-httplib2==0.1.0
google-auth-oauthlib==0.4.6
googleapis-common-protos==1.54.0
httplib2==0.20.2
idna==3.3
monotonic==1.6
numpy==1.21.4
oauthlib==3.1.1
pickle-mixin==1.0.2
Pillow==8.4.0
protobuf==4.0.0rc2
pyasn1==0.4.8
pyasn1-modules==0.2.8
pycparser==2.21
pyparsing==3.0.6
PyQt6==6.2.0
PyQt6-3D==6.2.0
PyQt6-Charts==6.2.0
PyQt6-DataVisualization==6.2.0
PyQt6-NetworkAuth==6.2.0
PyQt6-sip==13.1.0
PyQt6-WebEngine==6.2.0
pyserial==3.5
PySocks==1.7.1
reedsolo==1.5.4
requests==2.26.0
requests-oauthlib==1.3.0
rsa==4.8
six==1.16.0
sseclient==0.0.22
uritemplate==4.1.1
urllib3==1.24

Which version of ffmpeg are you using (ffmpeg -version)?

ffmpeg version 3.1.3 Copyright (c) 2000-2016 the FFmpeg developers
built with llvm-gcc 4.2.1 (LLVM build 2336.11.00)
configuration: --prefix=/Volumes/Ramdisk/sw --enable-gpl --enable-pthreads --enable-version3 --enable-libspeex --enable-libvpx --disable-decoder=libvpx --enable-libmp3lame --enable-libtheora --enable-libvorbis --enable-libx264 --enable-avfilter --enable-libopencore_amrwb --enable-libopencore_amrnb --enable-filters --enable-libgsm --enable-libvidstab --enable-libx265 --disable-doc --arch=x86_64 --enable-runtime-cpudetect
libavutil      55. 28.100 / 55. 28.100
libavcodec     57. 48.101 / 57. 48.101
libavformat    57. 41.100 / 57. 41.100
libavdevice    57.  0.101 / 57.  0.101
libavfilter     6. 47.100 /  6. 47.100
libswscale      4.  1.100 /  4.  1.100
libswresample   2.  1.100 /  2.  1.100
libpostproc    54.  0.100 / 54.  0.100

Which Arlo hardware do you have (camera types - [Arlo, Pro, Q, etc.], basestation model, etc.)?

Pro2 w/basestation, Ultra w/basestation, Wireless Doorbell (no basestation)

What did you do?

Followed docs. Get to screen where Google asks for permission then it dies with a localhost:7788 not found error

What did you expect to see?

generate credentials file

What did you see instead?

dies

Does this issue reproduce with the latest release?

Yes, all up to date.

Screen Shot 2021-12-19 at 9 53 03 PM Screen Shot 2021-12-19 at 10 02 18 PM

Looks like a problem with serving localhost:7788 from my Mac. localhost alone does respond.

Traceback (most recent call last): File "/Users/private/arlo/gmail_oauth.py", line 20, in credentials = flow.run_local_server(host='localhost', File "/opt/homebrew/lib/python3.9/site-packages/google_auth_oauthlib-0.4.6-py3.9.egg/google_auth_oauthlib/flow.py", line 476, in run_local_server authorization_response = wsgi_app.last_request_uri.replace("http", "https") AttributeError: 'NoneType' object has no attribute 'replace'

So close yet so far...

Kevin

kskenyon commented 2 years ago

I got the authentication to complete on raspbian Buster, however, the gmail.credentials file that it created appears to be corrupt. I get a 401 error running any of the example code. I repeated it to be sure. Can you verify that this code is still working?

python3 arlo-snapshot.py 401 Client Error: for url: https://my.arlo.com/hmsweb/users/devices

{ "success": false, "data": { "error": "2401", "message": "Access token is empty or unauthorized request", "reason": "Empty token" } }

chromium-browser https://my.arlo.com/hmsweb/users/devices Opening in existing browser session. python3 arlo-snapshot.py 401 Client Error: for url: https://my.arlo.com/hmsweb/users/devices

rsullivan00 commented 2 years ago

This happened to me too w/ Python 3.9 in Ubuntu 20.04.

Looks like _RedirectWSGIApp.__call__ isn't being called for some reason, so the URL isn't stored.

I was able to work around by adding a import pdb; pdb.set_trace() debugger on the line before authorization_response = wsgi_app.last_request_uri.replace("http", "https") of flow.py, then manually assigning the URI from my browser with

wsgi_app.last_request_uri = 'http://localhost:7788/?state=0X...'
continue
kskenyon commented 2 years ago

Got my state OK. Not sure where I'm supposed to insert the manual wsgi_app.last_request_uri = 'http://localhost:7788/?state=0X...' continue

Does it replace the lines after the pbd call?

rsullivan00 commented 2 years ago

Type those lines into the debugger when you hit the pdb.set_trace() call

kskenyon commented 2 years ago

Guess I'm out of my league. How do I get into the debugger? I can only tweak python3, I don't write code. Are you using an IDE?

I manually edited flow.py with nano in the terminal then ran gmail_oauth.py which outputted the state=

But it doesn't seem to allow me to enter the wsgi_app.last_request_uri = 'http://localhost:7788/?state=0x... line there.

Does your 0x indicate the state is supposed to be in hex? Mine isn't in hex.

Pardon my ignorance?

K

kskenyon commented 2 years ago

Traceback (most recent call last): File "./gmail_oauth.py", line 24, in open_browser=True) File "/usr/local/lib/python3.7/dist-packages/google_auth_oauthlib-0.4.6-py3.7.egg/google_auth_oauthlib/flow.py", line 479, in run_local_server authorization_response = wsgi_app.last_request_uri.replace("http", "https") File "/usr/local/lib/python3.7/dist-packages/google_auth_oauthlib-0.4.6-py3.7.egg/google_auth_oauthlib/flow.py", line 286, in fetch_token return self.oauth2session.fetch_token(self.client_config["token_uri"], **kwargs) File "/usr/lib/python3/dist-packages/requests_oauthlib/oauth2_session.py", line 187, in fetch_token state=self._state) File "/usr/lib/python3/dist-packages/oauthlib/oauth2/rfc6749/clients/web_application.py", line 174, in parse_request_uri_response response = parse_authorization_code_response(uri, state=state) File "/usr/lib/python3/dist-packages/oauthlib/oauth2/rfc6749/parameters.py", line 227, in parse_authorization_code_response raise MissingCodeError("Missing code parameter in response.") oauthlib.oauth2.rfc6749.errors.MissingCodeError: (missing_code) Missing code parameter in response.

The browser session closes too soon?

rsullivan00 commented 2 years ago

Make sure you're adding the debugger (import pdb; pdb.set_trace()) to the flow.py at /usr/local/lib/python3.7/dist-packages/google_auth_oauthlib-0.4.6-py3.7.egg/google_auth_oauthlib/flow.py, since that's the one being executed.

When you run python3 gmail_oauth.py, it should pause when the program execution hits the pdb.set_trace() line, and open an interactive prompt. That's when you would put in wsgi_app.last_request_uri = 'your-url'. Don't worry about the state or other query params--the URL you paste in should be the full contents of your browser at that point--the window that is open to http://localhost:7788/...--wrapped in quotes.

Entering continue into the interactive prompt will exit the debugger and let the program complete.

kskenyon commented 2 years ago

I did everything as described but none of the example code will complete. I must be missing something somewhere.

python3 arlo-download-bycamera.py 401 Client Error: for url: https://my.arlo.com/hmsweb/users/devices

{"success":false,"data":{"error":"2401","message":"Access token is empty or unauthorized request","reason":"Empty token"}}

kskenyon commented 2 years ago

Getting this error now: The states do not match as shown in the browser URL window.

EDIT: I had to close the open browser window and let it open a new browser session. However, still getting the 401 Client error above when running any example code. Ooops, forgot to add the path to credentials to the code. OK now. But...

(Pdb) wsgi_app.last_request_uri= 'http://localhost:7788/?state=FCPXprkaH0YtNYqqjxic0etBSkURTV&code=4%2F0AX4XfWiOsm90p6QmG0YMtQfXxaXU9l__2QSciHW_ka2XfOF6z29f6q4N62E8zyJYC7gjnw&scope=https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fgmail.readonly/' (Pdb) continue Traceback (most recent call last): File "gmail_oauth.py", line 24, in open_browser=True) File "/usr/local/lib/python3.7/dist-packages/google_auth_oauthlib-0.4.6-py3.7.egg/google_auth_oauthlib/flow.py", line 478, in run_local_server authorization_response = wsgi_app.last_request_uri.replace("http", "https") File "/usr/local/lib/python3.7/dist-packages/google_auth_oauthlib-0.4.6-py3.7.egg/google_auth_oauthlib/flow.py", line 286, in fetch_token return self.oauth2session.fetch_token(self.client_config["token_uri"], **kwargs) File "/usr/lib/python3/dist-packages/requests_oauthlib/oauth2_session.py", line 187, in fetch_token state=self._state) File "/usr/lib/python3/dist-packages/oauthlib/oauth2/rfc6749/clients/web_application.py", line 174, in parse_request_uri_response response = parse_authorization_code_response(uri, state=state) File "/usr/lib/python3/dist-packages/oauthlib/oauth2/rfc6749/parameters.py", line 230, in parse_authorization_code_response raise MismatchingStateError() oauthlib.oauth2.rfc6749.errors.MismatchingStateError: (mismatching_state) CSRF Warning! State not equal in request and response.

kskenyon commented 2 years ago

OK, I finally got all the way through and the example code returns nothing.

Does this require a paid Arlo cloud account to do anything? Just asking.

Belkin just announced new Thread and Matter compliant devices. Looks like Arlo may be doomed. A lot of $ went to Arlo already. Good hardware. Awful management.

cgmckeever commented 2 years ago

The example code does not reflect the MFA work ... change it to use

def LoginMFA(self, username, password, google_credential_file)
cgmckeever commented 2 years ago

actually scrap that .... this is what I meant

class Arlo (username, password, google_credential_file)

https://github.com/jeffreydwalter/arlo/tree/master/docs#classes

cgmckeever commented 2 years ago

This works https://github.com/jeffreydwalter/arlo/blob/master/examples/arlo-setmode.py

change

arlo = Arlo(USERNAME, PASSWORD)

to

arlo = Arlo(USERNAME, PASSWORD, path-to-gmail-creds)
kskenyon commented 2 years ago

Guess I got myself too far into a work in progress. It’s something I can really use.

python3 arlo-streamingvideo.py

File "arlo-streamingvideo.py", line 15 def LoginMFA(self, username, password, google_credential_file) ^ SyntaxError: invalid syntax

On Jan 4, 2022, at 10:35 PM, cgmckeever @.***> wrote:

def LoginMFA(self, username, password, google_credential_file)

Old engineer who was a whiz at BASIC and FORTRAN.

cgmckeever commented 2 years ago

It works, just needs a hand here or there.

Can you get the mode working that I linked earlier? Start small before you jump right into streaming .. just to make sure you have the plumbing in order.

kskenyon commented 2 years ago

Still returns nothing. Still wondering if I need a paid Arlo account.

cgmckeever commented 2 years ago

you def do not

cgmckeever commented 2 years ago

Can you add

print(basestations)

right after

basestations = arlo.GetDevices('basestation')
kskenyon commented 2 years ago

nothing, no errors or anything to go on.

On Jan 4, 2022, at 11:35 PM, cgmckeever @.***> wrote:

Can you add

print(basestations) right after

basestations = arlo.GetDevices('basestation') — Reply to this email directly, view it on GitHub https://github.com/jeffreydwalter/arlo/issues/180#issuecomment-1005375852, or unsubscribe https://github.com/notifications/unsubscribe-auth/AF4WTTBOJD5ASVBVV3M66UDUUPDAPANCNFSM5KMVIZ4A. You are receiving this because you authored the thread.

cgmckeever commented 2 years ago

even with that print added?

cgmckeever commented 2 years ago

are you getting an email with your MFA code? If you arent getting an email, then thats no good

kskenyon commented 2 years ago

Nope, only if I login manually and request it.

On Jan 4, 2022, at 11:39 PM, cgmckeever @.***> wrote:

are you getting an email with your MFA code? If you arent getting an email, then thats no good

— Reply to this email directly, view it on GitHub https://github.com/jeffreydwalter/arlo/issues/180#issuecomment-1005377341, or unsubscribe https://github.com/notifications/unsubscribe-auth/AF4WTTA7XZKNQHYFRMA7NILUUPDQRANCNFSM5KMVIZ4A. You are receiving this because you authored the thread.

cgmckeever commented 2 years ago

if you arent getting a MFA email when you run any of those scripts, there is something broken .. You've copied the gmail-creds file and added it to the main arlo call? Can you post your code snippet?

kskenyon commented 2 years ago

I can try going though the Google API process again. Tomorrow.

Thanks for the help.

K

On Jan 4, 2022, at 11:39 PM, cgmckeever @.***> wrote:

are you getting an email with your MFA code? If you arent getting an email, then thats no good

— Reply to this email directly, view it on GitHub https://github.com/jeffreydwalter/arlo/issues/180#issuecomment-1005377341, or unsubscribe https://github.com/notifications/unsubscribe-auth/AF4WTTA7XZKNQHYFRMA7NILUUPDQRANCNFSM5KMVIZ4A. You are receiving this because you authored the thread.

kskenyon commented 2 years ago

Did all that.

On Jan 4, 2022, at 11:42 PM, cgmckeever @.***> wrote:

if you arent getting a MFA email when you run any of those scripts, there is something broken .. You've copied the gmail-creds file and added it to the main arlo call? Can you post your code snippet?

— Reply to this email directly, view it on GitHub https://github.com/jeffreydwalter/arlo/issues/180#issuecomment-1005378346, or unsubscribe https://github.com/notifications/unsubscribe-auth/AF4WTTEVQMPNB6RZZL4GSBTUUPD4DANCNFSM5KMVIZ4A. You are receiving this because you authored the thread.

kskenyon commented 2 years ago

from arlo import Arlo

username = @.***' password = ‘REDACTED' google_credential_file = '/home/pi/arlo/gmail.credentials'

try:

Instantiating the Arlo object automatically calls Login(), which returns an oAuth token that gets cached.

    # Subsequent successful calls to login will update the oAuth token.
    #       arlo = Arlo(USERNAME, PASSWORD)
    arlo = Arlo(username, password, google_credential_file)

    # At this point you're logged into Arlo.

    # Get the list of devices and filter on device type to only get the basestation.
    # This will return an array which includes all of the basestation's associated metadata.
    basestations = arlo.GetDevices('basestation')
    print(basestations[0])

    # Arm Arlo.
    arlo.Arm(basestations[0])
    # Or
    # Disarm Arlo.
    # arlo.Disarm(basestations[0])
    # Or
    # Change Mode to some custom mode you created.
    # arlo.CustomMode(basestations[0], "mode3") # 'mode3' is the id of a custom mode you created.
    # Or
    # Change Mode to Schedule.
    # arlo.CustomMode(basestations[0], mode=None, schedules=['schedules.1']) # 'schedules.1' is the id of my default schedule."

except Exception as e: print(e) arlo-setmode.py (END)

tried first with print(basestations) No difference.

On Jan 4, 2022, at 11:43 PM, Kevin Kenyon @.***> wrote:

Did all that.

On Jan 4, 2022, at 11:42 PM, cgmckeever @. @.>> wrote:

if you arent getting a MFA email when you run any of those scripts, there is something broken .. You've copied the gmail-creds file and added it to the main arlo call? Can you post your code snippet?

— Reply to this email directly, view it on GitHub https://github.com/jeffreydwalter/arlo/issues/180#issuecomment-1005378346, or unsubscribe https://github.com/notifications/unsubscribe-auth/AF4WTTEVQMPNB6RZZL4GSBTUUPD4DANCNFSM5KMVIZ4A. You are receiving this because you authored the thread.

cgmckeever commented 2 years ago

ahh h.... this bit me .. take the try/except lines out ... there was this weird primary MFA error that I didnt catch till I removed the error handling

kskenyon commented 2 years ago

python3 arlo-setmode.py Traceback (most recent call last): File "arlo-setmode.py", line 10, in arlo = Arlo(username, password, google_credential_file) File "/home/pi/arlo/arlo.py", line 69, in init self.LoginMFA(username, password, google_credential_file) File "/home/pi/arlo/arlo.py", line 218, in LoginMFA email_factor_id = next(i for i in factors_body['data']['items'] if i['factorType'] == 'EMAIL' and i['factorRole'] == "PRIMARY")['factorId'] StopIteration

Still no gmail.

On Jan 4, 2022, at 11:50 PM, cgmckeever @.***> wrote:

ahh h.... this bit me .. take the try/except lines out ... there was this weird primary MFA error that I didnt catch till I removed the error handling

— Reply to this email directly, view it on GitHub https://github.com/jeffreydwalter/arlo/issues/180#issuecomment-1005380678, or unsubscribe https://github.com/notifications/unsubscribe-auth/AF4WTTGP5SAZVFQKSIQJZBTUUPE2VANCNFSM5KMVIZ4A. You are receiving this because you authored the thread.

cgmckeever commented 2 years ago

YES I know this issue!

cgmckeever commented 2 years ago

Under Account -> Two Factor Auth Make sure your email you synced in the auth process is the one checked

Screen Shot 2022-01-04 at 10 56 43 PM
cgmckeever commented 2 years ago

@jeffreydwalter I think this is a semi-bug introduced with this issue/merge .. Why the try/catch doesnt actually catch it is unknown to me. Note the above where error was finally seem remove the try/catch

kskenyon commented 2 years ago

I only have one email account listed in Arlo so that’s not an issue.

On Jan 4, 2022, at 11:57 PM, cgmckeever @.***> wrote:

Under Account -> Two Factor Auth Make sure your email you synced in the auth process is the one checked

https://user-images.githubusercontent.com/513738/148162741-349f70be-3b7d-4f08-99b4-757c3649f4c7.png — Reply to this email directly, view it on GitHub https://github.com/jeffreydwalter/arlo/issues/180#issuecomment-1005382785, or unsubscribe https://github.com/notifications/unsubscribe-auth/AF4WTTCCKSYKVSAIS3JKENLUUPFURANCNFSM5KMVIZ4A. You are receiving this because you authored the thread.

cgmckeever commented 2 years ago

does it have a check mark?

kskenyon commented 2 years ago

Not sure if it did when I did the initial authorization. Usually use SMS to my iphone.

On Jan 5, 2022, at 12:03 AM, cgmckeever @.***> wrote:

does it have a check mark?

— Reply to this email directly, view it on GitHub https://github.com/jeffreydwalter/arlo/issues/180#issuecomment-1005384832, or unsubscribe https://github.com/notifications/unsubscribe-auth/AF4WTTF3SKLDDFCPJQJB3SDUUPGLDANCNFSM5KMVIZ4A. You are receiving this because you authored the thread.

cgmckeever commented 2 years ago

did you check? Log in via the web UI

kskenyon commented 2 years ago

It does now.

python3 arlo-setmode.py Traceback (most recent call last): File "arlo-setmode.py", line 10, in arlo = Arlo(username, password, google_credential_file) File "/home/pi/arlo/arlo.py", line 69, in init self.LoginMFA(username, password, google_credential_file) File "/home/pi/arlo/arlo.py", line 238, in LoginMFA @. after:{request_start_time}' File "/usr/local/lib/python3.7/dist-packages/google_api_python_client-2.32.0-py3.7.egg/googleapiclient/_helpers.py", line 131, in positional_wrapper return wrapped(args, kwargs) File "/usr/local/lib/python3.7/dist-packages/google_api_python_client-2.32.0-py3.7.egg/googleapiclient/http.py", line 931, in execute headers=self.headers, File "/usr/local/lib/python3.7/dist-packages/google_api_python_client-2.32.0-py3.7.egg/googleapiclient/http.py", line 190, in _retry_request resp, content = http.request(uri, method, *args, **kwargs) File "/usr/local/lib/python3.7/dist-packages/google_auth_httplib2-0.1.0-py3.7.egg/google_auth_httplib2.py", line 209, in request self.credentials.before_request(self._request, method, uri, request_headers) File "/usr/local/lib/python3.7/dist-packages/google_auth-2.3.3-py3.7.egg/google/auth/credentials.py", line 133, in before_request self.refresh(request) File "/usr/local/lib/python3.7/dist-packages/google_auth-2.3.3-py3.7.egg/google/oauth2/credentials.py", line 291, in refresh "The credentials do not contain the necessary fields need to " google.auth.exceptions.RefreshError: The credentials do not contain the necessary fields need to refresh the access token. You must specify refresh_token, token_uri, client_id, and client_secret.

On Jan 5, 2022, at 12:13 AM, cgmckeever @.***> wrote:

did you check? Log in via the web UI

— Reply to this email directly, view it on GitHub https://github.com/jeffreydwalter/arlo/issues/180#issuecomment-1005388522, or unsubscribe https://github.com/notifications/unsubscribe-auth/AF4WTTAZJA7EDHEMFEGFGTLUUPHQVANCNFSM5KMVIZ4A. You are receiving this because you authored the thread.

cgmckeever commented 2 years ago

did you get the MFA email?

kskenyon commented 2 years ago

Yes! Progress!

On Jan 5, 2022, at 12:18 AM, cgmckeever @.***> wrote:

did you get the MFA email?

— Reply to this email directly, view it on GitHub https://github.com/jeffreydwalter/arlo/issues/180#issuecomment-1005390449, or unsubscribe https://github.com/notifications/unsubscribe-auth/AF4WTTFHOXDKVFMQCLTJMADUUPIDHANCNFSM5KMVIZ4A. You are receiving this because you authored the thread.

cgmckeever commented 2 years ago

Nice .. OK .. now Im lost, the only thing I can think of is that you are using the file from step 6 and not from step 7 https://github.com/jeffreydwalter/arlo/wiki/Configuring-MFA-via-Gmail

cgmckeever commented 2 years ago

or you have authorized the wrong email to allow the read-only access (to slurp out the MFA code)

kskenyon commented 2 years ago

Nope. I’m sure it’s pointing to the gmail.credentials file that was created by gmail_oauth.py

On Jan 5, 2022, at 12:20 AM, cgmckeever @.***> wrote:

Nice .. OK .. now Im lost, the only thing I can think of is that you are using the file from step 6 and not from step 7 https://github.com/jeffreydwalter/arlo/wiki/Configuring-MFA-via-Gmail https://github.com/jeffreydwalter/arlo/wiki/Configuring-MFA-via-Gmail — Reply to this email directly, view it on GitHub https://github.com/jeffreydwalter/arlo/issues/180#issuecomment-1005391201, or unsubscribe https://github.com/notifications/unsubscribe-auth/AF4WTTDTID5OGCIJLHOVAHTUUPIK3ANCNFSM5KMVIZ4A. You are receiving this because you authored the thread.

kskenyon commented 2 years ago

Nope, I know I selected @. @.> when I logged in during gmail_oauth.py

On Jan 5, 2022, at 12:21 AM, cgmckeever @.***> wrote:

or you have authorized the wrong email to allow the read-only access (to slurp out the MFA code)

— Reply to this email directly, view it on GitHub https://github.com/jeffreydwalter/arlo/issues/180#issuecomment-1005391474, or unsubscribe https://github.com/notifications/unsubscribe-auth/AF4WTTHKPB4D373KBBGA4TDUUPINTANCNFSM5KMVIZ4A. You are receiving this because you authored the thread.

cgmckeever commented 2 years ago

yeah, but lost here now. It looks like its a auth mismatch so wrong email or something... googling that error leads to some rabbit holes that probably can help .. but hard on my side to diagnose

The credentials do not contain the necessary fields need to refresh the access token
kskenyon commented 2 years ago

I’ll start over tomorrow.

On Jan 5, 2022, at 12:26 AM, cgmckeever @.***> wrote:

yeah, but lost here now. It looks like its a auth mismatch so wrong email or something... googling that error leads to some rabbit holes that probably can help .. but hard on my side to diagnose

The credentials do not contain the necessary fields need to refresh the access token — Reply to this email directly, view it on GitHub https://github.com/jeffreydwalter/arlo/issues/180#issuecomment-1005393372, or unsubscribe https://github.com/notifications/unsubscribe-auth/AF4WTTFEYK4Q32TVT4JTSU3UUPI7LANCNFSM5KMVIZ4A. You are receiving this because you authored the thread.

kskenyon commented 2 years ago

less gmail.credentials

<80>^Ccgoogle.oauth2.credentials Credentials q^@)<81>q^A}q^B(X^E^@^@***@***.***^CX^@^@***@***.***_5campUgREMdOrTdyy8BTk9_qo1u1CRif4Nei7P_UBmDLKU0Hijq3l7T-SOUIzEZ6EgrUhRpXBbfzNO1k_Z9E58oX7Vqc81ZY78fsW9xuyUu7loEqlZwmD6rq3oEq^DX^F^@^@***@***.***^Ecdatetime datetime q^FC ^G^A^E^C^Y^N^N<87>cq^G<85>Rq X^Q^@^@^@_quota_project_idq NX^G^@^@^@_scopesq^K]q^LX.^@^@***@***.***://www.googleapis.com/auth/gmail.readonlyq^MaX^O^@^@^@_default_scopesq^NNX^N^@^@^@_refresh_tokenq^ONX ^@^@^@_id_tokenq^PNX ^@^@^@_token_uriq^QX#^@^@***@***.***://oauth2.googleapis.com/tokenq^RX ^@^@^@_client_idq^SXH^@^@***@***.***^TX^N^@^@^@_client_secretq^UX#^@^@***@***.***^VX^K^@^@^@_rapt_tokenq^WNX^V^@^@^@_enable_reauth_refreshq^X<89>ub. gmail.credentials (END) Going back to the beginning, this looks weird with lots of unprintable characters.. Corrupted? > On Jan 5, 2022, at 12:26 AM, cgmckeever ***@***.***> wrote: > > > yeah, but lost here now. It looks like its a auth mismatch so wrong email or something... googling that error leads to some rabbit holes that probably can help .. but hard on my side to diagnose > > The credentials do not contain the necessary fields need to refresh the access token > — > Reply to this email directly, view it on GitHub , or unsubscribe . > You are receiving this because you authored the thread. >
cgmckeever commented 2 years ago

Thats what mine looks like .. more or less

kskenyon commented 2 years ago

Success!!!

I probably screwed up copying the URL from the browser window. Works now. Thanks for the copious help you provided.

In this code, what number should I put in for the array item? I have a printout of my cameras and basestations array. Is this just the element order in each of the arrays. Right now it doesn't return anything. I have three cameras with basestations and a wireless doorbell (no basestation) on that account. The doorbell doesn't show up in the arrays generated.

url = arlo.StartStream(basestations[0], cameras[0])

cgmckeever commented 2 years ago

I havent actually done anything with individual cameras. I would use the def GetCameraState(self, basestation) or def GetDevice(self, device_name) or one of the other calls to naroow in one what is what .. but you got passed the hard part!

`

cgmckeever commented 2 years ago

yes, camera INDEX is just the order in that array

cgmckeever commented 2 years ago

@rsullivan00 since you seem to enjoy wrestling with the gmail-auth ;) ... Have you hit a wall with a 7-day token expirey? I have automated job that turns on my cameras, but it started to fail, from what seems to be this

https://stackoverflow.com/questions/66058279/token-has-been-expired-or-revoked-google-oauth2-refresh-token-gets-expired-i/67966982#67966982

https://github.com/jeffreydwalter/arlo/pull/160#issuecomment-1008560952