Running on Multi-Homed Host



  • Hi,
    I recently discovered Monocle as a solution to getting my Ubiquiti IP Cameras available via my Amazon Echo devices (Spot and HD Fire tablets).
    Followed the tutorials and got everything working fine.
    My initial setup used Monocle-Gateway on my laptop, however, once I got everything working, I reinstalled the Gateway on the machine which hosts the Ubiquti Controller software (which is the rtsp streaming source for all of the cameras).
    This is a Virtual Machine using Windows Server 2012 R2 as the OS.
    For reasons outside the scope of my query, this VM has two virtual network interface cards installed.
    So to my query - whenever I start the Monocle-Gateway it always binds to the IP address of wrong vNIC - That is the vNIC which is connected to a network on which my Cameras DONOT reside. As a work around, I disable the second vNIC before starting the Monocle-Gateway - which means it binds to the correct (only) vNIC - and once it has started, I simply enable the second vNIC.
    Question, is there a config item I can set in Monocle-Gateway that ensures the correct binding?



  • I ran into the same issue and worked with Robert from Monocle support to resolve it. There is an undocumented way to provide binding information to the gateway. In my case, I’m using a beta version of the gateway, so your mileage may vary.

    Here are Robert’s instructions modified a bit by me to better fit into the forum format:

    The gateway does support the option to configure which IP to host on. You will need to create/configure the custom properties file as described below.

    The file must be called monocle.properties and be stored with the other gateway files. See example at the bottom of this message, but there is only one line you will need to change (really only one line you need to have at all, probably).

    1. Uncomment the “rtsp.register.host=” line by removing the “#” character at the beginning of the line.
    2. Provide your desired IP address (this is the IP the Alexa device will use to connect with) in the host line as shown below: (replace “X.X.X.X” with your IP.)
    #--------------------------------------
    # RTSP SERVICE REGISTRATION OVERRIDES
    #--------------------------------------
    #rtsp.register.fqdn=
    rtsp.register.host=X.X.X.X
    #rtsp.register.port=443
    
    1. Save this file and copy it to the same directory where you installed the “monocle-gateway” executable file.
      (Note: on Linux/RaspberryPi you can place this file in “/etc/monocle/monocle.properties”)

    When you start the Monocle Gateway it will generate a new DNS record (or update a previous record) and it should use your newly configured IP address. After a few minutes, you can test the created DNS address (visible in the console or log of monocle gateway) using the ping utility on one of your computers. It should resolve to your public IP address.

    You may have to reboot your Alexa devices to pick up the new DNS record. They seem to cache DNS records for a long time. You can also alternative generate yourself a new token file and use it with Monocle Gateway as this will force a new DNS record to be created with a new DNS hostname.

    Example monocle.properties file (but you don’t really need all this):

    # ******************************************************************
    # *             __  __  ___  _  _  ___   ___ _    ___              *
    # *            |  \/  |/ _ \| \| |/ _ \ / __| |  | __|             *
    # *            | |\/| | (_) | .` | (_) | (__| |__| _|              *
    # *            |_|  |_|\___/|_|\_|\___/ \___|____|___|             *
    # *                                                                *
    # ******************************************************************
    # *               MONOCLE GATEWAY CONFIGURATION FILE               *
    # ******************************************************************
    
    #--------------------------------------
    # RTSP SERVICE PROPERTIES
    #--------------------------------------
    #rtsp.host=0.0.0.0
    #rtsp.port=8555
    #rtsp.ssl.port=443
    
    #--------------------------------------
    # RTSP PROXY PROPERTIES
    #--------------------------------------
    #rtsp.proxy.port=8554
    #rtsp.proxy.expire_minutes=10
    #rtsp.proxy.debug=false
    #rtsp.proxy.verbose=false
    #rtsp.proxy.log=false
    
    #--------------------------------------
    # RTSP SERVICE REGISTRATION OVERRIDES
    #--------------------------------------
    #rtsp.register.fqdn=
    #rtsp.register.host=
    #rtsp.register.port=443
    
    #--------------------------------------
    # RTSP SSL CERTIFICATE & PRIVATE KEY
    #--------------------------------------
    #rtsp.ssl.cert=ssl-cert.pem
    #rtsp.ssl.key=ssl-key.pem
    


  • @shdwlynx

    Thanks for jumping in a posting a response to @autodrivel !

    I have also posted a new pinned post in the Monocle Gateway topic here with basically the same information along with a download link for the base properties file:
    https://forum.monoclecam.com/topic/99/monocle-gateway-custom-properties

    Thanks, Robert



  • @monocle, @shdwlynx ,

    Thanks for your help with this.
    I have added a monocle.properties file with the appropriate rtsp.register.host= setting and everything is working correctly.
    I can stop and start the monocle gateway service with both vNICs enabled and the service binds to the correct IP.

    All is good!



  • @autodrivel

    Glad to hear its working for you now!



  • @Monocle (Robert) thanks for making it official. At first, I was going to apologize for being lazy and not searching for a post by you with similar content and then I noticed I beat you to the punch so now I don’t have to. 😛

    @autodrivel, glad I could help, but it’s really all Robert and the excellent folks at Monocle. Seriously impressed with this company and super glad I can watch my cams using my Echo Show!



  • @shdwlynx

    No you were first 🙂 . I just figured this question would continue to come up and deserved its own pinned topic page.

    Thanks, Robert