Coder Social home page Coder Social logo

pyaarlo's People

Contributors

alexandre-pe avatar ceimon avatar cpina avatar diffuse avatar gtawelt avatar jesserockz avatar kaffetorsk avatar mzsanford avatar phene avatar rsnodgrass avatar sebr avatar twrecked avatar tyr84 avatar wizonesolutions avatar ypno avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

pyaarlo's Issues

Set Trusted Device

I am wondering if there is a possibility to make the Python script act like it is a "Trusted device"? In this case it will not need the second factor only one time. This is possible with iOS App. Unfortunately I was not able to sniff the traffic from the mobile app (Certificate Pinning?) in order to find out which requests are made and the browser access does not have a possibility to set the browser as trusted device.

Any idea how to get that information?

KeyError: '(modes:59G1865E007ED|activeAutomations)'

It seems that Arlo is changing their API faster then one can fix it :-(

This error has been thrown by my script today already two times:

Oct 28 08:43:20 raspberrypi02 arlo-fhem[18919]: Traceback (most recent call last):
Oct 28 08:43:20 raspberrypi02 arlo-fhem[18919]: File "/opt/fhem/arlo-fhem/arlo-fhem.py", line 174, in
Oct 28 08:43:20 raspberrypi02 arlo-fhem[18919]: base.mode = 'aktiviert_tag'
Oct 28 08:43:20 raspberrypi02 arlo-fhem[18919]: File "/opt/fhem/arlo-fhem/pyaarlo/base.py", line 239, in mode
Oct 28 08:43:20 raspberrypi02 arlo-fhem[18919]: _set_mode_v2_cb(1)
Oct 28 08:43:20 raspberrypi02 arlo-fhem[18919]: File "/opt/fhem/arlo-fhem/pyaarlo/base.py", line 221, in _set_mode_v2_cb
Oct 28 08:43:20 raspberrypi02 arlo-fhem[18919]: body = self._arlo.be.post(AUTOMATION_PATH, params=params, raw=True, tid=tid, wait_for=None)
Oct 28 08:43:20 raspberrypi02 arlo-fhem[18919]: File "/opt/fhem/arlo-fhem/pyaarlo/backend.py", line 646, in post
Oct 28 08:43:20 raspberrypi02 arlo-fhem[18919]: return self._wait_for_transaction(tid, timeout)
Oct 28 08:43:20 raspberrypi02 arlo-fhem[18919]: File "/opt/fhem/arlo-fhem/pyaarlo/backend.py", line 556, in _wait_for_transaction
Oct 28 08:43:20 raspberrypi02 arlo-fhem[18919]: response = self._requests.pop(tid)
Oct 28 08:43:20 raspberrypi02 arlo-fhem[18919]: KeyError: '(modes:59G1865E007ED|activeAutomations)'

"aktiviert_tag" is a custom mode I am using.

I am currently unable to reproduce the issue and will work on that. If I do get a reproducable scenario I will send you more information / debugging.

SSL: CERTIFICATE_VERIFY_FAILED

Hi,

is there a way to fix this?

ssl.SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: Hostname mismatch, certificate is not valid for 'mqtt-cluster.arloxcld.com'. (_ssl.c:1056)

camera.py line 885: IndentationError: unexpected indent

I installed pyaarlo in a python 3.8.2 virtual env and ran 'pyaarlo --help'

mbs-retina:~/src/pyaarlo.venv > pyaarlo --help
Traceback (most recent call last):
File "/Users/mbs/src/pyaarlo.venv/bin/pyaarlo", line 5, in
from pyaarlo.main import main_func
File "/Users/mbs/src/pyaarlo.venv/lib/python3.8/site-packages/pyaarlo/init.py", line 12, in
from .camera import ArloCamera
File "/Users/mbs/src/pyaarlo.venv/lib/python3.8/site-packages/pyaarlo/camera.py", line 885
})
^
IndentationError: unexpected indent

There appears to be a redundant unmatched '})' at the end of _set_spotlight_properties

I deleted that line, ran again and got an invalid syntax in camera.py line 907 (was 908 before I deleted line 885)

File "/Users/mbs/src/pyaarlo.venv/lib/python3.8/site-packages/pyaarlo/camera.py", line 907
'intensity': (brightness / 255 * 100) " provide an API consistent with nightlight brightness"
^
SyntaxError: invalid syntax

Failed to read current modes correctly

Since a few weeks I do have again the problem, that my script is no longer correctly reading the current mode of my camera and my lights. After the first connect to Arlo, the modes are read correctly. If I then change the mode via the script, the mode is changed correctly also, but then, if I try to reread the current mode, it does not reflect the current one but still the old one.

It looks rather similar to this older issue #77.

Basically what my script is doing:

# Get the base object for the device
base = getDeviceFromName("Base",arlo.base_stations)
# Set the mode for the device to the specified value
base.mode = 'disarmed'

The above does work correctly. If I check with the Arlo app, the mode is set to the correct value.

# Get the base object for the device
base = getDeviceFromName("Base",arlo.base_stations)
# Get the current mode for that device
status = base.mode

This does not work. The "status" is still the one it had after the initial connect to Arlo and the initial reading of the state.

I enclose a debug file which has the following timestamps:

Before setting the mode: 2022-07-02 14:09:13,655
After setting the mode: 2022-07-02 14:10:08,375
Before getting the mode: 2022-07-02 14:11:37,357 
After getting the mode: 2022-07-02 14:11:51,436 

I am logging in with the following parameters:

arlo = pyaarlo.PyArlo(username=username, password=password,tfa_source='imap', tfa_type='email', tfa_host=tfa_host, tfa_username=tfa_username, tfa_password=tfa_password, synchronous_mode=False, refresh_devices_every=1,reconnect_every=90, stream_timeout=180, request_timeout=120, user_agent='arlo', verbose_debug=True)

Could you please have a look, if you can see, why this is no longer working? I did not change anything on my side and it worked a few months this way.

Thanks a lot.

UPDATE:

It seems that even setting the modes are most of the time working, but not always ...

Uploading debug-encrypted.log…

2FA using IMAP stopped working

I discovered today that logging into Arlo with 2FA IMAP suddenly stopped working after months of successful logins. I use my Gmail account and an app password that I assume is still valid. 2FA failed with both 0.8.0a5 and 0.8.0a6 installed.
(BTW: Thanks so much keeping this code working with Arlo!)

I run pyaarlo on a Raspberry Pi with uWSGI and connect to Hubitat using asynchronous HTTP GET requests. Below is the log of starting up uWSGI:

*** Starting uWSGI 2.0.19.1 (32bit) on [Sun Jul 4 13:06:23 2021] ***
compiled with version: 8.3.0 on 17 June 2020 09:19:11
os: Linux-4.19.118-v7+ #1311 SMP Mon Apr 27 14:21:24 BST 2020
nodename: arlo-pi
machine: armv7l
clock source: unix
pcre jit disabled
detected number of CPU cores: 4
current working directory: /home/pi
detected binary path: /usr/local/bin/uwsgi
chdir() to /home/pi/webapp/
*** WARNING: you are running uWSGI without its master process manager ***
your processes number limit is 7336
your memory page size is 4096 bytes
detected max file descriptor number: 1024
lock engine: pthread robust mutexes
thunder lock: disabled (you can enable it with --thunder-lock)
uwsgi socket 0 bound to TCP address 0.0.0.0:8000 fd 3
Python version: 3.7.3 (default, Dec 20 2019, 18:57:59) [GCC 8.3.0]
Python main interpreter initialized at 0x17acdf8
python threads support enabled
your server socket listen backlog is limited to 100 connections
your mercy for graceful operations on workers is 60 seconds
mapped 64408 bytes (62 KB) for 1 cores
*** Operational MODE: single process ***
2021-07-04 13:06:24,880 - pyaarlo - INFO - pyarlo 0.8.0a6 starting...
2021-07-04 13:06:24,881 - pyaarlo - WARNING - Problem creating aarlo
2021-07-04 13:07:56,432 - pyaarlo - ERROR - 2fa core retrieval failed
failed to login(2fa core retrieval failed)

Problem downloading media from the base station due to the new year.

This morning my program stopped downloading videos from my base station. I noticed error messages with odd dates in the URL. I use library_days=1 when I open pyaarlo.PyArlo. Ordinarily, this would generate six requests. One for the current date and one for the previous day for each of the three cameras I have. Now I'm seeing dozens of requests with odd dates (see the list below). It appears that there is an issue with the calculation of dates when crossing into the new year. I am able to get it to work properly by setting library_days=0, this checks for videos on today's date only (January 1st 2023). If I set library_days greater than zero, it tries to calculate the dates for December 2022 incorrectly.

