Closed sfederman closed 3 years ago
Just pushed a small fix to the mfa branch. git pull and let me know how it goes.
Thank you - I just checked it out after updating, and look to be having the same issue:
(arlo) sfederman@testserver1:~/arlo$ python3 arlo_test.py
Failed to start eventstream thread: can only concatenate str (not "bytes") to str
Exception ignored in: <function EventStream.__del__ at 0x7f089ec21790>
Traceback (most recent call last):
File "/home/sfederman/anaconda3/envs/arlo/lib/python3.8/site-packages/eventstream.py", line 42, in __del__
File "/home/sfederman/anaconda3/envs/arlo/lib/python3.8/site-packages/eventstream.py", line 90, in Disconnect
File "/home/sfederman/anaconda3/envs/arlo/lib/python3.8/site-packages/eventstream.py", line 110, in Unregister
AttributeError: 'EventStream' object has no attribute 'event_stream_thread'
(arlo) sfederman@testserver1:~/arlo$ head /home/sfederman/anaconda3/envs/arlo/lib/python3.8/site-packages/eventstream.py -n75 | tail -n1
event_stream = sseclient.SSEClient('https://myapi.arlo.com/hmsweb/client/subscribe?token='+self.arlo.request.session.headers.get('Authorization'), session=self.arlo.request.session)```
I unfortunately don't have any working Arlo cameras to debug this with. Would you be willing to help debug this further?
@sfederman I just pushed another small change. Let me know if it made a difference.
I'm more than happy to help debug to the extent I can!
Oh - and I do see the most recent change, but it is in the master
branch - I've been using the mfa-pr
branch, as I need to use MFA from now on...
Not sure if this is helpful, but I tried the below change, which I thought might be the change intended in eventstream.py
(the commented out line was changed to the line immediately following it):
def Start(self):
try:
#event_stream = sseclient.SSEClient('https://myapi.arlo.com/hmsweb/client/subscribe?token='+self.arlo.request.session.headers.get('Authorization'), session=self.arlo.request.session)
event_stream = sseclient.SSEClient('https://myapi.arlo.com/hmsweb/client/subscribe', session=self.arlo.request.session)
self.event_stream_thread = threading.Thread(name="EventStream", target=self.event_handler, args=(self.arlo, event_stream, self.event_stream_stop_event, ))
self.event_stream_thread.setDaemon(True)
self.event_stream_thread.start()
except Exception as e:
raise Exception('Failed to start eventstream thread: {0}'.format(e))
When I tried this, here is the result:
(arlo) sfederman@testserver1:~/arlo$ python3 arlo_test.py
'Arlo' object has no attribute 'user_id'
@sfederman just pushed what I believe to be a fix. Please give it a whirl! Thanks!
Thanks so much - that appears to be working. Snapshots are functional, which is all I need for now. I'll do some more testing with the API, and see if any issues remain.
Thanks again for your assistance, I appreciate your help, and the creation of the repository.
To be clear, I have a combination of the changes across the 2 branches right now. Below is what is working:
arlo.py
(line 208)
self.user_id = auth_body['data']['userId']
eventstream.py
def Start(self):
try:
header_auth = self.arlo.request.session.headers.get('Authorization')
decoded_header = header_auth.decode()
event_stream = sseclient.SSEClient('https://myapi.arlo.com/hmsweb/client/subscribe?token='+decoded_header, session=self.arlo.request.session)
self.event_stream_thread = threading.Thread(name="EventStream", target=self.event_handler, args=(self.arlo, event_stream, self.event_stream_stop_event, ))
self.event_stream_thread.setDaemon(True)
self.event_stream_thread.start()
except Exception as e:
raise Exception('Failed to start eventstream thread: {0}'.format(e))
return self
Does it work with what's in the mfa branch?
On Mon, Aug 2, 2021, 11:11 PM Scot Federman @.***> wrote:
To be clear, I have a combination of the changes across the 2 branches right now. Below is what is working:
arlo.py (line 208)
self.user_id = auth_body['data']['userId']
eventstream.py
def Start(self): try: header_auth = self.arlo.request.session.headers.get('Authorization') decoded_header = header_auth.decode() event_stream = sseclient.SSEClient('https://myapi.arlo.com/hmsweb/client/subscribe?token='+decoded_header, session=self.arlo.request.session) self.event_stream_thread = threading.Thread(name="EventStream", target=self.event_handler, args=(self.arlo, event_stream, self.event_stream_stop_event, )) self.event_stream_thread.setDaemon(True) self.event_stream_thread.start() except Exception as e: raise Exception('Failed to start eventstream thread: {0}'.format(e)) return self
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/jeffreydwalter/arlo/issues/173#issuecomment-891506662, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAEKOBZEFAWMPQ5RJO6ZC7DT25T5LANCNFSM5BFKKH4A . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&utm_campaign=notification-email .
No, not as is. I'll try to narrow down why...
Ok, I see you're doing header_auth.decode()
. I just pushed a commit that does the same. Let me know how it goes!
It seems to function properly now! I rebuilt a conda environment with the code, and ran the same test as in the original issue arlo_test.py
, and did get an image downloaded.
Thanks again for your help in debugging this.
Hi,
I believe I properly set up MFA, and am having the below issue. I had this issue on an existing system, but for testing, I set up a fresh VM. My Installation method is below.
I'd love any help with troubleshooting, and can provide more info if necessary. Thank you in advance for any assistance!
-Scot
What version of Python are you using (
python -V
)?Python 3.8.8
What operating system and processor architecture are you using (
python -c 'import platform; print(platform.uname());'
)?uname_result(system='Linux', node='testserver1', release='5.4.0-80-generic', version='#90-Ubuntu SMP Fri Jul 9 22:49:44 UTC 2021', machine='x86_64', processor='x86_64')
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.)?
2 x Arlo Pro H3,
What did you do?
Installation
Then followed instructions at: https://github.com/jeffreydwalter/arlo/blob/mfa-pr/docs/ARLO_MFA.md to set up MFA, which seems to be functioning properly (as best as I can tell).
arlo_test.py
What did you expect to see?
What did you see instead?
Does this issue reproduce with the latest release?
Yes