Monocle works but not Monocle Gateway
-
I’ve had several Dahua cameras (& one Amcrest) working with Monocle with no problem using both an Echo Show and an Echo Spot, using the substream with a 704x480 resolution.
I just got an Echo Show 5 and understand that requires the Monocle Gateway. I set it up, and I’ve tried each of the tags @tunnel, @proxy, and @proxy-tcp. None are working for me.
Each time I ask Alexa to show a camera, the Monocle Gateway shows three initialization blocks in a row (one pasted here). When using @tunnel, nothing else appears after any of these blocks (saying CONNECTED or ATTACHED as indicated in the documentation). When using @proxy or @proxy-tcp, a few more lines are printed out, such as mentioning the three streams will be de-registered in 4 minutes.
Jul 17 10:52:01 monocle-gateway[26660]: ------------------------------------------------- Jul 17 10:52:01 monocle-gateway[26660]: INITIALIZE RTSP STREAM: Garage Jul 17 10:52:01 monocle-gateway[26660]: ------------------------------------------------- Jul 17 10:52:01 monocle-gateway[26660]: - NAME : Garage Jul 17 10:52:01 monocle-gateway[26660]: - LABEL : PRIMARY Jul 17 10:52:01 monocle-gateway[26660]: - URL : rtsp://mydomain.selfip.net:55452/cam/realmonitor?channel=1&subtype=1 Jul 17 10:52:01 monocle-gateway[26660]: - UUID : STREAM:8eb68089-ba30-43e7-9839-886d99e2e662 Jul 17 10:52:01 monocle-gateway[26660]: - SESS : ae8495de-26cc-4337-8b53-52b62d987795 Jul 17 10:52:01 monocle-gateway[26660]: - MODIF : Wed Jul 17 2019 10:51:47 GMT-0500 (CDT) Jul 17 10:52:01 monocle-gateway[26660]: - TAGS : @tunnel Jul 17 10:52:01 monocle-gateway[26660]: -------------------------------------------------
One thing that may be relevant and can be seen above is that I am not connecting to a camera on the local network with the gateway. It’s for a vacation house, so I’m using a dyndns.org domain to access the camera (so “mydomain” above is just a sanitized example). For this reason I thought perhaps @proxy-tcp might have the best chance of working, but it does not.
I should mention that Alexa responds almost immediately that it cannot connect to the camera, even though the Echo Show 5 screen appears to keep trying. This, combined with seeing three instances of the initialization block that I pasted above (all appear in about a second), makes me wonder if Monocle Gateway isn’t getting a response from the camera quickly enough, because it’s not on the internal network, so it’s failing too quickly (in less than a second). That’s only a guess.
I’m happy to PM a true URL & authentication to someone willing to help, since the camera is obviously accessible across the internet (& yes, I understand the risks so no need to point that out). Let me also state that I will also make a donation, as everyone should who uses this.
-
Thanks for the details you provided, that certainly gives us a good overview and enough details to know where to start diagnosing.
For now, just use the
@tunnel
tag. This should work fine for Dahua and Amcrest cameras. The@tunnel
tag will only use TCP (interleaved on the RTSP connection) packets for audio and video transfers … just like@proxy-tcp
but with less overhead. You are correct in assuming that@proxy
will not work for your remotely located camera over the Internet.Each time I ask Alexa to show a camera, the Monocle Gateway shows three initialization blocks in a row
This is because Alexa will attempt to connect up to 3 times to the camera before giving up. In the case where we use Monocle Gateway, Alexa will be attempting to connect directly to the Monocle Gateway instead of the IP camera. In your case, Alexa is failing to connect 3 times in rapid succession.
I should mention that Alexa responds almost immediately that it cannot connect to the camera, even though the Echo Show 5 screen appears to keep trying. This, combined with seeing three instances of the initialization block that I pasted above (all appear in about a second), makes me wonder if Monocle Gateway isn’t getting a response from the camera quickly enough, because it’s not on the internal network, so it’s failing too quickly (in less than a second). That’s only a guess.
This probably is not the case – as we should see in the Monocle Gateway log inbound TCP connection attempts from the Alexa device before we ever attempt to make a RTSP connection to the camera.
Immediately after the “INITIALIZE RTSP STREAM” message block in the log, you should see something similar to this:
2019-07-15T18:30:18.861Z [INFO] [10.1.2.249:39774 <r1QrUSc-B>] RTSP CLIENT SOCKET CONNECTED 2019-07-15T18:30:18.991Z [INFO] [10.1.2.249:39774 <r1QrUSc-B>] RTSP CLIENT ATTACHED TO STREAM: Kitchen (STREAM:11d01a21-c6ca-46ee-bb0a-a1d9edaa4524) 2019-07-15T18:30:18.995Z [INFO] [10.1.2.249:39774 <r1QrUSc-B>] RTSP ENDPOINT SOCKET CONNECTED {camera-kitchen-wifi:554}
“RTSP CLIENT” is the Alexa device making a connection to the gateway. “RTPS ENDPOINT” is the gateway making a connection to the actual camera stream.
So it appears the issue is that the Alexa devices are not able to connect directly to the Monocle Gateway.
This could be for a number of different reasons. The most common reasons are:
-
A Firewall on the computer running Monocle Gateway is blocking inbound access to port 443. Monocle Gateway must listen on port 443 to accept Alexa streaming requests.
-
DNS Rebinding. There is a whole write up on DNS rebinding here: https://monoclecam.com/monocle-gateway/troubleshooting/dns-rebinding
-
The Alexa device is on a separate, isolated or protected network (i.e. Guest Network) and is prevented from making connections to the computer running Monocle Gateway.
Let me know if this helps, or if you need further diagnostics steps.
Let me also state that I will also make a donation, as everyone should who uses this.
We certainly appreciate that and every little bit helps keep this project going :-)
Thanks, Robert
-
-
I had ping’ed the FQDN (displayed by Monocle upon starting) from my local network and assumed that if it resolved properly when pinging that it was good. I also checked the firewall and that wasn’t it, but your direction gave me another clue . . . something else might have been consuming port 443.
Sure enough, I had an apache instance listing on port 443 that I didn’t know about. Ooops. I stopped it and then I was able to view all the Dahua cameras on the Echo Show 5!!! Thank you. I needed the clue that the extra log lines (the socket connected & client attached) were not showing up. I humbly suggest you add that detail to the install page on the gateway which shows those lines (step 7).
I will say that the Amcrest IP3M-HX2 camera still does not work, but I’m assuming that’s camera-specific and although Amcrest uses Dahua firmware, this version of the camera doesn’t support separate ports for rtsp & http like all my current Dahua cameras.
Thank you to Robert, and you should have a small donation from me. For everyone else reading this, please donate. We should all want Robert to be able to afford to spend time on this and be wildly successful so we can all enjoy this for a long time.
-
@carteriii said in Monocle works but not Monocle Gateway:
I had ping’ed the FQDN (displayed by Monocle upon starting) from my local network and assumed that if it resolved properly when pinging that it was good. I also checked the firewall and that wasn’t it, but your direction gave me another clue . . . something else might have been consuming port 443.
Sure enough, I had an apache instance listing on port 443 that I didn’t know about. Ooops. I stopped it and then I was able to view all the Dahua cameras on the Echo Show 5!!! Thank you. I needed the clue that the extra log lines (the socket connected & client attached) were not showing up. I humbly suggest you add that detail to the install page on the gateway which shows those lines (step 7).
Good point. We do intend on creating a small tool that can be used to test this use case as well as a series of other small gotchas – hopefully available later this year.
I will say that the Amcrest IP3M-HX2 camera still does not work, but I’m assuming that’s camera-specific and although Amcrest uses Dahua firmware, this version of the camera doesn’t support separate ports for rtsp & http like all my current Dahua cameras.
I just took a look at that camera and it does not claim support for RTSP. However, it does say it supports ONVIF. It might be worth a try using “ONVIF Device Manager” (SEE THIS ARTICLE: http://help.angelcam.com/en/articles/372646-how-to-find-a-rtsp-address-for-an-onvif-compatible-camera-nvr-dvr) just to see if it advertises a RTSP stream URL.
Thank you to Robert, and you should have a small donation from me. For everyone else reading this, please donate. We should all want Robert to be able to afford to spend time on this and be wildly successful so we can all enjoy this for a long time.
You are welcome and thank you for the kinds words. And THANK YOU for the support!