Here are the URL's with bogus dates:
request=https://192.168.0.30:18721/hmsls/list/20221396/20221396/A2G304K0A17D4 request-error=RemoteDisconnected request=https://192.168.0.30:18721/hmsls/list/20221396/20221396/A431087AA236E request-error=URLError request=https://192.168.0.30:18721/hmsls/list/20221396/20221396/A431087DA2A16 request-error=URLError request=https://192.168.0.30:18721/hmsls/list/20221397/20221397/A2G304K0A17D4 request-error=URLError request=https://192.168.0.30:18721/hmsls/list/20221397/20221397/A431087AA236E request-error=URLError request=https://192.168.0.30:18721/hmsls/list/20221397/20221397/A431087DA2A16 request-error=URLError request=https://192.168.0.30:18721/hmsls/list/20221398/20221398/A2G304K0A17D4 request-error=URLError request=https://192.168.0.30:18721/hmsls/list/20221398/20221398/A431087AA236E request-error=URLError request=https://192.168.0.30:18721/hmsls/list/20221398/20221398/A431087DA2A16 request-error=URLError request=https://192.168.0.30:18721/hmsls/list/20221399/20221399/A2G304K0A17D4 request-error=URLError request=https://192.168.0.30:18721/hmsls/list/20221399/20221399/A431087AA236E request-error=URLError request=https://192.168.0.30:18721/hmsls/list/20221399/20221399/A431087DA2A16 request-error=URLError request=https://192.168.0.30:18721/hmsls/list/20221400/20221400/A2G304K0A17D4 request-error=URLError request=https://192.168.0.30:18721/hmsls/list/20221400/20221400/A431087AA236E request-error=URLError request=https://192.168.0.30:18721/hmsls/list/20221400/20221400/A431087DA2A16 request-error=URLError request=https://192.168.0.30:18721/hmsls/list/20221401/20221401/A2G304K0A17D4 request-error=URLError request=https://192.168.0.30:18721/hmsls/list/20221401/20221401/A431087AA236E request-error=URLError request=https://192.168.0.30:18721/hmsls/list/20221401/20221401/A431087DA2A16 request-error=URLError request=https://192.168.0.30:18721/hmsls/list/20221402/20221402/A2G304K0A17D4 request-error=URLError request=https://192.168.0.30:18721/hmsls/list/20221402/20221402/A431087AA236E request-error=URLError request=https://192.168.0.30:18721/hmsls/list/20221402/20221402/A431087DA2A16 request-error=URLError request=https://192.168.0.30:18721/hmsls/list/20221403/20221403/A2G304K0A17D4 request-error=URLError request=https://192.168.0.30:18721/hmsls/list/20221403/20221403/A431087AA236E request-error=URLError request=https://192.168.0.30:18721/hmsls/list/20221403/20221403/A431087DA2A16 request-error=URLError request=https://192.168.0.30:18721/hmsls/list/20221404/20221404/A2G304K0A17D4 request-error=URLError request=https://192.168.0.30:18721/hmsls/list/20221404/20221404/A431087AA236E request-error=URLError request=https://192.168.0.30:18721/hmsls/list/20221404/20221404/A431087DA2A16 request-error=URLError request=https://192.168.0.30:18721/hmsls/list/20221405/20221405/A2G304K0A17D4 request-error=URLError request=https://192.168.0.30:18721/hmsls/list/20221405/20221405/A431087AA236E request-error=URLError request=https://192.168.0.30:18721/hmsls/list/20221405/20221405/A431087DA2A16 request-error=URLError request=https://192.168.0.30:18721/hmsls/list/20221406/20221406/A2G304K0A17D4 request-error=URLError request=https://192.168.0.30:18721/hmsls/list/20221406/20221406/A431087AA236E request-error=URLError request=https://192.168.0.30:18721/hmsls/list/20221406/20221406/A431087DA2A16 request-error=URLError request=https://192.168.0.30:18721/hmsls/list/20221407/20221407/A2G304K0A17D4 request-error=URLError request=https://192.168.0.30:18721/hmsls/list/20221407/20221407/A431087AA236E request-error=URLError request=https://192.168.0.30:18721/hmsls/list/20221407/20221407/A431087DA2A16 request-error=URLError request=https://192.168.0.30:18721/hmsls/list/20221408/20221408/A2G304K0A17D4 request-error=URLError request=https://192.168.0.30:18721/hmsls/list/20221408/20221408/A431087AA236E request-error=URLError request=https://192.168.0.30:18721/hmsls/list/20221408/20221408/A431087DA2A16 request-error=URLError request=https://192.168.0.30:18721/hmsls/list/20221409/20221409/A2G304K0A17D4 request-error=URLError request=https://192.168.0.30:18721/hmsls/list/20221409/20221409/A431087AA236E request-error=URLError request=https://192.168.0.30:18721/hmsls/list/20221409/20221409/A431087DA2A16 request-error=URLError request=https://192.168.0.30:18721/hmsls/list/20221410/20221410/A2G304K0A17D4 request-error=URLError request=https://192.168.0.30:18721/hmsls/list/20221410/20221410/A431087AA236E request-error=URLError request=https://192.168.0.30:18721/hmsls/list/20221410/20221410/A431087DA2A16 request-error=URLError request=https://192.168.0.30:18721/hmsls/list/20221411/20221411/A2G304K0A17D4 request-error=URLError request=https://192.168.0.30:18721/hmsls/list/20221411/20221411/A431087AA236E request-error=URLError request=https://192.168.0.30:18721/hmsls/list/20221411/20221411/A431087DA2A16 request-error=URLError request=https://192.168.0.30:18721/hmsls/list/20221412/20221412/A2G304K0A17D4 request-error=URLError request=https://192.168.0.30:18721/hmsls/list/20221412/20221412/A431087AA236E request-error=URLError request=https://192.168.0.30:18721/hmsls/list/20221412/20221412/A431087DA2A16 request-error=URLError request=https://192.168.0.30:18721/hmsls/list/20221413/20221413/A2G304K0A17D4 request-error=URLError request=https://192.168.0.30:18721/hmsls/list/20221413/20221413/A431087AA236E request-error=URLError request=https://192.168.0.30:18721/hmsls/list/20221413/20221413/A431087DA2A16 request-error=URLError request=https://192.168.0.30:18721/hmsls/list/20221414/20221414/A2G304K0A17D4 request-error=URLError request=https://192.168.0.30:18721/hmsls/list/20221414/20221414/A431087AA236E request-error=URLError request=https://192.168.0.30:18721/hmsls/list/20221414/20221414/A431087DA2A16 request-error=URLError request=https://192.168.0.30:18721/hmsls/list/20221415/20221415/A2G304K0A17D4 request-error=URLError request=https://192.168.0.30:18721/hmsls/list/20221415/20221415/A431087AA236E request-error=URLError request=https://192.168.0.30:18721/hmsls/list/20221415/20221415/A431087DA2A16 request-error=URLError request=https://192.168.0.30:18721/hmsls/list/20221416/20221416/A2G304K0A17D4 request-error=URLError request=https://192.168.0.30:18721/hmsls/list/20221416/20221416/A431087AA236E request-error=URLError request=https://192.168.0.30:18721/hmsls/list/20221416/20221416/A431087DA2A16 request-error=URLError request=https://192.168.0.30:18721/hmsls/list/20221417/20221417/A2G304K0A17D4 request-error=URLError request=https://192.168.0.30:18721/hmsls/list/20221417/20221417/A431087AA236E request-error=URLError request=https://192.168.0.30:18721/hmsls/list/20221417/20221417/A431087DA2A16 request-error=URLError request=https://192.168.0.30:18721/hmsls/list/20221418/20221418/A2G304K0A17D4 request-error=URLError request=https://192.168.0.30:18721/hmsls/list/20221418/20221418/A431087AA236E request-error=URLError request=https://192.168.0.30:18721/hmsls/list/20221418/20221418/A431087DA2A16 request-error=URLError request=https://192.168.0.30:18721/hmsls/list/20221419/20221419/A2G304K0A17D4 request-error=URLError request=https://192.168.0.30:18721/hmsls/list/20221419/20221419/A431087AA236E request-error=URLError request=https://192.168.0.30:18721/hmsls/list/20221419/20221419/A431087DA2A16 request-error=URLError request=https://192.168.0.30:18721/hmsls/list/20221420/20221420/A2G304K0A17D4 request-error=URLError request=https://192.168.0.30:18721/hmsls/list/20221420/20221420/A431087AA236E request-error=URLError request=https://192.168.0.30:18721/hmsls/list/20221420/20221420/A431087DA2A16 request-error=URLError request=https://192.168.0.30:18721/hmsls/list/20221421/20221421/A2G304K0A17D4 request-error=URLError request=https://192.168.0.30:18721/hmsls/list/20221421/20221421/A431087AA236E request-error=URLError request=https://192.168.0.30:18721/hmsls/list/20221421/20221421/A431087DA2A16 request-error=URLError request=https://192.168.0.30:18721/hmsls/list/20221422/20221422/A2G304K0A17D4 request-error=URLError request=https://192.168.0.30:18721/hmsls/list/20221422/20221422/A431087AA236E request-error=URLError request=https://192.168.0.30:18721/hmsls/list/20221422/20221422/A431087DA2A16 request-error=URLError request=https://192.168.0.30:18721/hmsls/list/20221423/20221423/A2G304K0A17D4 request-error=URLError request=https://192.168.0.30:18721/hmsls/list/20221423/20221423/A431087AA236E request-error=URLError request=https://192.168.0.30:18721/hmsls/list/20221423/20221423/A431087DA2A16 request-error=URLError request=https://192.168.0.30:18721/hmsls/list/20221424/20221424/A2G304K0A17D4 request-error=URLError request=https://192.168.0.30:18721/hmsls/list/20221424/20221424/A431087AA236E request-error=URLError request=https://192.168.0.30:18721/hmsls/list/20221424/20221424/A431087DA2A16 request-error=URLError request=https://192.168.0.30:18721/hmsls/list/20221425/20221425/A2G304K0A17D4 request-error=URLError request=https://192.168.0.30:18721/hmsls/list/20221425/20221425/A431087AA236E request-error=URLError request=https://192.168.0.30:18721/hmsls/list/20221425/20221425/A431087DA2A16 request-error=URLError request=https://192.168.0.30:18721/hmsls/list/20221426/20221426/A2G304K0A17D4 request-error=URLError request=https://192.168.0.30:18721/hmsls/list/20221426/20221426/A431087AA236E request-error=URLError request=https://192.168.0.30:18721/hmsls/list/20221426/20221426/A431087DA2A16 request-error=URLError request=https://192.168.0.30:18721/hmsls/list/20221427/20221427/A2G304K0A17D4 request-error=URLError request=https://192.168.0.30:18721/hmsls/list/20221427/20221427/A431087AA236E request-error=URLError request=https://192.168.0.30:18721/hmsls/list/20221427/20221427/A431087DA2A16 request-error=URLError request=https://192.168.0.30:18721/hmsls/list/20221428/20221428/A2G304K0A17D4 request-error=URLError request=https://192.168.0.30:18721/hmsls/list/20221428/20221428/A431087AA236E request-error=URLError request=https://192.168.0.30:18721/hmsls/list/20221428/20221428/A431087DA2A16 request-error=URLError request=https://192.168.0.30:18721/hmsls/list/20221429/20221429/A2G304K0A17D4 request-error=URLError request=https://192.168.0.30:18721/hmsls/list/20221429/20221429/A431087AA236E request-error=URLError request=https://192.168.0.30:18721/hmsls/list/20221429/20221429/A431087DA2A16 request-error=URLError request=https://192.168.0.30:18721/hmsls/list/20221430/20221430/A2G304K0A17D4 request-error=URLError request=https://192.168.0.30:18721/hmsls/list/20221430/20221430/A431087AA236E request-error=URLError request=https://192.168.0.30:18721/hmsls/list/20221430/20221430/A431087DA2A16 request-error=URLError request=https://192.168.0.30:18721/hmsls/list/20221431/20221431/A2G304K0A17D4 request-error=URLError request=https://192.168.0.30:18721/hmsls/list/20221431/20221431/A431087AA236E request-error=URLError request=https://192.168.0.30:18721/hmsls/list/20221431/20221431/A431087DA2A16 request-error=URLError request=https://192.168.0.30:18721/hmsls/list/20221432/20221432/A2G304K0A17D4 request-error=URLError request=https://192.168.0.30:18721/hmsls/list/20221432/20221432/A431087AA236E request-error=URLError request=https://192.168.0.30:18721/hmsls/list/20221432/20221432/A431087DA2A16 request-error=URLError request=https://192.168.0.30:18721/hmsls/list/20221433/20221433/A2G304K0A17D4 request-error=URLError request=https://192.168.0.30:18721/hmsls/list/20221433/20221433/A431087AA236E request-error=URLError request=https://192.168.0.30:18721/hmsls/list/20221433/20221433/A431087DA2A16 request-error=URLError request=https://192.168.0.30:18721/hmsls/list/20221434/20221434/A2G304K0A17D4 request-error=URLError request=https://192.168.0.30:18721/hmsls/list/20221434/20221434/A431087AA236E request-error=URLError request=https://192.168.0.30:18721/hmsls/list/20221434/20221434/A431087DA2A16 request-error=URLError request=https://192.168.0.30:18721/hmsls/list/20221435/20221435/A2G304K0A17D4 request-error=URLError request=https://192.168.0.30:18721/hmsls/list/20221435/20221435/A431087AA236E request-error=URLError request=https://192.168.0.30:18721/hmsls/list/20221435/20221435/A431087DA2A16 request-error=URLError request=https://192.168.0.30:18721/hmsls/list/20221436/20221436/A2G304K0A17D4 request-error=URLError request=https://192.168.0.30:18721/hmsls/list/20221436/20221436/A431087AA236E request-error=URLError request=https://192.168.0.30:18721/hmsls/list/20221436/20221436/A431087DA2A16 request-error=URLError request=https://192.168.0.30:18721/hmsls/list/20221437/20221437/A2G304K0A17D4 request-error=URLError request=https://192.168.0.30:18721/hmsls/list/20221437/20221437/A431087AA236E request-error=URLError request=https://192.168.0.30:18721/hmsls/list/20221437/20221437/A431087DA2A16 request-error=URLError request=https://192.168.0.30:18721/hmsls/list/20221438/20221438/A2G304K0A17D4 request-error=URLError request=https://192.168.0.30:18721/hmsls/list/20221438/20221438/A431087AA236E request-error=URLError request=https://192.168.0.30:18721/hmsls/list/20221438/20221438/A431087DA2A16 request-error=URLError request=https://192.168.0.30:18721/hmsls/list/20221439/20221439/A2G304K0A17D4 request-error=URLError request=https://192.168.0.30:18721/hmsls/list/20221439/20221439/A431087AA236E request-error=URLError

