jeffreydwalter / arlo Goto Github PK
View Code? Open in Web Editor NEWPython module for interacting with Netgear's Arlo camera system.
License: Apache License 2.0
Python module for interacting with Netgear's Arlo camera system.
License: Apache License 2.0
I only own the first generation Arlo cameras and basestation. It would be useful to have all of the camera and basestation schemas documented so we can keep up with new hardware additions.
If you have Arlo hardware that has not yet been documented and add it to the Wiki, it would be GREATLY appreciated!
Hi,
I've getting the error
EOF occurred in violation of protocol (_ssl.c:590) or sometimes ('Connection aborted.', error(54, 'Connection reset by peer'))
Any ideas?
Thanks!
Several models of Arlo cameras support push-to-talk:
https://kb.arlo.com/1004319/What-is-the-push-to-talk-feature-on-my-Arlo-camera-and-how-does-it-work
I would like to extend this python library to be able to send audio to my camera and have it play from the camera's speakers.
The Arlo UI allows you to take fullscreen snapshots, which typically have better resolution than the smaller ones.
Hi, I am using python 2.7 on OSX and was able to view live stream via ffplay up until recently using the following code and running it in terminal or Home assistant, not sure when it stopped working as only purchased new batteries yesterday!
I get the following error in terminal when trying to call this function. I have also tried subscribing to basestation as per examples but it worked for me without before it stopped working so pasting the code without subscribe.
'EventStream' object has no attribute 'event_stream_thread'
Any help greatly appreciated.
arlo = Arlo(USERNAME, PASSWORD)
cameras = arlo.GetDevices('camera')
basestations = arlo.GetDevices('basestation')
url = arlo.StartStream(cameras[0])
p = Popen(['ffplay', '-i', url, '-format', 'h264', '-x', '360', '-y', '210', '-noborder'])
return True;
python -V
)? 2.7.12python -c 'import platform; print(platform.uname());'
)?('Linux', 'MediaServer', '4.11.5-041105-generic', '#201706141137 SMP Wed Jun 14 15:39:07 UTC 2017', 'x86_64', 'x86_64')
Basic Arlo
cloned
installed dependencies
/opt/arlo$ sudo python setup.py install
running install
running bdist_egg
running egg_info
writing requirements to pyarlo.egg-info/requires.txt
writing pyarlo.egg-info/PKG-INFO
writing top-level names to pyarlo.egg-info/top_level.txt
writing dependency_links to pyarlo.egg-info/dependency_links.txt
error: package directory 'pyarlo' does not exist
Not sure what I am doing wrong?
Hi Jeffrey,
I feel there is a bug in the exmple of downloading video that is shown in the Readme.md.
"f.buffer.write(chunk)" might be "f.write(chunk)" since the former one gives the error 'file' object has no attribute 'buffer' while the latter works well.
Thanks.
Ray
Hi Jeffrey,
I'm looking for an api for my Arlo Q Plus, I've tried a little your library but, if I don't missing something, I'm able to list my camera but not to arm it (Arlo Q Plus works without a base).
Am I doing something wrong or Arlo Q Plus will be supported in future?
Thanks in advance and keep up the good work,
imopen
Why is the StartRecording method limited to 31 seconds of recording time?
What is the approach to stream over web the video once I have a streaming URL like:
rtmps://vzwow72-z2-prod.vz.netgear.com:80/vzmodulelive?egressToken=b723a7bb_abbXX&userAgent=web&cameraId=48AAAAA
Does it require flash to be installed in the browser?
Great work. I see in the examples you can arm and disarm. Have you found a way to set a custom mode?
Thanks
Please answer these questions before submitting your issue. Thanks!
python -V
)?python -c 'import platform; print(platform.uname());'
)?pip freeze
or pip3 freeze
command and paste output)?If possible, provide the steps you took to reproduce the issue.
A complete runnable program is good. (don't include your user/password or any sensitive info)
Hi, I follow the downloading sample and I was able to get only one camera recording download for the day... I have currently setup 2 camera, how can I download both devices video?
python 2.7
osx 10.12.6
altgraph==0.10.2
arlo==1.0.0
bdist-mpkg==0.5.0
bonjour-py==0.3
certifi==2017.11.5
chardet==3.0.4
idna==2.6
libpurecoollink==0.4.2
macholib==1.5.1
matplotlib==1.3.1
modulegraph==0.10.4
monotonic==1.4
ndg-httpsclient==0.4.3
netifaces==0.10.6
numpy==1.8.0rc1
paho-mqtt==1.3.0
py2app==0.7.3
pyasn1==0.4.2
pycryptodome==3.4.6
pyharmony==1.0.18
pyobjc-core==2.5.1
pyobjc-framework-Accounts==2.5.1
pyobjc-framework-AddressBook==2.5.1
pyobjc-framework-AppleScriptKit==2.5.1
pyobjc-framework-AppleScriptObjC==2.5.1
pyobjc-framework-Automator==2.5.1
pyobjc-framework-CFNetwork==2.5.1
pyobjc-framework-Cocoa==2.5.1
pyobjc-framework-Collaboration==2.5.1
pyobjc-framework-CoreData==2.5.1
pyobjc-framework-CoreLocation==2.5.1
pyobjc-framework-CoreText==2.5.1
pyobjc-framework-DictionaryServices==2.5.1
pyobjc-framework-EventKit==2.5.1
pyobjc-framework-ExceptionHandling==2.5.1
pyobjc-framework-FSEvents==2.5.1
pyobjc-framework-InputMethodKit==2.5.1
pyobjc-framework-InstallerPlugins==2.5.1
pyobjc-framework-InstantMessage==2.5.1
pyobjc-framework-LatentSemanticMapping==2.5.1
pyobjc-framework-LaunchServices==2.5.1
pyobjc-framework-Message==2.5.1
pyobjc-framework-OpenDirectory==2.5.1
pyobjc-framework-PreferencePanes==2.5.1
pyobjc-framework-PubSub==2.5.1
pyobjc-framework-QTKit==2.5.1
pyobjc-framework-Quartz==2.5.1
pyobjc-framework-ScreenSaver==2.5.1
pyobjc-framework-ScriptingBridge==2.5.1
pyobjc-framework-SearchKit==2.5.1
pyobjc-framework-ServiceManagement==2.5.1
pyobjc-framework-Social==2.5.1
pyobjc-framework-SyncServices==2.5.1
pyobjc-framework-SystemConfiguration==2.5.1
pyobjc-framework-WebKit==2.5.1
pyOpenSSL==0.13.1
pyparsing==2.0.1
PySocks==1.6.8
python-dateutil==1.5
pytz==2013.7
requests==2.18.4
scipy==0.13.0b1
six==1.4.1
sleekxmpp==1.3.3
sseclient==0.0.18
sseclient-py==1.7
urllib3==1.22
xattr==0.6.4
zope.interface==4.1.1
Arlo Cameras and base (Not pro)
I create a basic python file importing arlo and creating an Arlo object with my username and password and run the python file in terminal using sudo bash myscript.py
I hope to see the availablity of information about my arlo setup
Exception - ('Connection aborted.', error(54, 'Connection reset by peer'))
Using latest version of Arlo using pip install Arlo
import sseclient
ImportError: No module named sseclient
Where do i get it from?
Python 2.7.10
('Darwin', Brads-MacBook-Pro.local', '16.7.0', 'Darwin Kernel Version 16.7.0: Thu Jun 15 17:36:27 PDT 2017; root:xnu-3789.70.16~2/RELEASE_X86_64', 'x86_64', 'i386')
altgraph==0.10.2
arlo==1.0.9
asn1crypto==0.24.0
bdist-mpkg==0.5.0
bonjour-py==0.3
certifi==2017.11.5
cffi==1.11.2
chardet==3.0.4
cryptography==2.1.4
enum34==1.1.6
idna==2.6
ipaddress==1.0.19
libpurecoollink==0.4.2
macholib==1.5.1
matplotlib==1.3.1
modulegraph==0.10.4
monotonic==1.4
ndg-httpsclient==0.4.3
netifaces==0.10.6
numpy==1.8.0rc1
paho-mqtt==1.3.0
py2app==0.7.3
pyarlo==0.1.2
pyasn1==0.4.2
pycparser==2.18
pycryptodome==3.4.6
pyharmony==1.0.18
pyobjc-core==2.5.1
pyobjc-framework-Accounts==2.5.1
pyobjc-framework-AddressBook==2.5.1
pyobjc-framework-AppleScriptKit==2.5.1
pyobjc-framework-AppleScriptObjC==2.5.1
pyobjc-framework-Automator==2.5.1
pyobjc-framework-CFNetwork==2.5.1
pyobjc-framework-Cocoa==2.5.1
pyobjc-framework-Collaboration==2.5.1
pyobjc-framework-CoreData==2.5.1
pyobjc-framework-CoreLocation==2.5.1
pyobjc-framework-CoreText==2.5.1
pyobjc-framework-DictionaryServices==2.5.1
pyobjc-framework-EventKit==2.5.1
pyobjc-framework-ExceptionHandling==2.5.1
pyobjc-framework-FSEvents==2.5.1
pyobjc-framework-InputMethodKit==2.5.1
pyobjc-framework-InstallerPlugins==2.5.1
pyobjc-framework-InstantMessage==2.5.1
pyobjc-framework-LatentSemanticMapping==2.5.1
pyobjc-framework-LaunchServices==2.5.1
pyobjc-framework-Message==2.5.1
pyobjc-framework-OpenDirectory==2.5.1
pyobjc-framework-PreferencePanes==2.5.1
pyobjc-framework-PubSub==2.5.1
pyobjc-framework-QTKit==2.5.1
pyobjc-framework-Quartz==2.5.1
pyobjc-framework-ScreenSaver==2.5.1
pyobjc-framework-ScriptingBridge==2.5.1
pyobjc-framework-SearchKit==2.5.1
pyobjc-framework-ServiceManagement==2.5.1
pyobjc-framework-Social==2.5.1
pyobjc-framework-SyncServices==2.5.1
pyobjc-framework-SystemConfiguration==2.5.1
pyobjc-framework-WebKit==2.5.1
pyOpenSSL==17.5.0
pyparsing==2.0.1
PySocks==1.6.8
python-dateutil==1.5
pytz==2013.7
requests==2.18.4
scipy==0.13.0b1
six==1.11.0
sleekxmpp==1.3.3
sseclient==0.0.18
sseclient-py==1.7
urllib3==1.22
xattr==0.6.4
zope.interface==4.1.1
Arlo original (not pro) cameras and basestation
After getting live streaming working using this arlo library and ffplay using terminal a few months ago it has now stopped working so after going back to calling the python script and testing in Terminal on OSX I get the following errors when calling arlo.StartStream(cameras[2]) - TypeError: StartStream() takes exactly 3 arguments (2 given) - so after looking at the src code of arlo.py I initalize basestations this time and change to arlo.StartStream(basestations[0], cameras[2]) but this time I get error 'EventStream' object has no attribute 'event_stream_thread' for line 85 of arlo.py when calling StartStream. note: I am testing camera 2 because cam 0 and 1 are not currently in use. I can't seem to get past StartStream anymore.
def test_method():
arlo = Arlo(USERNAME, PASSWORD)
cameras = arlo.GetDevices('camera')
basestations = arlo.GetDevices('basestation')
url = arlo.StartStream(basestations[0], cameras[2])
self.p = Popen(['ffplay', '-i', url, '-format', 'h264', '-x', '360', '-y', '210', '-noborder'])
I hoped to see live streaming of my Arlo Camera in a ffplay window.
Errors are seen instead in the terminal window described above.
I have installed the latest version by calling pip install arlo
Any help appreciated.
Further trace output is below in case it helps..
File "./hello_world.py", line 17, in test_method
url = arlo.StartStream(basestations[0], cameras[2])
File "/Library/Python/2.7/site-packages/Arlo.py", line 765, in StartStream
return self.TriggerAndHandleEvent(basestation, trigger, callback)
File "/Library/Python/2.7/site-packages/Arlo.py", line 445, in TriggerAndHandleEvent
self.Subscribe(basestation)
File "/Library/Python/2.7/site-packages/Arlo.py", line 299, in Subscribe
self.event_streams[basestation_id].Start()
File "/Library/Python/2.7/site-packages/Arlo.py", line 85, in Start
self.event_stream_thread.start()
The current version of Arlo.py has a misspelling in line 814 (baststation instead of basestation):
stream_url = self.StartStream(baststation, camera)
Not an issue per say, but in the read.md I see how you are downloading and deleting videos on their 7th day. But I couldn't see where you are downloading it to, where is that and how do I specify it. Thanks
Hi Jeff,
I came across your repo for arlo. Good stuff! I just purchased one of these systems (a big aspect of the decision was that it looked like there was a project out there that someone was hacking with) I was wondering if you knew how to subscribe to motion detection events or if that was possible. If you could point me in the right direction, I would gladly contribute anything I came up with to your repo.
Cheers mate,
JS
HI Jeffrey,
Thank you for sharing your elegant code. I have a question concerning the method StartStreaming as I am willing to integrate the live streaming of the cam with OpenCV for object detection. I get the exception of requests.exceptions.HTTPError: 400 Client Error: Bad Request for url: https://arlo.netgear.com/hmsweb/users/devices/startStream. Do you have any idea about this? Also, as I see, the StartStreaming method return a generator. I am wondering if there is a way to return a frame Mat.
Thanks!
The following is part of my script:
body = {
"to":device_id,
"from":"300-XXXXXXXX_web",
"resource":"cameras/"+device_id,
"action":"set",
"publishResponse":"true",
"transId":transId,
"properties":{
"activityState":"startPositionStream"
}
}
stream = arlo.StartStream(body)
print(type(stream))
with open('name'+'.mp4', 'w') as f:
for chunk in stream:
f.write(chunk)
f.close()
Please answer these questions before submitting your issue. Thanks!
python -V
)?2.7.13
python -c 'import platform; print(platform.uname());'
)?('Linux', 'openhab', '4.9.59-v7+', '#1047 SMP Sun Oct 29 12:19:23 GMT 2017', 'armv7l', '')
pip freeze
or pip3 freeze
command and paste output)?certifi==2017.11.5
chardet==3.0.4
cryptography==1.7.1
dnspython==1.15.0
enum34==1.1.6
idna==2.6
ipaddress==1.0.17
keyring==10.1
keyrings.alt==1.3
monotonic==1.4
pyasn1==0.1.9
pycrypto==2.6.1
pygobject==3.22.0
pyxdg==0.25
requests==2.18.4
RPi.GPIO==0.6.3
SecretStorage==2.3.1
six==1.10.0
sseclient==0.0.18
urllib3==1.22
Arlo Basestation VMB3010r2
3 Cameras H7
Disarm and/or Arm basestation
If possible, provide the steps you took to reproduce the issue.
A complete runnable program is good. (don't include your user/password or any sensitive info)
`
#!/usr/bin/env python
from Arlo import Arlo
USERNAME = 'xxx'
PASSWORD = 'xxx'
try:
arlo = Arlo(USERNAME, PASSWORD)
basestations = arlo.GetDevices('basestation')
# Disarm Arlo.
arlo.Disarm(basestations[0])
arlo.Logout()
except Exception as e:
print(e)
`
That the script completes. Now it just stop.
Sometimes it works though, but with no changes from me.
Nothing, the script just stop
Yes
Hi - have you been experimenting with turning the siren in the pro base on and off?
I would like to be able to integrate the siren into my home automation system.
Would be nice to have automated tests so we know the API is performing.
Hi Jeffrey,
Thanks for your elegant code but I do have a question about the message that needs to be passed for live streaming. In your script for method StartStream, you mentioned that a message like the following needs to be sent. Can I ask what the [to], [from], [resource], [transId] should be?
Thanks!
#
# To initiate a stream pass the following:
#{
# "to":"XXXXXXXXXXXXX",
# "from":"XXX-XXXXXXX_web",
# "resource":"cameras/XXXXXXXXXXXXX",
# "action":"set",
# "publishResponse":true,
# "transId":"web!XXXXXXXX.XXXXXXXXXXXXXXXXXXXX",
# "properties":{
# "activityState":"startPositionStream"
# }
#}
Hi Jeffrey,
I obtain an exception calling a Logout():
[...]
File "/root/arlo_autoarm/Arlo.py", line 245, in Logout
self.Unsubscribe(basestation_id)
File "/root/arlo_autoarm/Arlo.py", line 315, in Unsubscribe
basestation_id = basestation.get('deviceId')
AttributeError: 'unicode' object has no attribute 'get'
I've fixed it casting the Unsubscribe to a str()
def Logout(self):
event_streams = self.event_streams.copy()
print("event_streams.keys():")
print(event_streams.keys())
for basestation_id in event_streams.keys():
self.Unsubscribe(str(basestation_id))
return self.request.put('https://arlo.netgear.com/hmsweb/logout')
It seems to work but I've used only a piece of intuit, so please double check it.
Thank you,
imopen
Please answer these questions before submitting your issue. Thanks!
python -V
)?Python 3.6.3 :: Anaconda custom (64-bit)
python -c 'import platform; print(platform.uname());'
)?uname_result(system='Darwin', node='XXX', release='17.3.0', version='Darwin Kernel Version 17.3.0: Thu Nov 9 18:09:22 PST 2017; root:xnu-4570.31.3~1/RELEASE_X86_64', machine='x86_64', processor='i386')
pip freeze
or pip3 freeze
command and paste output)?chardet==3.0.4
click==6.7
Django==1.11.7
enum34==1.1.6
Flask==0.12.2
html5lib==0.9999999
idna==2.6
itsdangerous==0.24
Jinja2==2.10
Markdown==2.6.10
MarkupSafe==1.0
monotonic==1.4
nose==1.3.7
numpy==1.13.3
protobuf==3.5.0.post1
pytz==2017.3
requests==2.18.4
six==1.11.0
sseclient==0.0.18
tensorflow==1.4.1
tensorflow-tensorboard==0.4.0rc3
urllib3==1.22
Werkzeug==0.13
H6
import Arlo
UID='XXX'
PWD='XXX'
try:
arlo = Arlo.Arlo(UID,PWD)
print('Logged In')
cameras = arlo.GetDevices('camera')
firstCamera = cameras[0]
print('got camera')
cameraProperties = arlo.GetCameraState(firstCamera)['properties']
print('got properties')
batteryLevel = cameraProperties[0]['batteryLevel']
print('Battery Level: %d' % batteryLevel)
arlo.Logout()
print('Logged Out')
except Exception as e:
print(e)
Logged In
got camera
got properties
Battery Level: 66
Logged Out
Process finished with exit code 0
/Users/jim/anaconda3/bin/python /Users/jim/xxx/bugdemo.py
Logged In
got camera
got properties
Battery Level: 66
Logged Out
Process finished with exit code 0
/Users/jim/anaconda3/bin/python "/Applications/Development/PyCharm CE.app/Contents/helpers/pydev/pydevd.py" --multiproc --qt-support=auto --client 127.0.0.1 --port 58784 --file /Users/jim/xxx/bugdemo.py
pydev debugger: process 83482 is connecting
Connected to pydev debugger (build 173.4127.16)
Logged In
got camera
got properties
Battery Level: 66
Logged Out
Process finished with exit code 0
/Users/jim/anaconda3/bin/python /Users/jim/xxx/bugdemo.py
Logged In
got camera
<program hangs>
at Arlo.py line 273 in Arlo.Subscribe
while not self.event_streams[basestation_id].connected:
time.sleep(1)
condition is never satisfied.
yes
Would be nice to be standards complaint.
Hi,
I've followed your install instructions, but it won't install on my pi, latest raspbian. Below is the error I get, from make. Any help much appreciated.
Thanks
pip install -r requirements.txt
Requirement already satisfied (use --upgrade to upgrade): requests in /usr/lib/python2.7/dist-packages (from -r requirements.txt (line 1))
Requirement already satisfied (use --upgrade to upgrade): sseclient in /usr/local/lib/python2.7/dist-packages (from -r requirements.txt (line 2))
Requirement already satisfied (use --upgrade to upgrade): monotonic in /usr/local/lib/python2.7/dist-packages (from -r requirements.txt (line 3))
Requirement already satisfied (use --upgrade to upgrade): six in /usr/lib/python2.7/dist-packages (from sseclient->-r requirements.txt (line 2))
Cleaning up...
test:
make: test:: Command not found
Makefile:2: recipe for target 'init' failed
make: *** [init] Error 127
I sporadically get issues with arming/disarming Arlo with the simple script below.
The script runs in an endless loop during the Subscribe function.
Normaly i am calling the script over a apache-webserver, but this doesnt matter, because the script
also fails from cmd.
Maybe this is realted to my python-env or is there anybody that can reproduce this error?
Any suggestions?
Error:
./turn_off.py
^CTraceback (most recent call last):
File "./turn_off.py", line 11, in
arlo.Disarm(basestation[0]['deviceId'], basestation[0]['xCloudId'])
File "/var/www/htdocs/netgear/arlo/Arlo.py", line 301, in Disarm
return self.NotifyAndGetResponse(device_id, xcloud_id, {"action":"set","resource":"modes","publishResponse":"true","properties":{"active":"mode0"}})
File "/var/www/htdocs/netgear/arlo/Arlo.py", line 274, in NotifyAndGetResponse
self.Subscribe(device_id, xcloud_id)
File "/var/www/htdocs/netgear/arlo/Arlo.py", line 213, in Subscribe
time.sleep(1)
KeyboardInterrupt
Script:
#!/usr/bin/env python
from datetime import timedelta, date
from Arlo import Arlo
USERNAME = 'XXXXXX'
PASSWORD = 'XXXXXX'
try:
arlo = Arlo(USERNAME, PASSWORD)
basestation = [ device for device in arlo.GetDevices() if device['deviceType'] == 'basestation' ]
arlo.Disarm(basestation[0]['deviceId'], basestation[0]['xCloudId'])
print "Content-type: text/html\n\n";
except Exception as e:
print e
Python-Version:
Python 2.7.13 (default, Jan 19 2017, 14:48:08)
[GCC 6.3.0 20170118] on linux2
Type "help", "copyright", "credits" or "license" for more information.
platform : Windows
Arlo hardware info : Arlo Pro with Pro Basestation
Please include your code (don't include your user/password or any sensitive info)
from Arlo import Arlo
USERNAME = '[email protected]'
PASSWORD = 'mypassword'
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)
# At this point you're logged into Arlo.
# Get the list of devices and filter on device type to only get the cameras.
# This will return an array of cameras, including all of the cameras' associated metadata.
cameras = arlo.GetDevices('camera')
basestation = arlo.GetDevices('basestation')
# Turn camera off.
print(arlo.ToggleCamera(basestation[0], cameras[0]['deviceId'], False))
# Turn camera on.
#print(arlo.ToggleCamera(cameras[0], False))
except Exception as e:
print(e)
Code output:
Python 3.6.2 (v3.6.2:5fd33b5, Jul 8 2017, 04:57:36) [MSC v.1900 64 bit (AMD64)] on win32
Type "copyright", "credits" or "license()" for more information.
======= RESTART: arlo-checkcamera.py =======
{'resource': 'cameras/XXXXXXXXXXX', 'action': 'set', 'error': {'code': 4000, 'message': 'Resource not found.'}, 'properties': {'privacyActive': False}, 'transId': 'web!8ac12345d.d77f!123456789102832', 'to': '2224XX-222-1234567_web', 'from': 'XXXXXXXXXXXXXX'}
Run the following command and include the output:
certifi==2017.11.5
chardet==3.0.4
idna==2.6
monotonic==1.4
requests==2.18.4
six==1.11.0
sseclient==0.0.18
urllib3==1.22
I have tried to toggle the camera with deviceId, deviceName, uniqueId and nothing seems to work.
Ping() calls Notify(), which sends a message to the eventstream, which in turn triggers a reply message. That message is never explicitly removed from the queue, so it gets requeued indefinitely, leading to a build up of ping replies in the queue.
Apparently you can't have issues on forks. I want to keep you in the loop on the things I'm doing to the library so that once you get the pull request it isn't overwhelming.
This is my latest commit. You can see a lot of the changes reflected there.
I have not integrated your EventStream changes yet. I want to ensure this base functionality works before continuing on to the more advanced streaming calls.
What this has all taught me is that Netgear doesn't know how to write a proper API :D
Please answer these questions before submitting your issue. Thanks!
python -V
)?2.7.10
python -c 'import platform; print(platform.uname());'
)?('Darwin', 'zzz-MacBook-Pro.local', '17.2.0', 'Darwin Kernel Version 17.2.0: Fri Sep 29 18:27:05 PDT 2017; root:xnu-4570.20.62~3/RELEASE_X86_64', 'x86_64', 'i386')
pip freeze
or pip3 freeze
)?pip freeze
Arlo Pro, VMS3530
I got the latest library code from github. I was able to build everything properly. I used the sample code and replaced with my credentials. I was trying to download my video files. I got the following error. I tried varying the dates but similar errors occurred. From the error looks like the file names formed within the sample code is not valid.
[Errno 2] No such file or directory: u'videos/2017-11-27 23-32-20 GWFVE-336-8951756_4N716A734E38D.mp4'
If possible, provide a recipe for reproducing the error.
A complete runnable program is good. (don't include your user/password or any sensitive info)
all video files are downloaded
[Errno 2] No such file or directory: u'videos/2017-11-27 23-32-20 GWFVE-336-8951756_4N716A734E38D.mp4'
Would be great to be able to install this library with pip install arlo
or whatever.
Is there a way to down load the most recent video from a specific camera?
When running Make against the repository clone I get the following message:
Collecting json (from -r requirements.txt (line 1))
Using cached json-99.0.tar.gz
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "", line 1, in
File "/tmp/pip-build-uKjNmz/json/setup.py", line 2, in
raise RuntimeError("Package 'json' must not be downloaded from pypi")
RuntimeError: Package 'json' must not be downloaded from pypi
I have been trying to track down the module but have not yet been able to if there is anyone else who has come across this issue and located the module it would be great to know.
Platform:
Ubuntu xenial - Linux pan 4.4.38-v7+ #938 SMP Thu Dec 15 15:22:21 GMT 2016 armv7l armv7l armv7l GNU/Linux
I have tried this with
Python 2.7.12 and Python 3.5.2 both version of pip can't locate the module json (well they can but get the stub which does not help identify where I can install it from. The Stubs setup.py just inclusdes "raise RuntimeError("Package 'json' must not be downloaded from pypi")"
Any help would be appreciated.
Nick
I've build an Arlo 'snapshot' AWS lambda function, but is fails intermittently.
What it does is create a TriggerFullFrameSnapshot every hour and stores it to S3. The first run always succeeds, but the next runs it (usually) fails to receive an event. I have been debugging it and it appears that the second run it returns directly here
Line 387 in 5956b1f
Apparently the class is not completely stateless? My guess is that it does work when AWs spins up a new instance of the lambda function, but doesn't when AWS reuses an instance
I have not yet been able to reproduce it locally
I will dig into this further, but If anybody has an idea what is happening let me know...
The code below fails with the message
'Invalid URL 'None': No schema supplied. Perhaps you meant http://None?'
def lambda_handler(event, context):
print('Looking up sequence number')
sequence = 0
try:
s3.Bucket(S3_BUCKET_NAME).download_file('sequence.txt', '/tmp/sequence.txt')
with open('/tmp/sequence.txt', 'r') as myfile:
data=myfile.read().replace('\n', '')
sequence = int(data)
except botocore.exceptions.ClientError as e:
if e.response['Error']['Code'] == "404":
print("Sequence file does not exist")
else:
raise
sequence = sequence + 1
print('Creating ARLO snapshot {}'.format(sequence))
try:
arlo = Arlo(USERNAME, PASSWORD)
basestations = arlo.GetDevices('basestation')
print("BASE: {}".format(basestations))
cameras = arlo.GetDevices('camera')
print("CAMERA: {}".format(cameras))
snapshot_url = arlo.TriggerFullFrameSnapshot(basestations[0], cameras[0])
tag = datetime.now().strftime('%Y-%m-%d_%H-%M-%S')
filename = 'snapshot_{}_{}.jpg'.format(tag, "{:09d}".format(sequence))
print('retrieving and storing {}'.format(filename))
arlo.DownloadSnapshot(snapshot_url, '/tmp/' + filename)
data = open('/tmp/' + filename, 'rb')
s3.Bucket(S3_BUCKET_NAME).put_object(Key=filename, Body=data)
fh = open("/tmp/sequence.txt","w")
fh.write(str(sequence))
fh.close()
data = open('/tmp/sequence.txt', 'rb')
s3.Bucket(S3_BUCKET_NAME).put_object(Key='sequence.txt', Body=data)
print('Script complete at {}'.format(str(datetime.now())))
except Exception as e:
print(e)
arlo==1.0.2 (master)
certifi==2018.1.18
chardet==3.0.4
flake8==3.5.0
idna==2.6
mccabe==0.6.1
mockredispy==2.9.3
monotonic==1.4
pew==1.1.2
pipenv==9.0.3
pycodestyle==2.3.1
pyflakes==1.6.0
PySocks==1.6.8
redis==2.10.6
requests==2.18.4
six==1.11.0
sseclient==0.0.18
urllib3==1.22
virtualenv==15.1.0
virtualenv-clone==0.2.6
Arlo Pro
BASE: [{'userId': 'Q9V4H-257-31121171', 'deviceId': '4RD37B7KA00C5', 'uniqueId': 'xxx', 'deviceType': 'basestation', 'deviceName': 'xxx', 'lastModified': 1518186051062, 'firmwareVersion': '1.9.8.0_16666', 'xCloudId': 'xxx', 'userRole': 'OWNER', 'displayOrder': 3, 'mediaObjectCount': 0, 'state': 'provisioned', 'modelId': 'VMB4000', 'dateCreated': 1517688163998, 'interfaceVersion': 'i001', 'interfaceSchemaVer': '2', 'owner': {'firstName': 'xx', 'lastName': 'xx', 'ownerId': 'xx'}, 'properties': {'modelId': 'VMB4000', 'olsonTimeZone': 'Europe/Amsterdam', 'hwVersion': 'VMB4000r3'}, 'connectivity': {'type': 'ethernet', 'connected': True}}]
CAMERA: [{'userId': 'xx', 'deviceId': 'xx', 'parentId': 'xx', 'uniqueId': 'xx', 'deviceType': 'camera', 'deviceName': 'xx', 'lastModified': 1518186051083, 'firmwareVersion': '1.092.0.8_17203', 'xCloudId': 'xx', 'lastImageUploaded': 'true', 'userRole': 'OWNER', 'displayOrder': 1, 'presignedLastImageUrl': 'https://arlolastimage-z1.s3.amazonaws.com/xxxx/xxx/xx/lastImage.jpg?AWSAccessKeyId=xx&Expires=1518272451&Signature=xx', 'presignedSnapshotUrl': 'xx', 'presignedFullFrameSnapshotUrl': 'xx', 'mediaObjectCount': 0, 'state': 'provisioned', 'modelId': 'VMC4030', 'dateCreated': 1517688285880, 'interfaceVersion': 'i002', 'interfaceSchemaVer': '2', 'owner': {'firstName': 'xx', 'lastName': 'xx', 'ownerId': 'xx'}, 'properties': {'modelId': 'VMC4030', 'olsonTimeZone': 'Europe/Amsterdam', 'hwVersion': 'H11'}}]
Please answer these questions before submitting your issue. Thanks!
python -V
)?Python 2.7.12
python -c 'import platform; print(platform.uname());'
)?('Linux', 'DrishStation', '3.2.40', '#15254 SMP PREEMPT Fri Jan 26 06:38:43 CST 2018', 'i686', '')
pip freeze
or pip3 freeze
command and paste output)?arlo==1.0.9
certifi==2018.1.18
chardet==3.0.4
idna==2.6
monotonic==1.4
nose==1.3.7
PySocks==1.6.8
requests==2.18.4
rt==1.0.10
six==1.11.0
sseclient==0.0.19
urllib3==1.22
Original Arlo
If possible, provide the steps you took to reproduce the issue.
A complete runnable program is good. (don't include your user/password or any sensitive info)
python arlo-download.py
Traceback (most recent call last):
File "arlo-download.py", line 1, in
from Arlo import Arlo
File "/usr/lib/python2.7/site-packages/Arlo.py", line 24, in
import monotonic
File "/usr/lib/python2.7/site-packages/monotonic.py", line 169, in
raise RuntimeError('no suitable implementation for this system: ' + repr(e))
RuntimeError: no suitable implementation for this system: RuntimeError('can not find library rt',)
rt is installed, so wasn't expecting it to say it's missing
Currently, there are some features of the newer Arlo devices that aren't exposed through this library yet. If you own any of those devices it would be great to have your help in figuring out which features still need to be exposed.
If you just want to request a new feature, don't comment here, please open a new issue with a request for that specific feature.
The arlo pro iphone app allows to record the live streaming. Does this API have same feature? In other words, how can I use this API to manually start the recording?
Please answer these questions before submitting your issue. Thanks!
python -V
)? python 2.7.13python -c 'import platform; print(platform.uname());'
)? Linux security 4.9.0-6-amd64 #1 SMP Debian 4.9.82-1+deb9u3 (2018-03-02) x86_64 GNU/Linuxpip freeze
or pip3 freeze
command and paste output)? arlo==1.0.8beautifulsoup4==4.5.3
chardet==2.3.0
chrome-gnome-shell==0.0.0
cryptography==1.7.1
DateTime==4.2
enum34==1.1.6
html5lib==0.999999999
idna==2.2
ipaddress==1.0.17
keyring==10.1
keyrings.alt==1.3
lxml==3.7.1
monotonic==1.4
numpy==1.12.1
pyarlo==0.1.2
pyasn1==0.1.9
pycrypto==2.6.1
pygobject==3.22.0
pyOpenSSL==16.2.0
PySocks==1.6.8
pytz==2018.3
pyxdg==0.25
requests==2.12.4
scour==0.32
SecretStorage==2.3.1
six==1.10.0
sseclient==0.0.19
sseclient-py==1.7
urllib3==1.19.1
webencodings==0.5
zope.interface==4.4.3
Base station: VMB3010r2
Cameras: Arlo hardware version: H7
400 Client Error: Bad Request for url: https://arlo.netgear.com/hmsweb/users/library/recycle
If possible, provide the steps you took to reproduce the issue.
A complete runnable program is good. (don't include your user/password or any sensitive info)
I used the following in a python script:
from Arlo import Arlo
from datetime import timedelta, date
import datetime
import sys
USERNAME = '[email protected]'
PASSWORD = 'supersecretpassword'
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)
# At this point you're logged into Arlo.
today = (date.today()-timedelta(days=0)).strftime("%Y%m%d")
seven_days_ago = (date.today()-timedelta(days=7)).strftime("%Y%m%d")
# Get all of the recordings for a date range.
library = arlo.GetLibrary(seven_days_ago, today)
# Iterate through the recordings in the library.
for recording in library:
videofilename = datetime.datetime.fromtimestamp(int(recording['name'])//1000).strftime('%Y-%m-%d %H-%M-%S') + ' ' + recording['uniqueId'] + '.mp4'
##
# The videos produced by Arlo are pretty small, even in their longest, best quality settings,
# but you should probably prefer the chunked stream (see below).
###
# # Download the whole video into memory as a single chunk.
# video = arlo.GetRecording(recording['presignedContentUrl'])
# with open('videos/'+videofilename, 'wb') as f:
# f.write(stream)
# f.close()
# Or:
#
# Get video as a chunked stream; this function returns a generator.
stream = arlo.StreamRecording(recording['presignedContentUrl'])
with open('videos/'+videofilename, 'wb') as f:
for chunk in stream:
f.write(chunk)
f.close()
print('Downloaded video '+videofilename+' from '+recording['createdDate']+'.')
# Delete all of the videos you just downloaded from the Arlo library.
# Notice that you can pass the "library" object we got back from the GetLibrary() call.
result = arlo.BatchDeleteRecordings(library)
# If we made it here without an exception, then the videos were successfully deleted.
print('Batch deletion of videos completed successfully.')
except Exception as e:
print(e)
400 Client Error: Bad Request for url: https://arlo.netgear.com/hmsweb/users/library/recycle
I've only used the latest version
python -V
)?Python 2.7.12 (also tried 3.6.4) Ubuntu (also tried Win10)
python -c 'import platform; print(platform.uname());'
)?('Linux', 'hostname', '4.10.0-38-generic', '#42~16.04.1-Ubuntu SMP Tue Oct 10 16:32:20 UTC 2017', 'x86_64', 'x86_64')
pip freeze
or pip3 freeze
command and paste output)?adium-theme-ubuntu==0.3.4
arlo==1.0.3
awscli==1.11.115
botocore==1.5.78
certifi==2018.1.18
chardet==3.0.4
colorama==0.3.7
docutils==0.13.1
futures==3.1.1
idna==2.6
jmespath==0.9.3
monotonic==1.4
pyasn1==0.2.3
pygobject==3.20.0
PySocks==1.6.8
python-dateutil==2.6.0
PyYAML==3.12
requests==2.18.4
rsa==3.4.2
s3transfer==0.1.10
six==1.11.0
sseclient==0.0.18
unity-lens-photos==1.0
urllib3==1.22
Arlo (not pro)
When trying to download a snapshot, I get the error No connection adapters were found for 'rtsps://vzwow384-z2-prod.vz.netgear.com:443/vzmodulelive/<url_redacted>'
. I was able to repro this on a Windows 10 box (both in Bash and Cmd, python 2.7 and python 3.4) as well as a straight-up Ubuntu box.
I wondered if there was a dependency I'm missing, but I googled the error and couldn't find much useful information. I didn't see anything relating to this in the repo's Wiki.
Here is the code. Note that if I remove the DownloadSnapshot() call, everything works fine.
from Arlo import Arlo
USERNAME = '[email protected]'
PASSWORD = 'supersecret'
try:
arlo = Arlo(USERNAME, PASSWORD)
cameras = arlo.GetDevices('camera')
snapshot_url = arlo.TakeSnapshot(cameras[0])
arlo.DownloadSnapshot(snapshot_url, "snapshot.jpg")
except Exception as e:
print(e)
python -V
)?Python 2.7.12
python -c 'import platform; print(platform.uname());'
)?python -c "import platform; print(platform.uname());"
('Windows', 'AK_i7', '7', '6.1.7601', 'AMD64', 'Intel64 Family 6 Model 58 Stepping 9, GenuineIntel')
pip freeze
or pip3 freeze
command and paste output)?E:\arlo\examples>pip freeze
arlo==1.0.0
bottle==0.12.9
build==1.0.2
click==5.1
colorama==0.3.7
docutils==0.12
Kivy==1.9.0
Kivy-Garden==0.1.4
lockfile==0.12.2
monotonic==1.4
mysql-connector-python==2.1.2
platformio==2.11.2
pycairo==1.8.10
pyglet==1.2.4
Pygments==2.0.2
pygobject==2.28.3
pygtk==2.24.0
pyserial==3.1.1
requests==2.11.0
six==1.11.0
sseclient==0.0.18
UNKNOWN==0.0.0
You are using pip version 8.1.2, however version 9.0.1 is available.
You should consider upgrading via the 'python -m pip install --upgrade pip' command.
Basic Arlo Camera
Downloaded files would not play.
For those that may have a similar issue using win32 (specifically Windows 7 Pro, but probably all windows OS version Python 2.7 will run on), here is a simple workaround. Credits to: https://stackoverflow.com/questions/38404827/avoid-writing-carriage-return-when-writing-line-feed-with-python [UBICA]
Sorry, I'm not familiar with Python -- I usually use perl for scripting, so this is probably not an optimal solution.
Changed line 36 "with open(videopath + '/' + videofilename, 'w') as f:"
to: "with open(videopath + '/' + videofilename, 'wb') as f:"
Apparently opening in the binary mode forces windows to interpret data literally -- does not replace LF wioth CRLF.
LF only was expected in downloaded file
Found CRLF (classic windoze vs xNIX issue)
Assuming this is generic to any win32 OS and current example scripts.
Downloaded files play as well as files saved from the ARLO App. Thanks so much for making ARLO useful for me! Not having an archive > 7 days caused loss of useful data (people stealing hose in front yard - then oddly, replacing it!). Now I can archive videos!
I wrote a script very similar to the one that was given in the README file to download the videos from the Arlo dashboard, but I am getting an error that says that the database is currently down.
('GetRecordings failed', {u'data': {u'message': u'We are sorry, the database service is currently down. Please try again.', u'reason': u'DynamoDB Servi
ce Unreachable', u'error': u'2603'}, u'success': False})
Has anyone else faced this issue?
Please answer these questions before submitting your issue. Thanks!
python -V
)?Python 2.7.9
python -c 'import platform; print(platform.uname());'
)?('Linux', 'RPiZ2', '4.9.24+', '#993 Wed Apr 26 17:56:54 BST 2017', 'armv6l', '')
pip freeze
or pip3 freeze
)?RPi.GPIO==0.6.3
argparse==1.2.1
chardet==2.3.0
colorama==0.3.2
html5lib==0.999
monotonic==1.4
ndg-httpsclient==0.3.2
pyOpenSSL==0.13.1
pyasn1==0.1.7
python-apt==0.9.3.12
requests==2.4.3
six==1.8.0
sseclient==0.0.18
urllib3==1.9.1
wheel==0.24.0
wsgiref==0.1.2
Netgear Arlo VMS3330-100EUS
Basestation: VMB3010r2 Firmware : 1.9.4.0_15548
Cameras: H7 Firmware: 1.2.11810
Cant switch the camera off by sript
I hoped, that the camera switched OFF
nothing, script stopped. No errorlog
yes
Is there any chance for help?
Cheers
PS. Sorry about my worse english
Hello Jeff,
First of all sorry for posting this as an issue because I am new to GitHub and don't know how to send PM or Email to you. I want to know more about the project because I'm planning to buy Arlo (used from my friend) but I do not want to send the feed to Arlo server but want to save on my server instead. I was searching on google and came across your project. Your Wiki is not completed so I couldn't understand the whole project. Does it help to send feed to given server location? If I clone it on Raspberry Pi how I am going to connect it to Base-station or How I am going to access it from Raspberry Pi? I know you are already busy working on this and other projects but I'm really interested in this one so could you please take some time and explain it little more. my email is [email protected]. I will really appreciate your help. Thanks in advance.
Please answer these questions before submitting your issue. Thanks!
python -V
): 2.7.3pip freeze
or pip3 freeze
command and paste output)?arlo==1.0.2
asn1crypto==0.24.0
certifi==2018.1.18
cffi==1.11.4
chardet==3.0.4
cryptography==2.1.4
enum34==1.1.6
idna==2.6
ipaddress==1.0.19
mcpi==0.1.1
mippy==0.1
monotonic==1.4
numpy==1.6.2
pexpect==4.2.1
picamera==1.10
pifacecommon==4.1.2
pifacedigitalio==3.0.4
playsound==1.2.2
ptyprocess==0.5.1
pycparser==2.18
pygobject==3.8.2
pyOpenSSL==17.5.0
pyserial==2.5
PySocks==1.6.8
requests==2.18.4
RPi.GPIO==0.6.2
six==1.11.0
sseclient==0.0.18
urllib3==1.22
Used examples/arlo-motiondetect.py to subscribe to motion detection. It worked for about 24 hours.
Works forever
Exception in a ping thread, but the program continued to run (did not reach my exception handler). No motion detection events were received after that event.
Exception:
xception in thread PingThread:
Traceback (most recent call last):
File "/usr/lib/python2.7/threading.py", line 552, in __bootstrap_inner
self.run()
File "/usr/lib/python2.7/threading.py", line 505, in run
self.__target(*self.__args, **self.__kwargs)
File "/usr/local/lib/python2.7/dist-packages/Arlo.py", line 259, in Ping
self.Notify(basestation, {"action":"set","resource":"subscriptions/"+self.user_id+"_web","publishResponse":False,"properties":{"devices":[basestation_id]}})
File "/usr/local/lib/python2.7/dist-packages/Arlo.py", line 340, in Notify
self.request.post('https://arlo.netgear.com/hmsweb/users/devices/notify/'+body['to'], body, headers={"xcloudId":basestation.get('xCloudId')})
File "/usr/local/lib/python2.7/dist-packages/Arlo.py", line 133, in post
return self._request(url, 'POST', params, headers)
File "/usr/local/lib/python2.7/dist-packages/Arlo.py", line 124, in _request
raise Exception('Request ({0} {1}) failed'.format(method, url), body)
Exception: ('Request (POST https://arlo.netgear.com/hmsweb/users/devices/notify/XXXXXXXXX) failed', {u'data': {u'message': u'We are sorry, the messaging service is currently down. Please try again February 16, 2018, 02:13 PM UTC.', u'reason': u'Presence Server Unreachable', u'error': u'2601'}, u'success': False})
tried with 1.0
Please answer these questions before submitting your issue. Thanks!
python -c 'import platform; print(platform.uname());'
)?xnu-3789.72.11~1/RELEASE_X86_64', machine='x86_64', processor='i386'
pip freeze
or pip3 freeze
command and paste output)?N/APro
The package is great - no problems whatsoever on my mac.
I would like to adjust the camera brightness for recordings - make the brightness higher at night. On the app, you select 'Live' and it shows a toolbar below the video screen that has a brightness adjuster. I do not see how to do this in the library.
Is this possible?
Did Arlo change something about their protocol in the last few weeks?
My RaspberryPI-based gadgets that arm and disarm my cameras have been working fine for two years with the September 2016 version of this library, but they have suddenly started getting authorization errors. I haven't changed anything, not even my login info.
I can start the process of upgrading to the latest code, but that will no doubt precipitate a cascade of changes.
Hello @jeffreydwalter
I'm having issue while connecting to Arlo, simple code:
arlo = Arlo(USERNAME, PASSWORD)
my_devices = arlo.GetDevices()
for i in my_devices:
print "\n"+json.dumps(i, sort_keys=True, indent=4)+"\n"
arlo.Logout()
I'm obtaining:
2017/12/13 12:38:33 | DEBUG | Starting new HTTPS connection (1): arlo.netgear.com
Traceback (most recent call last):
File "./arlo_test.py", line 24, in <module>
arlo = Arlo(USERNAME, PASSWORD)
File "/root/arlo_autoarm/Arlo.py", line 130, in __init__
self.Login(username, password)
File "/root/arlo_autoarm/Arlo.py", line 196, in Login
body = self.request.post('https://arlo.netgear.com/hmsweb/login/v2', {'email': self.username, 'password': self.password})
File "/root/arlo_autoarm/Arlo.py", line 121, in post
return self._request(url, 'POST', params, headers)
File "/root/arlo_autoarm/Arlo.py", line 104, in _request
r = self.session.post(url, json=params, headers=headers)
File "/home/omar/.local/lib/python2.7/site-packages/requests/sessions.py", line 555, in post
return self.request('POST', url, data=data, json=json, **kwargs)
File "/home/omar/.local/lib/python2.7/site-packages/requests/sessions.py", line 508, in request
resp = self.send(prep, **send_kwargs)
File "/home/omar/.local/lib/python2.7/site-packages/requests/sessions.py", line 618, in send
r = adapter.send(request, **kwargs)
File "/home/omar/.local/lib/python2.7/site-packages/requests/adapters.py", line 508, in send
raise ConnectionError(e, request=request)
requests.exceptions.ConnectionError: HTTPSConnectionPool(host='arlo.netgear.com', port=443): Max retries exceeded with url: /hmsweb/login/v2 (Caused by NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at 0x7f266e1d7fd0>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution',))
But using the same USERNAME and PASSWORD from web browser it does login.
Can you help me?
Thanks in advance,
imopen
Has anyone had any success with enabling the scheduled mode for a basestation? I call Calendar(), get a success response but it doesn't actually change the basestation mode. Arm and disarm both work fine, so I'm confused why this doesn't have any effect. I've compared it to what the Arlo app itself sends, and all seems fine.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.