Install Monocle Gateway on Windows (x64)



Requirements & Prerequisites

Please review the following system prerequisites:

Operating System & Hardware

The Monocle Gateway application/service is supported on

  • Windows 10 & 11 (x64).
     

Networking

You computer should have a fix IP address on your local network. It may be a statically assigned IP address or a dynamically assigned fixed IP address. The IP cameras on your local network must be able to access this computer.

No other service or application can be serving on port 443. Amazon requires that cameras only connect to port 443 using secure TLS encrypted communications. If you have a firewall enabled on this computer, you must allow access to port 443 from other computers on your local private network.

Additionally, ports 8554 & 8555 must be available and are used internally by the service on the computer. These ports do not need to be exposed thru the local firewall.

This computer should be physically plugged into the network with a hard-wired ethernet connection. Wireless connections will technically work, but are less reliable and may provide less bandwidth and additional latency.


Installation Instructions

Please follow the instructions below to install and setup your Monocle Gateway service.
 

1.) Download and install the Microsoft Visual C++ 2010 Runtime Dependencies.

Download the latest Microsoft Visual C++ 2010 SP1 Redistribution Package directly from Microsoft for Windows here. This package installed the underlying dependencies for Monocle Gateway.

> Download Microsoft Visual C++ 2010 SP1 Redistributable Package (x86) from Official Microsoft Download Center

After download, please install this package from the installer file.
 

2.) Download the latest Monocle Gateway release build.

Download the latest Monocle Gateway build for Windows here. You can choose from either x64 or x86 builds depending on your system.

> Monocle Gateway - Download Latest Release

64-bit Windows x64

Note: SHA1 and MD5 Hashes are available here

3.) Extract the contents of the ZIP file to the target directory where you would like to install Monocle Gateway.

Create a directory on your system where you want to keep the Monocle Gateway files. For example you could use C:\monocle. Next, extract files from the downloaded ZIP file into this directory. We will now refer to this directory as your Monocle Gateway installation directory.
 

4.) Generate and download your Monocle API token from your user account page in the Monocle web portal.

See this topic for more details on how to generate your API token: Monocle API Token

Once you have downloaded your monocle API token file, move or copy it to the Monocle Gateway installation directory. (i.e. C:\monocle\monocle.token)
 

5.) Launch the "monocle-gateway.exe" application from command line to verify its working properly.

To continue you will need to open a command prompt with elevated (administrator) privileges.

This article illustrates how to do this: http://www.thewindowsclub.com/how-to-run-command-prompt-as-an-administrator

Navigate to your Monocle Gateway installation directory in the command prompt.

Microsoft Windows [Version 10.0.17134.48]
(c) 2018 Microsoft Corporation. All rights reserved.

C:\WINDOWS\system32> cd C:\monocle
C:\monocle>

Next simply start the Monocle Gateway by launching the executable at the command prompt. monocle-gateway.exe

Please note when starting the service/application, if you get any errors that say the file MSVCR100.DLL is missing, then you will also need to download and install the Microsoft Visual C++ 2010 Runtime Libraries available here: Download Microsoft Visual C++ 2010 SP1 Redistributable Package (x86) from Official Microsoft Download Center

If Monocle Gateway starts up successfully and established a connection to the Monocle platform , then you will get a print out that looks similar to the following:

C:\monocle>monocle-gateway.exe

 ******************************************************************
 *             __  __  ___  _  _  ___   ___ _    ___              *
 *            |  \/  |/ _ \| \| |/ _ \ / __| |  | __|             *
 *            | |\/| | (_) | .` | (_) | (__| |__| _|              *
 *            |_|  |_|\___/|_|\_|\___/ \___|____|___|             *
 *                                                                *
 ******************************************************************

-------------------------------------------------
MONOCLE RUNTIME ENVIRONMENT
-------------------------------------------------
VERSION   = 0.0.6
OS/ARCH   = win32\x64
PROCESS   = monocle-gateway (PID=9652)
TIMESTAMP = 2018-06-08T18:36:04.256Z

-------------------------------------------------
MONOCLE GATEWAY SERVICE         (Version: 0.0.6)
-------------------------------------------------
[Monocle Starting]
[Monocle Connecting]
[Monocle Started]
[RTSP Server Starting]
[RTSP Server Listening] 0.0.0.0:8555 (RTSP)
[RTSP Server Listening] 0.0.0.0:443 (RTSP-TLS)
[RTSP Proxy Started] (PID=468)
[RTSP Server Listening] 0.0.0.0:8554 (PROXY)
[RTSP Server Started]
[Monocle Connected]
[RTSP Server Registered]

-------------------------------------------------
MONOCLE RTSP SERVICE - INITIALIZED
-------------------------------------------------
FQDN = c5b4w3q2-bv4f-4sdf9-dsf-28a852ecae54.mproxy.io
HOST = 192.168.1.22
PORT = 443
-------------------------------------------------

Look for the MONOCLE RTSP SERVICE - INITIALIZED message; this means that everything was successfully and the gateway is fully running.
 

6.) Configure one or more cameras for use with the Monocle Gateway service.

The Monocle web portal has not yet been updated to include a user interface for configuring which cameras should use the Monocle Gateway service.

Please see the Tagging Cameras for Monocle Gateway topic for the interim solution.
 

7.) Test your configured cameras with the Monocle Gateway service.

Now you are ready to test our your camera(s) using your Alexa device and Monocle via the Monocle Gateway. Just ask Alexa to show you one of your named cameras that have been configured to use the Monocle Gateway service.

You should see the named camera displayed in the Monocle Gateway service command console followed by some details logging information as well as the camera stream displayed on your Alexa device.

-------------------------------------------------
INITIALIZE RTSP STREAM:  Kitchen
-------------------------------------------------
 - NAME  : Kitchen
 - LABEL : PRIMARY
 - URL   : rtsp://192.168.1.251:554/cam/realmonitor?channel=1&subtype=0
 - UUID  : STREAM:99d01a23-c6sd-46-bb11-v1d9edda4523
 - SESS  : e28ba6f0-3c2a-481e-a715-4f989c615a0a
 - MODIF : Thu May 17 2018 16:38:55 GMT-0400 (Eastern Daylight Time)
-------------------------------------------------

2018-06-08T18:48:54.971Z [INFO]  [10.1.2.217:40172 <BJkj18ulm>] RTSP CLIENT SOCKET CONNECTED
2018-06-08T18:48:55.103Z [INFO]  [10.1.2.217:40172 <BJkj18ulm>] RTSP CLIENT ATTACHED TO STREAM: Kitchen (STREAM:99d01a23-c6sd-46-bb11-v1d9edda4523)
2018-06-08T18:48:55.120Z [INFO]  [10.1.2.217:40172 <BJkj18ulm>] RTSP ENDPOINT SOCKET CONNECTED {192.168.1.251:554}
2018-06-08T18:48:55.130Z [DEBUG] [10.1.2.217:40172 <BJkj18ulm>] [CLIENT REQUEST]  --> [DESCRIBE] rtsp://c5b4w3q2-bv4f-4sdf9-dsf-28a852ecae54.mproxy.io:443/STREAM:99d01a23-c6sd-46-bb11-v1d9edda4523?session=e28ba6f0-3c2a-481e-a715-4f989c615a0a
...

Once you have successfully tested your cameras, you can stop the Monocle Gateway service by pressing CTRL-C (you may have to press it several times) and then install Monocle Gateway as a Windows service as demonstrated in the next topic.
 

8.) Install Monocle Gateway as a Windows Service.

In the command window (running as administrator), execute the following command from the Monocle Gateway directory to install the Windows service. monocle-gateway.exe --install

C:\monocle>monocle-gateway.exe --install

 ******************************************************************
 *             __  __  ___  _  _  ___   ___ _    ___              *
 *            |  \/  |/ _ \| \| |/ _ \ / __| |  | __|             *
 *            | |\/| | (_) | .` | (_) | (__| |__| _|              *
 *            |_|  |_|\___/|_|\_|\___/ \___|____|___|             *
 *                                                                *
 ******************************************************************

ATTEMPTING TO <<INSTALL>> THE [MONOCLE-GATEWAY] SERVICE
Service "monocle-gateway" installed successfully!

CONFIGURING THE [MONOCLE-GATEWAY] SERVICE .. PLEASE WAIT ...
STARTING THE [MONOCLE-GATEWAY] SERVICE .. PLEASE WAIT ...
DONE.

C:\monocle>

Windows Service

The following commands can be executed in a command window to install, uninstall, start, stop and restart the Monocle Gateway windows service. You must run the command window as an administrator to control windows services.

  • Install the Windows service: monocle-gateway.exe --install

  • Start the Windows service: monocle-gateway.exe --start

  • Stop the Windows service: monocle-gateway.exe --stop

  • Restart the Windows service: monocle-gateway.exe --restart

  • Uninstall the Windows service: monocle-gateway.exe --uninstall


Logging

If running the Monocle Gateway as a Windows service the application will write its output data to a log file: monocle-gateway.log.

To monitor the log file while the service is running you can open a Power Shell window and use the following command to "tail" the log file. Get-Content -Path .\monocle-gateway.log -Wait


Removal Instructions

Uninstalling and removing the Monocle Gateway from the computer is very simple. First, if you installed Monocle Gateway as a Windows service, then uninstall it by opening a command window (Run as Administrator) and enter the following command from the directory containing the Monocle Gateway files. monocle-gateway.exe --uninstall

C:\monocle>monocle-gateway.exe --uninstall

 ******************************************************************
 *             __  __  ___  _  _  ___   ___ _    ___              *
 *            |  \/  |/ _ \| \| |/ _ \ / __| |  | __|             *
 *            | |\/| | (_) | .` | (_) | (__| |__| _|              *
 *            |_|  |_|\___/|_|\_|\___/ \___|____|___|             *
 *                                                                *
 ******************************************************************

ATTEMPTING TO <<STOP>> THE [MONOCLE-GATEWAY] SERVICE
monocle-gateway: STOP: The operation completed successfully.

ATTEMPTING TO <<UNINSTALL>> THE [MONOCLE-GATEWAY] SERVICE
Service "monocle-gateway" removed successfully!

C:\monocle>

Once the service has been uninstalled, simply delete the directory you created for Monocle Gateway and all its files. That's it. Monocle Gateway does not write anything to the registry (apart from the Windows service stuff) or place data files elsewhere on the system.