Authentication Failed

Hi,
I haven't made any changes to my Arlo username / password, but for the last day or so I have only been seeing authentication failed:

2022-02-20 18:34:21,542 - pyaarlo - DEBUG - request-headers=
{'Accept': 'application/json, text/plain, /',
'Auth-Version': '2',
'Referer': 'https://my.arlo.com',
'Source': 'arloCamWeb',
'User-Agent': 'Mozilla/5.0 (iPhone; CPU iPhone OS 11_1_2 like Mac OS X) '
'AppleWebKit/604.3.5 (KHTML, like Gecko) Mobile/15B202 '
'NETGEAR/v1 (iOS Vuezone)'}
2022-02-20 18:34:21,548 - urllib3.connectionpool - DEBUG - Starting new HTTPS connection (1): ocapi-app.arlo.com:443
2022-02-20 18:34:21,821 - urllib3.connectionpool - DEBUG - https://ocapi-app.arlo.com:443 "POST /api/auth HTTP/1.1" 403 None
2022-02-20 18:34:21,823 - pyaarlo - DEBUG - request-end=403
2022-02-20 18:34:21,824 - pyaarlo - ERROR - authentication failed
2022-02-20 18:34:21,824 - pyaarlo - DEBUG - failed to log in
failed to login(authentication failed)

If I try and use the ocapi URL in Chrome, then I get:
Error 1020 Ray ID: 6e09dc9f6bc588aa • 2022-02-20 18:40:10 UTC
Access denied
What happened?
This website is using a security service to protect itself from online attacks.

I guess Chrome might be expected to be blocked, but is anyone else having authentication problems?

TO DO

Now

  • Door bell count
  • continuous streaming
  • "geofencing"
  • add format checks to git commit

pyaarlo binary

  • add more camera commands
  • support lights
  • support alarms

Not Now

  • provide better synchronous support

Done

  • docstrings for all
  • Arlo Ultra as light
  • REST api for 2fa
  • video doorbell can not be a base station
  • place holder
  • better README api docs
  • allow custom ArloTFA object; needed for Home Assistant flows
  • last_error property
  • stop PyArlo::__init__ on authentication failure; kill device is None errors
  • improve authentication failure reporting; much more helpful 2FA reporting
  • make 'encrypt all' work better; redirect out through a child process??

Alarm Panel modes fail to read

For the last few weeks I've been facing an issue where the Alarm Panels that represent the Arlo base stations within Home Assistant fail at reading their state:

Logger: pyaarlo
Source: custom_components/aarlo/pyaarlo/__init__.py:583 
Integration: Arlo Camera Support (documentation, issues) 
First occurred: 19 October 2021, 0:00:25 (15 occurrences) 
Last logged: 7:00:19

failed to read modes (v2)
job-error=TypeError Traceback (most recent call last): File "/config/custom_components/aarlo/pyaarlo/background.py", line 34, in _run_next job["callback"](**job["args"]) File "/config/custom_components/aarlo/pyaarlo/base.py", line 159, in _event_handler self.update_mode() File "/config/custom_components/aarlo/pyaarlo/base.py", line 347, in update_mode for mode in data: TypeError: 'NoneType' object is not iterable

When using service calls to set the Alarm Panel's mode, the Arlo Base Stations do actually change mode (verified from within the App) but the Alarm Panels in Home Assistant do not. The particular error I pasted above started happening 6 days ago, and happens each time I tried to change modes on the Panels.

Restarting Home Assistant, which will reestablish a connection to the Arlo Cloud seems to fix the problem for a while. After observing it for a while, it seems the panels get stuck most often after a change from an "armed" mode to another "armed" mode (e.g., changing to "night" while on "home").

This is on hass-aarlo v0.7.1.7 configured with:

aarlo:
  refresh_devices_every: 1
  stream_timeout: 90
  reconnect_every: 180
  request_timeout: 120
  db_ding_time: 10
  recent_time: 30
  last_format: '%d-%m %H:%M'

Install failed

Install command is wrong... should look like

pip install git+https://github.com/twrecked/pyaarlo

Installation failed... syntax error...

Running command git clone -q https://github.com/twrecked/pyaarlo /tmp/pip-req-build-365omybz
ERROR: Command errored out with exit status 1:
command: /usr/bin/python3 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-req-build-365omybz/setup.py'"'"'; file='"'"'/tmp/pip-req-build-365omybz/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(file);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' egg_info --egg-base /tmp/pip-req-build-365omybz/pip-egg-info
cwd: /tmp/pip-req-build-365omybz/
Complete output (6 lines):
Traceback (most recent call last):
File "", line 1, in
File "/tmp/pip-req-build-365omybz/setup.py", line 18
author_email='[email protected]',
^
SyntaxError: invalid syntax
----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.

error in new response={'meta': {'code': 400, 'error': 9236, 'message': 'Invalid OTP'}}

Worked until this morning; now I've this errors; what happening?

request-error=CloudflareChallengeError
request-error=CloudflareChallengeError
request-error=CloudflareChallengeError
authentication failed
error in new response={'meta': {'code': 400, 'error': 9236, 'message': 'Invalid OTP'}}
2fa finishAuth failed
error in new response={'meta': {'code': 400, 'error': 9236, 'message': 'Invalid OTP'}}
2fa finishAuth failed
error in new response={'meta': {'code': 400, 'error': 9236, 'message': 'Invalid OTP'}}
2fa finishAuth failed
error in new response={'meta': {'code': 400, 'error': 9236, 'message': 'Invalid OTP'}}
2fa finishAuth failed
request-error=CloudflareChallengeError
request-error=CloudflareChallengeError
request-error=CloudflareChallengeError
authentication failed
request-error=CloudflareChallengeError
request-error=CloudflareChallengeError
request-error=CloudflareChallengeError
authentication failed
request-error=CloudflareChallengeError
request-error=CloudflareChallengeError
request-error=CloudflareChallengeError

2FA no more needed?

Hi, I've disabled 2fa for my account and it's still working...

It work web access, app access and python access...

but hadn't it become mandatory to use 2fa?

Set "Geofencing"?

Hi,

is it possible to set the mode to "Gefencing" as well? I do not see this mode if I try to list all available modes?

Thanks,
Michael

SSL: CERTIFICATE_VERIFY_FAILED with newest version (0.8.0a13)

On my Debian installation I get the below SSL verification error. I added the following lines to my code

import ssl
ssl.SSLContext.verify_mode = ssl.VerifyMode.CERT_OPTIONAL

which seems to solve the issue (although I now seem to get that "CloudflareChallengeError" which I did not get before with the non MQTT version; need to check that a bit more).

Anyone else getting that error and has an idea how to solve it?

2021-11-29 11:35:02,294 - pyaarlo - ERROR - general-error=SSLCertVerificationError
Traceback (most recent call last):
  File "/opt/fhem/arlo-fhem/pyaarlo/backend.py", line 462, in _ev_thread_main
    self._ev_client.connect(MQTT_HOST, port=443, keepalive=60)
  File "/opt/fhem/.local/lib/python3.8/site-packages/paho/mqtt/client.py", line 914, in connect
    return self.reconnect()
  File "/opt/fhem/.local/lib/python3.8/site-packages/paho/mqtt/client.py", line 1073, in reconnect
    sock.do_handshake()
  File "/usr/local/lib/python3.8/ssl.py", line 1309, in do_handshake
    self._sslobj.do_handshake()
ssl.SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1124)

Failed to open ratls port

I have been using this library for a couple of months now without an issue, but suddenly today I can no longer connect to the base station to download the videos stored on it. I'm getting the error message: Exception: Failed to open ratls port: None
I can however connect and download using my android phone using the Arlo app. Both are on the same network.

I've tried rebooting everything including the base station, my PC, and my router. Nothing has fixed the issue.

Is anyone else experiencing this?

2FA not parsing mail properly?

When running 2FA, I get the following errors:
[pyaarlo] imap message read failed'int' object has no attribute 'decode'
[pyaarlo] 2fa core retrieval failed
[custom_components.aarlo] unable to connect to Arlo: attempt=1,sleep=15,error=2fa core retrieval failed

I added some printouts to debug a bit. Seems like this line is causing the issue:

for part in email.message_from_bytes(msg[0][1]).walk():

I have to change "[0][1]" to "[1][1]", then it seems to work

general-error=gaierror

Version: version 0.8.0b8

Install:

pip install git+https://github.com/twrecked/pyaarlo

Code:

import pyaarlo
arlo = pyaarlo.PyArlo( username=USERNAME,password=PASSWORD,
tfa_type='SMS',tfa_source='console',synchronous_mode=True,
storage_dir='aarlo')

Error

general-error=gaierror
Traceback (most recent call last):
File "D:\code\venv\sunset\lib\site-packages\pyaarlo\backend.py", line 526, in _mqtt_main
self._event_client.connect(self._arlo.cfg.mqtt_host, port=443, keepalive=60)
File "D:\code\venv\sunset\lib\site-packages\paho\mqtt\client.py", line 914, in connect
return self.reconnect()
File "D:\code\venv\sunset\lib\site-packages\paho\mqtt\client.py", line 1044, in reconnect
sock = self._create_socket_connection()
File "D:\code\venv\sunset\lib\site-packages\paho\mqtt\client.py", line 3685, in _create_socket_connection
return socket.create_connection(addr, timeout=self._connect_timeout, source_address=source)
File "C:\Users\marc\AppData\Local\Programs\Python\Python310\lib\socket.py", line 824, in create_connection
for res in getaddrinfo(host, port, 0, SOCK_STREAM):
File "C:\Users\marc\AppData\Local\Programs\Python\Python310\lib\socket.py", line 955, in getaddrinfo
for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
socket.gaierror: [Errno 11001] getaddrinfo failed

Set Brightness value of a camera

I can check the current brightness value of a camera with

cam.brightness

but, can I also set the brightness value for a camera like

cam.brightness = 3

?

I tried that but it seems not to change the birghtness value of the camera.

Crash: "File "/opt/fhem/arlo-fhem/pyaarlo/base.py", line 222, in _set_mode_v2_cb"

Today I had that error in my python script which is using "pyaarlo" to change modes of my base stations:

Oct 15 18:33:43 raspberrypi02 arlo-fhem[9673]: Traceback (most recent call last):
Oct 15 18:33:43 raspberrypi02 arlo-fhem[9673]: File "/opt/fhem/arlo-fhem/arlo-fhem.py", line 167, in
Oct 15 18:33:43 raspberrypi02 arlo-fhem[9673]: base.mode = 'armed'
Oct 15 18:33:43 raspberrypi02 arlo-fhem[9673]: File "/opt/fhem/arlo-fhem/pyaarlo/base.py", line 238, in mode
Oct 15 18:33:43 raspberrypi02 arlo-fhem[9673]: _set_mode_v2_cb(1)
Oct 15 18:33:43 raspberrypi02 arlo-fhem[9673]: File "/opt/fhem/arlo-fhem/pyaarlo/base.py", line 222, in _set_mode_v2_cb
Oct 15 18:33:43 raspberrypi02 arlo-fhem[9673]: if body.get('success', False) is True or body.get('resource', '') == 'activeAutomations':
Oct 15 18:33:43 raspberrypi02 arlo-fhem[9673]: AttributeError: 'NoneType' object has no attribute 'get'

