pyaarlo icon indicating copy to clipboard operation
pyaarlo copied to clipboard

Failed to open ratls port

Open Jeff-Rand opened this issue 2 years ago • 4 comments

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?

Jeff-Rand avatar Apr 27 '22 23:04 Jeff-Rand

I turned on debug and it appears that response = self._arlo.be.notify( is not returning a response. It pauses for about one minute and during that time I see the following repeated many times: `2022-04-28 10:24:23,363 - pyaarlo - DEBUG - mqtt: connected=0

2022-04-28 10:24:32,569 - pyaarlo - DEBUG - topcs=

[]`

It just looks like the base station is not responding for some reason, or the event that this code is waiting for has changed in some way.

Any ideas?

Jeff-Rand avatar Apr 28 '22 15:04 Jeff-Rand

To rule out a problem with my Windows PC, I installed this library on a Raspberry Pi. The results were the same. I can do everything except opening the ratls port to download videos.

Does anyone know of a way to see what is being sent/received by the Arlo app on my cell phone? I tried to wireshark it and was able to capture the traffic, but it is all encrypted. I need a way to view the unencrypted packets, but I haven't found a way to do this on my android phone.

I wish Arlo would just make the API public..... sigh.... I will keep digging.

Jeff-Rand avatar May 04 '22 10:05 Jeff-Rand

I finally found a work-around and I am able to download the files from base station now. But the original problem still remains. For whatever reason, Arlo must have changed something in the way the open_port is done. When the code waits for the event that opens the storage/ratls resource, I get no response from Arlo's servers. Hopefully someone with knowledge of how to look at packets from the phone app can fix this issue.

Here is how I worked around the problem: First, in ratls.py I commented out the two lines that raise the exception "Failed to open ratls port". This allows the code to continue even though no response is received.

And second, I changed the next line that retrieves the properties from the response. The response would normally contain the privateIP, publicIP, and port. Since I know the actual value of each of these three things, I hard coded them into the base_connection details.

Here's what it looks like: # if response is None or not response['success']: # raise Exception(f"Failed to open ratls port: {response}") self._base_connection_details = {"privateIP": "192.168.0.x", "publicIP": "123.123.123.123", "port": "12345"}

You will of course, have to provide the two IP addresses and port number yourself. After doing this the station.build_media_library() call will work without a problem.

Jeff-Rand avatar May 08 '22 17:05 Jeff-Rand

So, I found a different work-around that doesn't involve modifying ratls.py. It turns out that MQTT has not been working since April 27th/28th. This must be why I keep seeing "mqtt: connected=0" and "mqtt: log=Connection failed, retrying".

I added backend='sse' to the call that creates pyaarlo.PyArlo. This apparently switches it to use the older sse backend instead of mqtt. Once this is done, the pyaarlo code will work as written. What I don't know is why the newer MQTT backend is not working anymore. Anyone have any ideas?

Jeff-Rand avatar May 11 '22 16:05 Jeff-Rand