Closed lennyzaman closed 4 years ago
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.
Hey,
the same happens to me.
I'm using the startStream
functionality which triggers subscribe+notify, once on of the notify requests crashes:
DEBUG:urllib3.connectionpool:https://my.arlo.com:443 "POST /hmsweb/users/devices/notify/51D2867VA0528 HTTP/1.1" 200 None
('Connection broken: IncompleteRead(0 bytes read)', IncompleteRead(0 bytes read))
DEBUG:urllib3.connectionpool:Resetting dropped connection: my.arlo.com
DEBUG:urllib3.connectionpool:https://my.arlo.com:443 "GET /hmsweb/client/subscribe?token=2_5VRtWbKukXO79-EySXRFp7DROIJnkiNqn4Ff65-wTvER6ln5lPH_cGc0wFSIL8JvnGJC8mTSxZw1oSO41QNXCTX1n0Exbvs02-t53zV4zVrTlfMDTD6YsUf7PhZ0yatXlmbqtowrW-YNbf5wi_vJqS5kqySTIt3BP8jP4xUuXXIH HTTP/1.1" 200 None
Then the Notify
isn't called anymore and the stream brakes.
The described behavior is inconsistent so it's hard to reproduce and fix. Any idea?
@lennyzaman can you reopen this?
Still an issue
If someone could provide a slimmed down script that reproduces the issue without all of the mqtt stuff, I'd be happy to try to get to the bottom of it.
Hey @jeffreydwalter . I was able to reproduce it constantly with the Arlo Go, maybe it'll make some sense.
/Notify
gets called constantly Incomplete Read
and Resetting dropped connection
I'm not sure if it's exactly the same issue as described above but maybe it'll help to connect the dots.
Thanks.
I have the same issue using your snapshot template wrapped in a 'while True:' loop. It is the result of trying to instantiate the arlo
object (WRONG: See update). The first run through goes fine. Then the loop waits for an interval of time to pass before reconnecting and snapping another shot. I get the "Connection broken:" notice twice but then it connects okay. Then it happens with every subsequent interval (30 minutes in my case). Perhaps arlo.logout needs to be explicity called after getting my business done? Let me try that. I am a Python noob.
UPDATE: I see the "Connection broken" message outside of daylight hours so it's happening outside of the take_snapshot()
function which instantiates the object. So I'm guessing that the connection is not explicitly closed (logout?) and times out from inactivity. Fortunately it doesn't stop a new connection when the snapshot time comes around again.
Yet Another UPDATE: Yes. 'arlo.Logout()' before the script goes to sleep again stops those messages from popping up.
Here is the stripped down code:
# -*- coding: utf-8 -*-
"""
Created on Wed Jan 15 19:44:54 2020
@author: Arthur
"""
from arlo import Arlo
import datetime
import time
import sys
interval_minutes = 30
sunset_hour = 19
sunrise_hour = 6
USERNAME = 'blah@blah.com'
PASSWORD = 'xxxxxxxxxx'
def take_snapshot():
camera_num = 1
try:
arlo = Arlo(USERNAME, PASSWORD)
basestations = arlo.GetDevices('basestations')
cameras = arlo.GetDevices('cameras')
snapshot_url = arlo.TriggerFullFrameSnapshot(basestations[0], cameras[camera_num])
snapshot_filename = cameras[camera_num]['deviceName'] + '-' + time.strftime('%Y-%m-%d_%H-%M-%S',
time.localtime()) + '.jpg'
arlo.DownloadSnapshot(snapshot_url, 'snapshots/' + snapshot_filename)
# UPDATE Addition
arlo.Logout() #added this to fix 'Connection Broken' timeout message
except Exception as e:
return repr(e)
return "Success"
if __name__ == "__main__":
dt = datetime.datetime.now()
while True:
hour = datetime.datetime.now().hour
if sunrise_hour < hour < sunset_hour:
result = take_snapshot()
dt = datetime.datetime.now() + datetime.timedelta(minutes=interval_minutes)
while datetime.datetime.now() < dt:
time.sleep(1)
('Linux', 'Homeserver', '5.0.0-32-generic', '#34~18.04.2-Ubuntu SMP Thu Oct 10 10:36:02 UTC 2019', 'x86_64', 'x86_64')
Python 3.6.9
$pip3 freeze apt-clone==0.2.1 apturl==0.5.2 arlo==1.2.33 beautifulsoup4==4.6.0 Brlapi==0.6.6 certifi==2019.11.28 chardet==3.0.4 command-not-found==0.3 configobj==5.0.6 cupshelpers==1.0 defer==1.0.6 httplib2==0.9.2 idna==2.8 louis==3.5.0 macaroonbakery==1.1.3 Mako==1.0.7 MarkupSafe==1.0 monotonic==1.5 nemo-emblems==4.4.0 netifaces==0.10.4 onboard==1.4.1 PAM==0.4.2 pexpect==4.2.1 Pillow==5.1.0 protobuf==3.0.0 psutil==5.4.2 pycairo==1.16.2 pycrypto==2.6.1 pycups==1.9.73 pycurl==7.43.0.1 pygobject==3.26.1 PyICU==1.9.8 pyinotify==0.9.6 pymacaroons==0.13.0 PyNaCl==1.1.2 pyparted==3.11.1 pyRFC3339==1.0 PySocks==1.7.1 python-apt==1.6.4 python-debian==0.1.32 python-xapp==1.8.1 python-xlib==0.20 pytz==2018.3 pyxdg==0.25 PyYAML==3.12 reportlab==3.4.0 requests==2.22.0 requests-unixsocket==0.1.5 sessioninstaller==0.0.0 setproctitle==1.1.10 six==1.14.0 sseclient==0.0.22 system-service==0.3 systemd-python==234 tinycss==0.4 ubuntu-drivers-common==0.0.0 ufw==0.36 urllib3==1.25.7 virtualenv==16.7.9 xkit==0.0.0
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.
Please answer these questions before submitting your issue. Thanks!
What version of Python are you using (
python -V
)?Python 3.5.3
What operating system and processor architecture are you using (
python -c 'import platform; print(platform.uname());'
)?uname_result(system='Linux', node='raspberrypi1', release='4.14.98-v7+', version='#1200 SMP Tue Feb 12 20:27:48 GMT 2019', machine='armv7l', processor='')
Which Python packages do you have installed (run the
pip freeze
orpip3 freeze
command and paste output)?Which version of ffmpeg are you using (
ffmpeg -version
)?Which Arlo hardware do you have (camera types - [Arlo, Pro, Q, etc.], basestation model, etc.)?
Arlo Ultra (1 basestation, 2 cameras)
What did you do?
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)
What did you expect to see?
What did you see instead?
Does this issue reproduce with the latest release?
yes
Hi Jeffrey, First off thanks for the great work on this tool. To make it all a bit clear what I want to have is a link between arlo and my openhab. I use MQTT to output all the data to that bus. To get my data I subscribe to the EventStream with 'HandleEvents' in a separate thread. I process all these events and selectively send them on into a Queue for handling(into MQTT) To get regular updates I use 'schedule' to run 2 function calls arlo.Notify() with "cameras" and "modes" to force arlo to send me the current data. I also added a Ping() call in this scheduled run but alas... Sorry if the code is inconsistent. I'm pretty new to programming and this is still a WIP...
If you need more info, please...
Thanks, Best regards!