"base" is the base station object I want to modifiy with "base.mode = 'armed'"
At that time it seems that in File "/opt/fhem/arlo-fhem/pyaarlo/base.py", line 222, the "body" object is not defined.

Could this be because the connection to Arlo has been closed?

Independent of the reason: Do we need to to do some kind of error checking to make sure body does always have the correct content so that the script does not crash at that point?

Unfortunatley I am not a very skilled Python developer so I do not fully understand everything in the script :-(

Feature request

First I want to say nice work!! Second, would it be possible to add a delete video feature? This post request use to work but not sure how to incorporate this into your project

jdata = [ { "createdDate":"20160904", "utcCreatedDate":1473010280395, "deviceId":"XXXXXXXXXXXXX" }, { "createdDate":"20160904", "utcCreatedDate":1473010280395, "deviceId":"XXXXXXXXXXXXX" } ]
requests.post('https://my.arlo.com/hmsweb/users/library/recycle', json= jdata )

Any help would be appreciated! Thank you!

Detected I/O inside the event loop

Seen in my log :

2021-07-26 22:00:00 WARNING (MainThread) [homeassistant.util.async_] Detected I/O inside the event loop. This is causing stability issues. Please report issue to the custom component author for aarlo doing I/O at custom_components/aarlo/pyaarlo/backend.py, line 137: r = self._session.get(

2021-07-26 22:00:00 WARNING (MainThread) [pyaarlo] request-error=RuntimeError

Error, it's for aarlo dev, sorry :(

Unable to login since yesterday evening

My home automation script, which worked perfect the last weeks, cannot login anymore since yesterday evening. The user has no 2FA set up an can login via the Arlo website without a problem.

I am the only one having that issue of is there a general problem with login at the moment?

2021-04-03 08:45:11,448 - pyaarlo - ERROR - authentication failed
2021-04-03 08:46:20,791 - pyaarlo - DEBUG - Cfg started
2021-04-03 08:46:20,796 - pyaarlo - DEBUG - starting
2021-04-03 08:46:20,797 - pyaarlo - DEBUG - file not read
2021-04-03 08:46:20,798 - pyaarlo - DEBUG - looking for user_agent arlo
2021-04-03 08:46:20,798 - pyaarlo - DEBUG - custom connections 20:10
2021-04-03 08:46:20,799 - pyaarlo - DEBUG - login attempt #1
2021-04-03 08:46:20,808 - urllib3.connectionpool - DEBUG - Starting new HTTPS connection (1): ocapi-app.arlo.com:443
2021-04-03 08:46:20,926 - urllib3.connectionpool - DEBUG - https://ocapi-app.arlo.com:443 "POST /api/auth HTTP/1.1" 403 None
2021-04-03 08:46:21,932 - pyaarlo - DEBUG - login attempt #2
2021-04-03 08:46:21,936 - urllib3.connectionpool - DEBUG - Resetting dropped connection: ocapi-app.arlo.com
2021-04-03 08:46:22,049 - urllib3.connectionpool - DEBUG - https://ocapi-app.arlo.com:443 "POST /api/auth HTTP/1.1" 403 None
2021-04-03 08:46:23,059 - pyaarlo - DEBUG - login attempt #3
2021-04-03 08:46:23,063 - urllib3.connectionpool - DEBUG - Resetting dropped connection: ocapi-app.arlo.com
2021-04-03 08:46:23,179 - urllib3.connectionpool - DEBUG - https://ocapi-app.arlo.com:443 "POST /api/auth HTTP/1.1" 403 None
2021-04-03 08:46:24,194 - pyaarlo - ERROR - authentication failed
2021-04-03 08:46:24,196 - pyaarlo - DEBUG - failed to log in
2021-04-03 08:46:24,197 - pyaarlo - DEBUG - not starting downloader

camera_stations attribute no longer exists in PyArlo object

I tried the example in README.md and it failed trying to get the camera_stations attribute.

I dumped the class's dict and grep'd for camera and found this...
$ grep camera ttt
'_cameras': [ArloCamera:camera:BackYard,
ArloCamera:camera:Pool,
ArloCamera:camera:Mailbox,
ArloCamera:camera:FrontDoor,
ArloCamera:camera:Gate],

Apparently, the attribute is now named _cameras. Changing the attribute in the example to _cameras instead
of camera_stations allowed it to work properly. I'm not sure if this is an Arlo change, a class change, or simply
a documentation error.

arlo.base_stations[0] - AttributeError: 'NoneType' object has no attribute 'get'

since few days, mode changes are not working anymore....

base = arlo.base_stations[0]
.....

Traceback (most recent call last):
File "arlo_baby_alert_aus.py", line 4, in
tfa_type='SMS',tfa_source='console',synchronous_mode=True)
File "/usr/local/lib/python3.6/site-packages/pyaarlo/init.py", line 210, in init
self._refresh_bases(initial=True)
File "/usr/local/lib/python3.6/site-packages/pyaarlo/init.py", line 278, in _refresh_bases
base.update_modes()
File "/usr/local/lib/python3.6/site-packages/pyaarlo/base.py", line 251, in update_modes
props = resp.get('properties', {})

Schedule multiple snapshots without blocking

Thanks for writing this excellent library. I've been attempting to make all cameras connected to a base station simultaneously take snapshots. I accomplished this by calling get_snapshot in a separate thread on each ArloCamera object within arlo.cameras. I see that it appears to be a race if multiple threads call the get_snapshot method on the same ArloCamera object, but from what I can tell, one thread per ArloCamera object seems to work fine. I followed each call within get_snapshot, and it looks like you protect every call that alters state with a threading.Lock, but I was hoping you could help me with the following questions:

  1. Are my findings correct/is it safe to concurrently call get_snapshot on multiple camera objects, as long as there is only one thread per camera?
  2. Is there a better way to asynchronously schedule snapshots, then use callbacks to download them when ready?
  3. Are base stations also thread-safe, or does this only work for one base station at time?

If it helps, here is more or less what I've been using to do this (running successfully for about an hour with multiple snapshots per minute):

def get_and_use_snapshot(camera):
    # get snapshot
    img_bytes = camera.get_snapshot(timeout=10)
    img = Image.open(io.BytesIO(img_bytes))

    # use snapshot

def capture_mt(arlo):
    threads = [threading.Thread(target=get_and_use_snapshot, args=(camera,)) for camera in arlo.cameras]

    for t in threads:
        t.start()

    for t in threads:
        t.join()

Unable to download videos past 1 day

ArloMediaLibrary.load() only returns videos from the previous day.
I tried setting library_days=30 in the PyArlo init params, but still does not help.
The same function used to return all videos earlier - have there been any API changes recently?
TIA.

detecting network disconnect -- what is the proper way?

I may be misunderstanding how to detect a disconnect with the servers in a long running session I would get (I did a home network reset)

2021-06-07 15:58:14,853 - pyaarlo - WARNING - error in response={'data': {'error': '2059', 'message': 'Device is offline.', 'reason': 'Device is offline.'}, 'success': False}
2021-06-07 15:58:17,002 - pyaarlo - WARNING - error in response={'data': {'error': '2059', 'message': 'Device is offline.', 'reason': 'Device is offline.'}, 'success': False}

I'd like to detect that and assumed that "is_connected" was the way to go, but that appears to be an incorrect assumption.

is_connected() still returns 'True" after this occurs. what is the proper way to (periodically) check the health of the connection with the server?

consider the following code:

arlo = pyaarlo.PyArlo( username=USERNAME,password=PASSWORD,
tfa_source='imap',tfa_type='email',
tfa_host='imap.gmail.com',
tfa_username=XXXXXXXXX,
tfa_password=ZZZZZZZZZZ,
storage_dir='aarlo',
refresh_devices_every=3 )


after successful login
….

print('starting with mode=' + arlo.base_stations[0].mode[:80], flush=True)

hang around for 1 day and relogin (by exiting)

unless something goes bad during the day

print('waiting 1 day', flush=True)

#time.sleep(86400)

for x in range(1, 86400, 30):
try:
if arlo.is_connected:
print ("all OK; waiting another 30 seconds")
pass

if not arlo.is_connected:
  print ("all NG: we lost connection to arlo", flush=True)
  break

time.sleep(30)

except:
print("somethings wrong, NG", flush=True)
break

arlo.stop()
print('done - exiting')
sys.exit(0)

Arlo Recently added Automation v3 - are you supporting that?

The new Arlo v3 automation APIs seem to break this library.
Cameras seem to still work, but mode setting on the base station does not.
The v3 APIs seem to still return valid data and can still arm the cameras if set right, but don't get reflected in the app correctly, and I suspect would mess with the v3 automations.

There is a manual way to upgrade the hub to this (the v4 Application UX), or, I'm happy to help provide traces.

For example; the API now to get modes is:
https://myapi.arlo.com/hmsweb/automation/v3/modes

And the response I get is as below:
{"success":true,"data":{"schemaVersion":1,"source":"client-935a7093a2b92021ded5d6b0ca425a61_56AD7D8F-5A33-4A2A-ABE6-D4B4A63E6D8F","properties":{"standby":{"automations":[],"schedules":["0--f81f810b-ae83-42ad-8c6f-2def00073c25","1--23f27fde-a688-4ca1-b57f-839b71879e65"],"geofences":["bdd9be9a-c8a3-4e0b-b1a0-e23565a5e1ec","064cb637-5803-401d-9a5c-4c9f565f6a88"],"name":"Stand By","shortcuts":[],"rules":[],"exitDelay":0},"armHome":{"automations":[],"schedules":["0--f81f810b-ae83-42ad-8c6f-2def00073c25","1--b49e8d5e-1905-4625-94cf-99a9c12f5389"],"geofences":["bdd9be9a-c8a3-4e0b-b1a0-e23565a5e1ec","064cb637-5803-401d-9a5c-4c9f565f6a88"],"name":"Arm Home","shortcuts":[],"rules":["effcf9c1-8f1c-456e-8ac4-a53b97fd35c2","67857e2e-672c-411e-9141-52af14566719","f79804e0-a141-4f61-9c3b-aca42b7fad58","b61ca424-c0b4-4505-b99f-6699c27850cf"],"exitDelay":0},"armAway":{"automations":[],"schedules":["0--f81f810b-ae83-42ad-8c6f-2def00073c25"],"geofences":["bdd9be9a-c8a3-4e0b-b1a0-e23565a5e1ec","064cb637-5803-401d-9a5c-4c9f565f6a88"],"name":"Arm Away","shortcuts":[],"rules":["25989346-8e1f-4f4d-998d-e81fc208ede8","857590eb-29b9-4837-aa8a-7367ed578c94","abbc97c2-86fe-4e43-b326-87c10e5a288b","2ff55d85-e5ff-4d2a-b222-cb60951495d0","eed172a7-d3cb-450a-af2a-f3cb11983de5","276088b2-b532-4347-b6f3-36f9e18b9d8b","61253997-2f0a-4150-921d-52a7f386cd9e","2042a445-e819-48a2-bed9-d32ae9b495b3"],"exitDelay":60}},"revision":1671899858897}}

Unable to retrieve videos

I'm attempting to get the last videos from each camera and I'm unable to get the API to list what is available. There are no errors reported just no videos returned even though there are some available on the camera.

print("captured {}".format(camera.unseen_videos))
print("captured today {}".format(camera.captured_today))`
for video in camera.last_n_videos(5):
    print("url {} ".format(video.video_url))

For one of my cameras, the unseen_videos is correctly reporting 102. I have manually captured a video today but captured_today is reporting zero, and last_n_videos is None.

Can you advise if there is any additional debug I need to add to see whats going on? I have verbose_debug set to True.

Check if Arlo is online

Hi,

I want to use the console logger output.

For example, I want to use this to make sure my Alro is online.

If I turn the Arlo base station off I get the response of
WARNING:pyaarlo:error in response={'data': {'error': '2059', 'message': 'Device is offline.', 'reason': 'Device is offline.'}, 'success': False}

base.mode returns the last mode Alro was in. The module tchellomello/python-arlo returned None so I could work with that.

Any ideas?

Thanks for your work.

sensors stop updating

Hi

Using current pyaarlo from HACS and current HASS 2021.7.2 (had this problem in 2021.6.* also).

I am not sure when this started, but I have noticed now that the temp and humidity sensors on my baby arlo just stop reporting not long after a HASS restart and I need to restart again for it to work.

image

logs for that minute/time period:

2021-07-10 13:20:43 DEBUG (ArloBackgroundWorker) [pyaarlo] pinging BabyMonitor
2021-07-10 13:20:43 DEBUG (ArloBackgroundWorker) [pyaarlo] set:ArloBase/50C176SP443A1/connectionState=available
2021-07-10 13:21:43 DEBUG (ArloBackgroundWorker) [pyaarlo] pinging BabyMonitor
2021-07-10 13:21:43 DEBUG (ArloBackgroundWorker) [pyaarlo] set:ArloBase/50C176SP443A1/connectionState=available
2021-07-10 13:21:44 DEBUG (ArloEventStream) [pyaarlo] sending modes to 50C176SP443A1
2021-07-10 13:21:44 DEBUG (ArloBackgroundWorker) [pyaarlo] mode0<=M=>disarmed
2021-07-10 13:21:44 DEBUG (ArloBackgroundWorker) [pyaarlo] set:ArloBase/50C176SP443A1/modeIdToName/mode0=disarmed
2021-07-10 13:21:44 DEBUG (ArloBackgroundWorker) [pyaarlo] set:ArloBase/50C176SP443A1/modeNameToId/disarmed=mode0
2021-07-10 13:21:44 DEBUG (ArloBackgroundWorker) [pyaarlo] set:ArloBase/50C176SP443A1/modeIsSchedule/mode0=False
2021-07-10 13:21:44 DEBUG (ArloBackgroundWorker) [pyaarlo] set:ArloBase/50C176SP443A1/modeIsSchedule/disarmed=False
2021-07-10 13:21:44 DEBUG (ArloBackgroundWorker) [pyaarlo] mode1<=M=>armed
2021-07-10 13:21:44 DEBUG (ArloBackgroundWorker) [pyaarlo] set:ArloBase/50C176SP443A1/modeIdToName/mode1=armed
2021-07-10 13:21:44 DEBUG (ArloBackgroundWorker) [pyaarlo] set:ArloBase/50C176SP443A1/modeNameToId/armed=mode1
2021-07-10 13:21:44 DEBUG (ArloBackgroundWorker) [pyaarlo] set:ArloBase/50C176SP443A1/modeIsSchedule/mode1=False
2021-07-10 13:21:44 DEBUG (ArloBackgroundWorker) [pyaarlo] set:ArloBase/50C176SP443A1/modeIsSchedule/armed=False
2021-07-10 13:21:45 DEBUG (ArloEventStream) [pyaarlo] sending cameras to 50C176SP443A1
2021-07-10 13:21:45 DEBUG (ArloBackgroundWorker) [pyaarlo] BabyMonitor BASE got modes
2021-07-10 13:21:45 DEBUG (ArloBackgroundWorker) [pyaarlo] mode0<=M=>disarmed
2021-07-10 13:21:45 DEBUG (ArloBackgroundWorker) [pyaarlo] set:ArloBase/50C176SP443A1/modeIdToName/mode0=disarmed
2021-07-10 13:21:45 DEBUG (ArloBackgroundWorker) [pyaarlo] set:ArloBase/50C176SP443A1/modeNameToId/disarmed=mode0
2021-07-10 13:21:45 DEBUG (ArloBackgroundWorker) [pyaarlo] set:ArloBase/50C176SP443A1/modeIsSchedule/mode0=False
2021-07-10 13:21:45 DEBUG (ArloBackgroundWorker) [pyaarlo] set:ArloBase/50C176SP443A1/modeIsSchedule/disarmed=False
2021-07-10 13:21:45 DEBUG (ArloBackgroundWorker) [pyaarlo] mode1<=M=>armed
2021-07-10 13:21:45 DEBUG (ArloBackgroundWorker) [pyaarlo] set:ArloBase/50C176SP443A1/modeIdToName/mode1=armed
2021-07-10 13:21:45 DEBUG (ArloBackgroundWorker) [pyaarlo] set:ArloBase/50C176SP443A1/modeNameToId/armed=mode1
2021-07-10 13:21:45 DEBUG (ArloBackgroundWorker) [pyaarlo] set:ArloBase/50C176SP443A1/modeIsSchedule/mode1=False
2021-07-10 13:21:45 DEBUG (ArloBackgroundWorker) [pyaarlo] set:ArloBase/50C176SP443A1/modeIsSchedule/armed=False
2021-07-10 13:21:45 DEBUG (ArloBackgroundWorker) [pyaarlo] set:ArloBase/50C176SP443A1/activeMode=armed
2021-07-10 13:21:45 DEBUG (ArloBackgroundWorker) [pyaarlo] BabyMonitor CAMERA got one modes
2021-07-10 13:21:45 DEBUG (ArloBackgroundWorker) [pyaarlo] BabyMonitor BASE got cameras
2021-07-10 13:21:45 DEBUG (ArloBackgroundWorker) [pyaarlo] set:ArloBase/50C176SP443A1/batteryLevel=100
2021-07-10 13:21:45 DEBUG (ArloBackgroundWorker) [pyaarlo] set:ArloBase/50C176SP443A1/batteryTech=Rechargeable
2021-07-10 13:21:45 DEBUG (ArloBackgroundWorker) [pyaarlo] set:ArloBase/50C176SP443A1/chargerTech=Regular
2021-07-10 13:21:45 DEBUG (ArloBackgroundWorker) [pyaarlo] set:ArloBase/50C176SP443A1/chargingState=Off
2021-07-10 13:21:45 DEBUG (ArloBackgroundWorker) [pyaarlo] set:ArloBase/50C176SP443A1/signalStrength=4
2021-07-10 13:21:45 DEBUG (ArloBackgroundWorker) [pyaarlo] set:ArloBase/50C176SP443A1/brightness=0
2021-07-10 13:21:45 DEBUG (ArloBackgroundWorker) [pyaarlo] set:ArloBase/50C176SP443A1/mirror=False
2021-07-10 13:21:45 DEBUG (ArloBackgroundWorker) [pyaarlo] set:ArloBase/50C176SP443A1/flip=False
2021-07-10 13:21:45 DEBUG (ArloBackgroundWorker) [pyaarlo] set:ArloBase/50C176SP443A1/powerSaveMode=2
2021-07-10 13:21:45 DEBUG (ArloBackgroundWorker) [pyaarlo] set:ArloBase/50C176SP443A1/speaker={'mute': False, 'volume': 58}
2021-07-10 13:21:45 DEBUG (ArloBackgroundWorker) [pyaarlo] set:ArloBase/50C176SP443A1/privacyActive=False
2021-07-10 13:21:45 DEBUG (ArloBackgroundWorker) [pyaarlo] set:ArloBase/50C176SP443A1/connectionState=available
2021-07-10 13:21:45 DEBUG (ArloBackgroundWorker) [pyaarlo] set:ArloBase/50C176SP443A1/activityState=idle
2021-07-10 13:21:45 DEBUG (ArloBackgroundWorker) [pyaarlo] set:ArloBase/50C176SP443A1/motionSetupModeEnabled=False
2021-07-10 13:21:45 DEBUG (ArloBackgroundWorker) [pyaarlo] set:ArloBase/50C176SP443A1/motionSetupModeSensitivity=80
2021-07-10 13:21:45 DEBUG (ArloBackgroundWorker) [pyaarlo] set:ArloBase/50C176SP443A1/motionDetected=False
2021-07-10 13:21:45 DEBUG (ArloBackgroundWorker) [pyaarlo] set:ArloBase/50C176SP443A1/audioDetected=False
2021-07-10 13:21:45 DEBUG (ArloBackgroundWorker) [pyaarlo] BabyMonitor CAMERA got one cameras
2021-07-10 13:21:45 DEBUG (ArloBackgroundWorker) [pyaarlo] set:ArloCamera/50C176SP443A1/batteryLevel=100
2021-07-10 13:21:45 DEBUG (ArloBackgroundWorker) [custom_components.aarlo.sensor] callback:Battery Level BabyMonitor:batteryLevel:100
2021-07-10 13:21:45 DEBUG (ArloBackgroundWorker) [pyaarlo] set:ArloCamera/50C176SP443A1/batteryTech=Rechargeable
2021-07-10 13:21:45 DEBUG (ArloBackgroundWorker) [pyaarlo] set:ArloCamera/50C176SP443A1/chargerTech=Regular
2021-07-10 13:21:45 DEBUG (ArloBackgroundWorker) [custom_components.aarlo.camera] callback:BabyMonitor:chargerTech:Regular
2021-07-10 13:21:45 DEBUG (ArloBackgroundWorker) [pyaarlo] set:ArloCamera/50C176SP443A1/chargingState=Off
2021-07-10 13:21:45 DEBUG (ArloBackgroundWorker) [custom_components.aarlo.camera] callback:BabyMonitor:chargingState:Off
2021-07-10 13:21:45 DEBUG (ArloBackgroundWorker) [pyaarlo] set:ArloCamera/50C176SP443A1/signalStrength=4
2021-07-10 13:21:45 DEBUG (ArloBackgroundWorker) [custom_components.aarlo.sensor] callback:Signal Strength BabyMonitor:signalStrength:4
2021-07-10 13:21:45 DEBUG (ArloBackgroundWorker) [pyaarlo] set:ArloCamera/50C176SP443A1/brightness=0
2021-07-10 13:21:45 DEBUG (ArloBackgroundWorker) [custom_components.aarlo.light] callback:BabyMonitor:brightness:0
2021-07-10 13:21:45 DEBUG (ArloBackgroundWorker) [pyaarlo] set:ArloCamera/50C176SP443A1/mirror=False
2021-07-10 13:21:45 DEBUG (ArloBackgroundWorker) [pyaarlo] set:ArloCamera/50C176SP443A1/flip=False
2021-07-10 13:21:45 DEBUG (ArloBackgroundWorker) [pyaarlo] set:ArloCamera/50C176SP443A1/powerSaveMode=2
2021-07-10 13:21:45 DEBUG (ArloBackgroundWorker) [pyaarlo] set:ArloCamera/50C176SP443A1/speaker={'mute': False, 'volume': 58}
2021-07-10 13:21:45 INFO (ArloBackgroundWorker) [custom_components.aarlo.media_player] callback:BabyMonitor:speaker:{'mute': False, 'volume': 58}
2021-07-10 13:21:45 DEBUG (ArloBackgroundWorker) [pyaarlo] set:ArloCamera/50C176SP443A1/privacyActive=False
2021-07-10 13:21:45 DEBUG (ArloBackgroundWorker) [custom_components.aarlo.camera] callback:BabyMonitor:privacyActive:False
2021-07-10 13:21:45 DEBUG (ArloBackgroundWorker) [pyaarlo] set:ArloCamera/50C176SP443A1/connectionState=available
2021-07-10 13:21:45 DEBUG (ArloBackgroundWorker) [custom_components.aarlo.camera] callback:BabyMonitor:connectionState:available
2021-07-10 13:21:45 DEBUG (ArloBackgroundWorker) [pyaarlo] set:ArloCamera/50C176SP443A1/activityState=idle
2021-07-10 13:21:45 DEBUG (ArloBackgroundWorker) [custom_components.aarlo.switch] callback:BabyMonitor Snapshot:activityState:idle
2021-07-10 13:21:45 DEBUG (ArloBackgroundWorker) [custom_components.aarlo.camera] callback:BabyMonitor:activityState:idle
2021-07-10 13:21:45 DEBUG (ArloBackgroundWorker) [pyaarlo] set:ArloCamera/50C176SP443A1/motionSetupModeEnabled=False
2021-07-10 13:21:45 DEBUG (ArloBackgroundWorker) [pyaarlo] set:ArloCamera/50C176SP443A1/motionSetupModeSensitivity=80
2021-07-10 13:21:45 DEBUG (ArloBackgroundWorker) [pyaarlo] set:ArloCamera/50C176SP443A1/motionDetected=False
2021-07-10 13:21:45 DEBUG (ArloBackgroundWorker) [custom_components.aarlo.binary_sensor] callback:Motion BabyMonitor:motionDetected:False
2021-07-10 13:21:45 DEBUG (ArloBackgroundWorker) [pyaarlo] set:ArloCamera/50C176SP443A1/audioDetected=False
2021-07-10 13:21:45 DEBUG (ArloBackgroundWorker) [custom_components.aarlo.binary_sensor] callback:Sound BabyMonitor:audioDetected:False
2021-07-10 13:21:47 DEBUG (ArloEventStream) [pyaarlo] sending cameras/50C176SP443A1/ambientSensors/history to 50C176SP443A1
2021-07-10 13:21:47 DEBUG (ArloBackgroundWorker) [pyaarlo] BabyMonitor BASE got cameras/50C176SP443A1/ambientSensors/history
2021-07-10 13:21:47 DEBUG (ArloBackgroundWorker) [pyaarlo] BabyMonitor CAMERA got one cameras/50C176SP443A1/ambientSensors/history
2021-07-10 13:21:47 DEBUG (ArloBackgroundWorker) [pyaarlo] set:ArloCamera/50C176SP443A1/temperature=17.2
2021-07-10 13:21:47 DEBUG (ArloBackgroundWorker) [custom_components.aarlo.sensor] callback:Temperature BabyMonitor:temperature:17.2
2021-07-10 13:21:47 DEBUG (ArloBackgroundWorker) [pyaarlo] set:ArloCamera/50C176SP443A1/humidity=72.3
2021-07-10 13:21:47 DEBUG (ArloBackgroundWorker) [custom_components.aarlo.sensor] callback:Humidity BabyMonitor:humidity:72.3
2021-07-10 13:21:47 DEBUG (ArloBackgroundWorker) [pyaarlo] set:ArloCamera/50C176SP443A1/airQuality=8.3
2021-07-10 13:21:47 DEBUG (ArloBackgroundWorker) [custom_components.aarlo.sensor] callback:Air Quality BabyMonitor:airQuality:8.3

and then a little bit later

2021-07-10 13:22:11 DEBUG (ArloEventStream) [pyaarlo] unhandled response  - {'status': 'disconnected:2021-07-10T03:22:11.047Z'}
2021-07-10 13:22:11 DEBUG (ArloEventStream) [pyaarlo] sseclient-error=StopIteration
2021-07-10 13:22:14 DEBUG (ArloEventStream) [pyaarlo] Fetching device list after ev-reconnect
2021-07-10 13:22:43 DEBUG (ArloBackgroundWorker) [pyaarlo] pinging BabyMonitor
2021-07-10 13:22:43 DEBUG (ArloBackgroundWorker) [pyaarlo] set:ArloBase/50C176SP443A1/connectionState=available
2021-07-10 13:23:43 DEBUG (ArloBackgroundWorker) [pyaarlo] pinging BabyMonitor
2021-07-10 13:23:43 DEBUG (ArloBackgroundWorker) [pyaarlo] set:ArloBase/50C176SP443A1/connectionState=available
2021-07-10 13:24:22 DEBUG (ArloBackgroundWorker) [pyaarlo] turning recent OFF for BabyMonitor
2021-07-10 13:24:22 DEBUG (ArloBackgroundWorker) [custom_components.aarlo.camera] callback:BabyMonitor:recentActivity:False
2021-07-10 13:24:22 DEBUG (ArloBackgroundWorker) [custom_components.aarlo.sensor] callback:Recent Activity BabyMonitor:recentActivity:False
2021-07-10 13:24:43 DEBUG (ArloBackgroundWorker) [pyaarlo] pinging BabyMonitor
2021-07-10 13:24:43 DEBUG (ArloBackgroundWorker) [pyaarlo] set:ArloBase/50C176SP443A1/connectionState=available
2021-07-10 13:25:43 DEBUG (ArloBackgroundWorker) [pyaarlo] pinging BabyMonitor
2021-07-10 13:25:43 DEBUG (ArloBackgroundWorker) [pyaarlo] set:ArloBase/50C176SP443A1/connectionState=available

Other parts of it still seem to work, like i have an automation turning on/off movement recording and the night light and they still work, just the temp/humidity/air quality sensors stop (and none of those automations are running when this reporting stops).

some time later I see a

2021-07-10 14:22:44 ERROR (ArloBackgroundWorker) [pyaarlo] unable to read mode, try forcing v2

body-error=JSONDecodeError

Hi,
I am receiving this new error :
body-error=JSONDecodeError
on the account connection of my Arlo Go. This has been working for months without any issue, and I haven't changed anything recently. Do you know where this might come from ?

It seems related to a <Response [403]> on the
r = self._session.post(
url, json=params, headers=headers, timeout=timeout
)

Here is the params :
{'email': 'a........', 'password': 'Q..........', 'language': 'en', 'EnvSource': 'prod'}

And headers I am using :
{'Accept': 'application/json, text/plain, /', 'Accept-Language': 'en-US,en;q=0.9', 'Origin': 'https://my.arlo.com', 'Referer': 'https://my.arlo.com/', 'Source': 'arloCamWeb', 'User-Agent': 'Mozilla/5.0 (iPhone; CPU iPhone OS 11_1_2 like Mac OS X) AppleWebKit/604.3.5 (KHTML, like Gecko) Mobile/15B202 NETGEAR/v1 (iOS Vuezone)'}

Thanks in advance.

2FA via Push ?

Hello,
not an issue, more like a question.

Have you tried to see if we could handle 2FA via push method ?
I see that we can log into My Arlo in a browser, request a 2FA "Push" to a registered mobile, then Trust this "Browser". I'd imagine we could handle 2FA like this.

I would be interested to know if you have ever explored the possibility to add this into your lib. If not then I could try to write the functionality.

wrong version in setup.py

in setup.py the version is still 0.7.0b7....

in cause of that pip --upgrade is not working.

could you please fix that.

Thanks an BR

Can't restart cameras

On latest build b8 with modifications to pyarlo.py to work around current Cloudflare issues.

Cameras are working fine, can start recordings etc with arlo service calls in HA.
For the life of me though even with primary account I cannot restart my cameras to deal with flaky hardware issues of cameras motion detectors stopping working (ArloPro5S for what it's worth).
The service call I am making is as follows:
service: aarlo.restart_device data: entity_id: camera.aarlo_beneath_dwelling
I get unknown error as a response.
Any advice on what I am doing wrong would be appreciated.

authentication error

Hi, starting from this morning I'm receiving authentication errore in my python scritp. It's running with no problem starting from many months ago...

What's happening?

Thanks

Guido

AttributeError: 'ArloBase' object has no attribute 'update_resources'

Aarlo integration appears to be working but seeing this error in my core logs:

2021-12-11 05:21:10 ERROR (MainThread) [homeassistant] Error doing job: Unclosed connection
2021-12-11 05:34:01 ERROR (MainThread) [homeassistant] Error doing job: Unclosed connection
2021-12-11 05:39:17 ERROR (MainThread) [homeassistant] Error doing job: Unclosed connection
2021-12-11 05:41:48 ERROR (ArloBackgroundWorker) [pyaarlo] job-error=AttributeError
Traceback (most recent call last):
File "/config/custom_components/aarlo/pyaarlo/background.py", line 34, in _run_next
job"callback"
File "/config/custom_components/aarlo/pyaarlo/init.py", line 306, in _refresh_devices
base.update_resources(props)
AttributeError: 'ArloBase' object has no attribute 'update_resources'

2021-12-11 05:42:13 ERROR (MainThread) [aiohttp.server] Error handling request
Traceback (most recent call last):
File "/usr/local/lib/python3.9/site-packages/aiohttp/web_protocol.py", line 314, in data_received
messages, upgraded, tail = self._request_parser.feed_data(data)
File "aiohttp/_http_parser.pyx", line 546, in aiohttp._http_parser.HttpParser.feed_data
aiohttp.http_exceptions.BadStatusLine: 400, message="Bad status line 'invalid HTTP method'"
2021-12-11 05:45:02 ERROR (Recorder) [homeassistant] Error doing job: Unclosed connection
2021-12-11 05:52:56 ERROR (MainThread) [homeassistant] Error doing job: Unclosed connection
2021-12-11 05:58:10 ERROR (MainThread) [homeassistant] Error doing job: Unclosed connection
2021-12-11 06:01:58 ERROR (MainThread) [aiohttp.server] Error handling request
Traceback (most recent call last):
File "/usr/local/lib/python3.9/site-packages/aiohttp/web_protocol.py", line 314, in data_received
messages, upgraded, tail = self._request_parser.feed_data(data)
File "aiohttp/_http_parser.pyx", line 546, in aiohttp._http_parser.HttpParser.feed_data
aiohttp.http_exceptions.BadStatusLine: 400, message="Bad status line 'invalid HTTP method'"
2021-12-11 06:03:36 ERROR (Recorder) [homeassistant] Error doing job: Unclosed connection
2021-12-11 06:09:55 ERROR (MainThread) [homeassistant] Error doing job: Unclosed connection
2021-12-11 06:15:55 ERROR (MainThread) [homeassistant] Error doing job: Unclosed connection
2021-12-11 06:22:03 ERROR (Recorder) [homeassistant] Error doing job: Unclosed connection
2021-12-11 06:28:25 ERROR (Thread-14) [homeassistant] Error doing job: Unclosed connection
2021-12-11 06:34:10 ERROR (MainThread) [homeassistant] Error doing job: Unclosed connection
2021-12-11 06:39:36 ERROR (Recorder) [homeassistant] Error doing job: Unclosed connection
2021-12-11 06:41:48 ERROR (ArloBackgroundWorker) [pyaarlo] job-error=AttributeError
Traceback (most recent call last):
File "/config/custom_components/aarlo/pyaarlo/background.py", line 34, in _run_next
job"callback"
File "/config/custom_components/aarlo/pyaarlo/init.py", line 306, in _refresh_devices
base.update_resources(props)
AttributeError: 'ArloBase' object has no attribute 'update_resources'

2021-12-11 06:45:55 ERROR (MainThread) [homeassistant] Error doing job: Unclosed connection
2021-12-11 06:51:28 ERROR (MainThread) [homeassistant] Error doing job: Unclosed connection
2021-12-11 06:58:36 ERROR (Recorder) [homeassistant] Error doing job: Unclosed connection
2021-12-11 07:07:16 ERROR (MainThread) [aioharmony.hubconnector_websocket] 192.168.1.23: Connection timed out for hub 8657110
2021-12-11 07:09:55 ERROR (MainThread) [homeassistant] Error doing job: Unclosed connection
2021-12-11 07:21:31 ERROR (MainThread) [homeassistant] Error doing job: Unclosed connection
2021-12-11 07:28:03 ERROR (Recorder) [homeassistant] Error doing job: Unclosed connection
2021-12-11 07:33:36 ERROR (Recorder) [homeassistant] Error doing job: Unclosed connection
2021-12-11 07:42:48 ERROR (ArloBackgroundWorker) [pyaarlo] job-error=AttributeError
Traceback (most recent call last):
File "/config/custom_components/aarlo/pyaarlo/background.py", line 34, in _run_next
job"callback"
File "/config/custom_components/aarlo/pyaarlo/init.py", line 306, in _refresh_devices
base.update_resources(props)
AttributeError: 'ArloBase' object has no attribute 'update_resources'

2021-12-11 07:46:17 ERROR (MainThread) [homeassistant] Error doing job: Unclosed connection
2021-12-11 07:52:17 ERROR (MainThread) [homeassistant] Error doing job: Unclosed connection
2021-12-11 08:03:17 ERROR (MainThread) [homeassistant] Error doing job: Unclosed connection
2021-12-11 08:09:35 ERROR (MainThread) [homeassistant] Error doing job: Unclosed connection
2021-12-11 08:15:05 ERROR (MainThread) [homeassistant] Error doing job: Unclosed connection
2021-12-11 08:21:07 ERROR (Recorder) [homeassistant] Error doing job: Unclosed connection
2021-12-11 08:26:56 ERROR (MainThread) [homeassistant] Error doing job: Unclosed connection
2021-12-11 08:33:06 ERROR (MainThread) [homeassistant] Error doing job: Unclosed connection
2021-12-11 08:39:07 ERROR (Recorder) [homeassistant] Error doing job: Unclosed connection
2021-12-11 08:43:48 ERROR (ArloBackgroundWorker) [pyaarlo] job-error=AttributeError
Traceback (most recent call last):
File "/config/custom_components/aarlo/pyaarlo/background.py", line 34, in _run_next
job"callback"
File "/config/custom_components/aarlo/pyaarlo/init.py", line 306, in _refresh_devices
base.update_resources(props)
AttributeError: 'ArloBase' object has no attribute 'update_resources'

2021-12-11 08:45:36 ERROR (Recorder) [homeassistant] Error doing job: Unclosed connection
[cont-finish.d] executing container finish scripts...
[cont-finish.d] done.
[s6-finish] waiting for services.
[finish] process exit code 0
s6-svscanctl: fatal: unable to control /var/run/s6/services: supervisor not listening
[s6-finish] sending all processes the TERM signal.
[s6-finish] sending all processes the KILL signal and exiting.
[s6-init] making user provided files available at /var/run/s6/etc...exited 0.
[s6-init] ensuring user provided files have correct perms...exited 0.
[fix-attrs.d] applying ownership & permissions fixes...
[fix-attrs.d] done.
[cont-init.d] executing container initialization scripts...
[cont-init.d] done.
[services.d] starting services
[services.d] done.

How to use

Hi, can I've some suggest about how to use it? What import and so on. Thanks

Connection with the arlo account not stopping

Hello, I don't why but I couldn't logout from my arlo account.
The Code
from pyaarlo import PyArlo
arlo_account = PyArlo(username=USERNAME, password=PASSWORD)
print(arlo_account.is_connected)
arlo_account.stop()
print(arlo_account.is_connected)
Expected output
True
False
Actual output
True
True

Even after calling arlo_account.stop(), I can still access the cameras, get snapshot, etc..., and the Arlo threads still exist.
Is there something I didn't understand or is it a bug ?

request-error=CloudflareChallengeError

Although I had 2FA working fine with IMAP, I was getting intermittent errors of:

request-error=CloudflareChallengeError

Which appears to be related to the CloudFlare CDN doing a "Browser check" - but it was only occasional, and after a day or two it would succeed and download the past 7 days - also, I could run it manually and it would work most of the time.

But now, it happens every time, and has for the past 6 days, and I cannot run it manually - same error.

And I have gone to my.arlo.com on the same machine, and logged in just fine (and trusted the browser), but the error persists.

Perhaps saving the trusted browser cookies somehow, and including them in the PyArlo request?

What a pain.

Best,
joe

Arlo Streams Stopped Working

I got the Arlo stream from the 'start-stream' command, it used to play the video using ffmpeg/ffplay but now I am getting

Invalid data found when processing input

Arlo Go V2

Hi,
I am wondering if the current Arlo Go V2 would work with Pyaarlo, or if code updates would be required ?
Thanks.

2FA via IMAP mail not working if more than one mail address configured

The account I am using with pyarlo does have two mail addresses configured, the one of the account itself and another one which is set as primary 2FA mail.

In the log you see that both addresses are read from Arlo but the 2FA token is never received. I guess that is because he wrong address is used?

If I am using an account where the mail address of the account is the same as the 2FA mail address, everything seems to work fine.

Here is the log fragment of the failing account (the factor "PRIMARY" should be the correct mail address):

2021-11-29 17:12:58,700 - pyaarlo - DEBUG - need 2FA...
2021-11-29 17:12:58,701 - pyaarlo - DEBUG - getting tfa choices
2021-11-29 17:12:58,702 - pyaarlo - DEBUG - request-url=https://ocapi-app.arlo.com/api/getFactors?data = 1638202378
2021-11-29 17:12:58,703 - pyaarlo - DEBUG - request-params=
{}
2021-11-29 17:12:58,704 - pyaarlo - DEBUG - request-headers=
{'Accept': 'application/json, text/plain, */*',
 'Accept-Language': 'en-US,en;q=0.9',
 'Authorization': 'Ml9vUEhnbEF2WldRd3dpZnZfYWJBb3JCZ1lkZWtSUjIyWlU0dEg1X3NJTUhvREFLcG9MWnFaUWEwOWg5UVEzWWZEQ1B1Q3F5VEIybGtSNTM5bXc3SEZtX2dZVEpvVmVBZmZCb0s5WFRvMmdyaGhCWWlmYUVPRnhpQTRrbDNfd3o5akF3czBrRkd5bVlIWE9XaVN0cC1LOTZZcHhaVUp0bEtVU2RYQWFBZF8wcXR3enZlcEd6eVFYZEphSjBYdlp1R2xnUjZ3TFBDN0p3UEY4dl9WcDBoaDBOeTVlcHZoQUxva3luMzFVcG9lLTFVZ3AxQng4NXpnZ1dFQ2l2bGRzRElKNWdjQmxyamtJZDRmdFV5RkJKdzVjYVc5ZmI1QTB5cTZnNkt3TTlReVZxRHFscHJEcDA4eDJkOWtnRll2RVpDbEdmbFJsRXdwR2J3S0ExRzIxU2NFT1pF',
 'Origin': 'https://my.arlo.com',
 'Referer': 'https://my.arlo.com/',
 'Source': 'arloCamWeb',
 'User-Agent': 'Mozilla/5.0 (iPhone; CPU iPhone OS 11_1_2 like Mac OS X) '
               'AppleWebKit/604.3.5 (KHTML, like Gecko) Mobile/15B202 '
               'NETGEAR/v1 (iOS Vuezone)'}
2021-11-29 17:12:59,058 - urllib3.connectionpool - DEBUG - https://ocapi-app.arlo.com:443 "GET /api/getFactors?data%20=%201638202378 HTTP/1.1" 200 None
2021-11-29 17:12:59,060 - pyaarlo - DEBUG - request-end=200
2021-11-29 17:12:59,060 - pyaarlo - DEBUG - request-body=
{'data': {'MFA_State': 'ENABLED',
          '_type': '_Collection',
          'items': [{'_type': 'SecondFactor',
                     'applicationId': '54aa099e-366f-47b5-939a-bff713e1bd96',
                     'applicationName': 'Generic',
                     'displayName': '[email protected]',
                     'factorId': 'UGluZ0lkU0RLOkVNQUlMOjFkYTkyZjQ1LTEyNjAtYjFlYy0xZGE5LTJmNDUxMjYwYjFlYzo1NGFhMDk5ZS0zNjZmLTQ3YjUtOTM5YS1iZmY3MTNlMWJkOTY=',
                     'factorNickname': '[email protected]',
                     'factorRole': 'PRIMARY',
                     'factorType': 'EMAIL'},
                    {'_type': 'SecondFactor',
                     'applicationId': '54aa099e-366f-47b5-939a-bff713e1bd96',
                     'applicationName': 'Generic',
                     'displayName': '[email protected]',
                     'factorId': 'UGluZ0lkU0RLOkVNQUlMOjc3Y2FhMDI3LWU1Y2EtNGM0NC03N2NhLWEwMjdlNWNhNGM0NDo1NGFhMDk5ZS0zNjZmLTQ3YjUtOTM5YS1iZmY3MTNlMWJkOTY=',
                     'factorNickname': '[email protected]',
                     'factorRole': 'SECONDARY',
                     'factorType': 'EMAIL'}]},
 'meta': {'code': 200}}
2021-11-29 17:12:59,061 - pyaarlo - DEBUG - looking for email
2021-11-29 17:12:59,061 - pyaarlo - DEBUG - 2fa-imap: starting
2021-11-29 17:12:59,613 - pyaarlo - DEBUG - old-ids=[b'']
2021-11-29 17:12:59,613 - pyaarlo - DEBUG - starting auth with email
2021-11-29 17:12:59,614 - pyaarlo - DEBUG - request-url=https://ocapi-app.arlo.com/api/startAuth
2021-11-29 17:12:59,614 - pyaarlo - DEBUG - request-params=
{'factorId': 'UGluZ0lkU0RLOkVNQUlMOjc3Y2FhMDI3LWU1Y2EtNGM0NC03N2NhLWEwMjdlNWNhNGM0NDo1NGFhMDk5ZS0zNjZmLTQ3YjUtOTM5YS1iZmY3MTNlMWJkOTY='}
2021-11-29 17:12:59,615 - pyaarlo - DEBUG - request-headers=
{'Accept': 'application/json, text/plain, */*',
 'Accept-Language': 'en-US,en;q=0.9',
 'Authorization': 'Ml9vUEhnbEF2WldRd3dpZnZfYWJBb3JCZ1lkZWtSUjIyWlU0dEg1X3NJTUhvREFLcG9MWnFaUWEwOWg5UVEzWWZEQ1B1Q3F5VEIybGtSNTM5bXc3SEZtX2dZVEpvVmVBZmZCb0s5WFRvMmdyaGhCWWlmYUVPRnhpQTRrbDNfd3o5akF3czBrRkd5bVlIWE9XaVN0cC1LOTZZcHhaVUp0bEtVU2RYQWFBZF8wcXR3enZlcEd6eVFYZEphSjBYdlp1R2xnUjZ3TFBDN0p3UEY4dl9WcDBoaDBOeTVlcHZoQUxva3luMzFVcG9lLTFVZ3AxQng4NXpnZ1dFQ2l2bGRzRElKNWdjQmxyamtJZDRmdFV5RkJKdzVjYVc5ZmI1QTB5cTZnNkt3TTlReVZxRHFscHJEcDA4eDJkOWtnRll2RVpDbEdmbFJsRXdwR2J3S0ExRzIxU2NFT1pF',
 'Origin': 'https://my.arlo.com',
 'Referer': 'https://my.arlo.com/',
 'Source': 'arloCamWeb',
 'User-Agent': 'Mozilla/5.0 (iPhone; CPU iPhone OS 11_1_2 like Mac OS X) '
               'AppleWebKit/604.3.5 (KHTML, like Gecko) Mobile/15B202 '
               'NETGEAR/v1 (iOS Vuezone)'}
2021-11-29 17:13:00,201 - urllib3.connectionpool - DEBUG - https://ocapi-app.arlo.com:443 "POST /api/startAuth HTTP/1.1" 200 None
2021-11-29 17:13:00,203 - pyaarlo - DEBUG - request-end=200
2021-11-29 17:13:00,204 - pyaarlo - DEBUG - request-body=
{'data': {'MFA_State': 'ENABLED',
          '_type': 'FactorAuthCode',
          'factorAuthCode': 'UGluZ0lkU0RLOkVNQUlMOndlYnNfMGM1ZWQ4MWUtZjZkMC00ZTExLThjNTUtYWE4NmY1NjlhMjRjOjU0YWEwOTllLTM2NmYtNDdiNS05MzlhLWJmZjcxM2UxYmQ5Ng=='},
 'meta': {'code': 200}}
2021-11-29 17:13:00,205 - pyaarlo - DEBUG - 2fa-imap: checking
2021-11-29 17:13:03,240 - pyaarlo - DEBUG - 2fa-imap: new-ids=[b'']
2021-11-29 17:13:03,241 - pyaarlo - DEBUG - 2fa-imap: no change in emails
2021-11-29 17:13:06,272 - pyaarlo - DEBUG - 2fa-imap: new-ids=[b'']
2021-11-29 17:13:06,273 - pyaarlo - DEBUG - 2fa-imap: no change in emails
2021-11-29 17:13:09,313 - pyaarlo - DEBUG - 2fa-imap: new-ids=[b'']
2021-11-29 17:13:09,313 - pyaarlo - DEBUG - 2fa-imap: no change in emails
2021-11-29 17:13:12,344 - pyaarlo - DEBUG - 2fa-imap: new-ids=[b'']
2021-11-29 17:13:12,344 - pyaarlo - DEBUG - 2fa-imap: no change in emails
2021-11-29 17:13:15,369 - pyaarlo - DEBUG - 2fa-imap: new-ids=[b'']
2021-11-29 17:13:15,369 - pyaarlo - DEBUG - 2fa-imap: no change in emails
2021-11-29 17:13:18,404 - pyaarlo - DEBUG - 2fa-imap: new-ids=[b'']
2021-11-29 17:13:18,405 - pyaarlo - DEBUG - 2fa-imap: no change in emails
2021-11-29 17:13:21,437 - pyaarlo - DEBUG - 2fa-imap: new-ids=[b'']
2021-11-29 17:13:21,438 - pyaarlo - DEBUG - 2fa-imap: no change in emails
2021-11-29 17:13:24,471 - pyaarlo - DEBUG - 2fa-imap: new-ids=[b'']
2021-11-29 17:13:24,473 - pyaarlo - DEBUG - 2fa-imap: no change in emails
2021-11-29 17:13:27,514 - pyaarlo - DEBUG - 2fa-imap: new-ids=[b'']
2021-11-29 17:13:27,515 - pyaarlo - DEBUG - 2fa-imap: no change in emails
2021-11-29 17:13:30,555 - pyaarlo - DEBUG - 2fa-imap: new-ids=[b'']
2021-11-29 17:13:30,556 - pyaarlo - DEBUG - 2fa-imap: no change in emails
2021-11-29 17:13:33,589 - pyaarlo - DEBUG - 2fa-imap: new-ids=[b'']
2021-11-29 17:13:33,591 - pyaarlo - DEBUG - 2fa-imap: no change in emails
2021-11-29 17:13:36,630 - pyaarlo - DEBUG - 2fa-imap: new-ids=[b'']
2021-11-29 17:13:36,630 - pyaarlo - DEBUG - 2fa-imap: no change in emails
2021-11-29 17:13:39,670 - pyaarlo - DEBUG - 2fa-imap: new-ids=[b'']
2021-11-29 17:13:39,671 - pyaarlo - DEBUG - 2fa-imap: no change in emails
2021-11-29 17:13:42,702 - pyaarlo - DEBUG - 2fa-imap: new-ids=[b'']
2021-11-29 17:13:42,702 - pyaarlo - DEBUG - 2fa-imap: no change in emails
2021-11-29 17:13:45,741 - pyaarlo - DEBUG - 2fa-imap: new-ids=[b'']
2021-11-29 17:13:45,745 - pyaarlo - DEBUG - 2fa-imap: no change in emails
2021-11-29 17:13:48,782 - pyaarlo - DEBUG - 2fa-imap: new-ids=[b'']
2021-11-29 17:13:48,783 - pyaarlo - DEBUG - 2fa-imap: no change in emails
2021-11-29 17:13:51,811 - pyaarlo - DEBUG - 2fa-imap: new-ids=[b'']
2021-11-29 17:13:51,811 - pyaarlo - DEBUG - 2fa-imap: no change in emails
2021-11-29 17:13:54,848 - pyaarlo - DEBUG - 2fa-imap: new-ids=[b'']
2021-11-29 17:13:54,849 - pyaarlo - DEBUG - 2fa-imap: no change in emails
2021-11-29 17:13:57,889 - pyaarlo - DEBUG - 2fa-imap: new-ids=[b'']
2021-11-29 17:13:57,890 - pyaarlo - DEBUG - 2fa-imap: no change in emails
2021-11-29 17:14:00,900 - pyaarlo - ERROR - 2fa core retrieval failed
2021-11-29 17:14:00,901 - pyaarlo - DEBUG - failed to log in
2021-11-29 17:14:00,902 - pyaarlo - DEBUG - not starting downloader

Errors setting mode

Hi, after using pyaarlo for months with f2f auth factor, today I'm receiving the folloging errors; please, can you help me?

attempt 1: error in response when setting mode=
{'5TM19875A0505': {'activeModes': ['mode2'],
'activeSchedules': [],
'timestamp': 1617524232006},
'resource': 'activeAutomations'}
attempt 2: error in response when setting mode=
{'5TM19875A0505': {'activeModes': ['mode2'],
'activeSchedules': [],
'timestamp': 1617524232372},
'resource': 'activeAutomations'}
attempt 3: error in response when setting mode=
{'5TM19875A0505': {'activeModes': ['mode2'],
'activeSchedules': [],
'timestamp': 1617524232739},
'resource': 'activeAutomations'}
Failed to set mode.
<RequestsCookieJar[Cookie(version=0, name='__cf_bm', value='6ec025c7b7a8c59de0fea11bd208a23bc2d0a191-1617524227-1800-Af/EyA3ESNdRQXzfDxPGXxSvGSUAX4TJUNH644tPi9ZKs0PkWys/fKjkIlf+1dSQQq4DCaN47Z4EXq68v3L31Os=', port=None, port_specified=False, domain='.my.arlo.com', domain_specified=True, domain_initial_dot=True, path='/', path_specified=True, secure=True, expires=1617526027, discard=False, comment=None, comment_url=None, rest={'HttpOnly': None, 'SameSite': 'None'}, rfc2109=False), Cookie(version=0, name='__cfduid', value='dcecc85ae213b6fb19e218c714e703ce71617524226', port=None, port_specified=False, domain='.my.arlo.com', domain_specified=True, domain_initial_dot=True, path='/', path_specified=True, secure=False, expires=1620116226, discard=False, comment=None, comment_url=None, rest={'HttpOnly': None, 'SameSite': 'Lax'}, rfc2109=False), Cookie(version=0, name='__cf_bm', value='4d1cd19308901f0db90cc970ae9dca002a509e06-1617524220-1800-AWQ7oxMzxjXQEKKLd/6f0Nt2LlhYGqowvsU5znzNVTd++hNtoklIPcsndUfrJH7dTeuP/cFdDY43fLh9U75vQ4M=', port=None, port_specified=False, domain='.ocapi-app.arlo.com', domain_specified=True, domain_initial_dot=True, path='/', path_specified=True, secure=True, expires=1617526020, discard=False, comment=None, comment_url=None, rest={'HttpOnly': None, 'SameSite': 'None'}, rfc2109=False), Cookie(version=0, name='__cfduid', value='db7d33c088f03d9e9b64c06e5ffc9bc851617524220', port=None, port_specified=False, domain='.ocapi-app.arlo.com', domain_specified=True, domain_initial_dot=True, path='/', path_specified=True, secure=False, expires=1620116220, discard=False, comment=None, comment_url=None, rest={'HttpOnly': None, 'SameSite': 'Lax'}, rfc2109=False), Cookie(version=0, name='__cfruid', value='cee8df3393ac287b91410a24dfab0fcc16529442-1617524220', port=None, port_specified=False, domain='.ocapi-app.arlo.com', domain_specified=True, domain_initial_dot=True, path='/', path_specified=True, secure=True, expires=None, discard=True, comment=None, comment_url=None, rest={'HttpOnly': None, 'SameSite': 'None'}, rfc2109=False), Cookie(version=0, name='AWSELB', value='330F99231E37B937A721F0469577534959D6D111401934891449A57D3E0F17FABAB0D0AFD66ECC9BBA31D213EAACCB4BC245845EEF9A52C14523998B674A56EADB8B2C77FDDF7E239DEC08B1A41B943F93EBC50C5B', port=None, port_specified=False, domain='my.arlo.com', domain_specified=False, domain_initial_dot=False, path='/hmsweb/', path_specified=True, secure=True, expires=None, discard=True, comment=None, comment_url=None, rest={'HTTPONLY': None}, rfc2109=False), Cookie(version=0, name='JSESSIONID', value='AAD883799E183651DBD694BC99B607D4', port=None, port_specified=False, domain='my.arlo.com', domain_specified=False, domain_initial_dot=False, path='/hmsweb/', path_specified=True, secure=True, expires=None, discard=True, comment=None, comment_url=None, rest={'HttpOnly': None}, rfc2109=False)]>

Unable to read mode, try forcing v2

Hey twrecked,
Greetings from France.

Thanks a lot for the great work you have done with the library.
I have been using it for about 6 months now and had only very few issues.

Except recently. There has been some issues from my network provider and all the Arlo Go cameras where offline.
It is now fine on the official Arlo app, however with Pyaarlo, I keep receiving this message :
unable to read mode, try forcing v2.
I have tried several parameters including synchronous_mode=True, but the error keeps showing and even though it sometimes connect, the get_snapshot returns cached images.

Do you have any idea how I can fix this ?
Thanks a lot.
Nicolas

2nd Instance / Session possible?

Hi,

iam running a kind of monitoring script with noisealarm for our arlo baby cam.
This script is running in the background the whole night.

Is it possible to run a second script e.g. to stop the music in the same time?

I tried a second login with the same account / imap auth etc. and of course it didnt work, because....

''logged out? did you log in from elsewhere?
unable to read mode, try forcing v2''

Is there a way to use the active session in another script?
Or is a second arlo account neccessary for this?

Thanks in advance & BR,

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.