How to install push module on x64 Hardware

How to install push module on x64 Hardware

This functionality is only available to full white-label hardware manufacturers.

This article provides a comprehensive guide on installing the push module on your hardware, specifically those with x64 architecture and running Linux-based operating systems. In order to incorporate the push module into your hardware, it is necessary to establish the Docker container software. Before commencing the installation process for the Docker container, it is crucial to ensure that your operating system is updated with the latest available patches.

For information regarding installation on different hardware architectures or operating systems, kindly reach out to your designated account manager.

Step 1: Install the Docker engine

For detailed instructions on how to install the Docker engine on your system, please refer to this guide.


Step 2: Install the AWS CLI package

To learn how to install the AWS Command Line Interface (CLI) on your system, please refer to the following guide for detailed instructions.


Step 3: Configure the AWS profile

Note: please contact your account manager to obtain the AWS Access Key information for your account.

To initiate the configuration process for the AWS profile, please execute the following command in your terminal:

aws configure --profile camera-gateway
When prompted, enter your AWS Access Key ID, followed by your AWS Secret Access Key. For the Default region name, use "us-east-1". When prompted for the Default output format, leave it empty (simply press "Enter" to proceed without specifying an output format).




Step 4: Authenticate to AWS Docker repository

To obtain authentication with cloud services and start the Docker container, you will need to use the previously created configuration file (in the above example, the file name is "camera-gateway"). Please execute the following command to achieve this:

aws ecr get-login-password --profile camera-gateway --region us-east-1 | docker login --username AWS --password-stdin 560123373187.dkr.ecr.us-east-1.amazonaws.com




Step 5: Start the Docker container

There are two options available for managing the push module: a web user interface (UI) that resembles the original Gateway interface, and a Command Line Interface (CLI) for controlling the push module. Different commands are required to load the appropriate container based on your preferred method.

When launching the container for the first time, the Docker engine will initiate the download of all necessary files from the cloud. The duration of this process will vary depending on your download speed and may require some time. However, subsequent launches will automatically skip the download step, resulting in faster startup times.


Docker container with Web UI

To initiate the Docker container with the web UI, execute the following command:
docker run --name bridge_service -d \
 -e DOTNET_ENVIRONMENT=ProductionCloud \
 -e AWS__Profile=camera-gateway \
 -e AWS__REGION=us-east-1 \
 -e ASPNETCORE_URLS="http://+:8080" \
 -v ~/.aws:/root/.aws \
 -v ~/camera-gateway:/app/data \
 --network=host \
 --restart unless-stopped \
 560123373187.dkr.ecr.us-east-1.amazonaws.com/3deye.bridgeservice:latest-amd64

The web UI of the push module will become accessible a few seconds after the container starts. To access the web UI, either enter the following URL (use localhost instead of the {IP_Address}) in the browser of the machine on which the Docker is running :

{IP_Address}:8080

or use any other device in the same network and enter the {IP_Address} of the Docker machine and port 8080 to manage the push module.

Use the following credentials to access the web UI, credentials can be modified from the web UI after login:

username: admin
password: 123456



Docker container with CLI

To initiate the Docker container with the web CLI, execute the following command:
docker run --name bridge_service -d \
 -e DOTNET_ENVIRONMENT=ProductionCloud \
 -e AWS__Profile=camera-gateway \
 -e AWS__REGION=us-east-1 \
 -v ~/.aws:/root/.aws \
 -v ~/camera-gateway:/app/data \
 --network=host \
 --restart unless-stopped \
 560123373187.dkr.ecr.us-east-1.amazonaws.com/3deye.bridgeservice:latest-amd64


CLI Commands

The following commands are supported in the command line interface.


Obtain Push Module Registration Code

To obtain the machine's push module register code use the following command:
docker exec bridge_service curl -s --request GET \
 -H "Authorization: Basic YWRtaW46MTIzNDU2" \
 http://localhost/api/system/registerCode


Note: YWRtaW46MTIzNDU2 is a base64 representation of default push module credentials -  admin:123456


Add a Device

To add a camera or NVR, please utilize the following command. Instead of "{Device_IP_Address}", substitute the actual IP address of the camera or NVR. Similarly, replace the {HTTP_port} and {RTSP_port} device ports with the specific port numbers used by the device (default values are 80 and 554).
docker exec bridge_service curl -s --request POST \
 -H "Authorization: Basic YWRtaW46MTIzNDU2" \
 -H 'Content-Type: application/json' \
 -d '{
    "host": "{Device_IP_Address}",
    "httpPort": {HTTP_port}
    "rtspPort": {RTSP_port}
 }' \
 http://localhost/api/device




View Registered Devices

To view the list of registered devices use the following command:
docker exec bridge_service curl -s --request GET \
 -H "Authorization: Basic YWRtaW46MTIzNDU2" \
 http://localhost/api/device/list




Delete a Device

To delete a device from the gateway use the following command, replace {deviceId} with the number that can be found in the "id" line from the reply to list devices method listed above:
docker exec bridge_service curl -s --request DELETE \
 -H "Authorization: Basic YWRtaW46MTIzNDU2" \
 http://localhost/api/device/{deviceId}






Restore a Configuration

You can restore the configuration of the gateway from a file, to do this import the devices list from the file (~/devices.json) using the following command:
docker cp ~/devices.json bridge_service:/tmp/devices.json && \
docker exec bridge_service curl -s --request POST \
 -H "Authorization: Basic YWRtaW46MTIzNDU2" \
 -F file=@/tmp/devices.json \
 http://localhost/api/device/import



Export a List of Devices

You can save the list of registered devices on the gateway and export it to a file (~/devices.json). This will allow you to quickly restore the configuration of the gateway if needed. Use the following command to save a list of devices as a JSON file:
docker exec bridge_service curl -s --request GET \
 -H "Authorization: Basic YWRtaW46MTIzNDU2" \
 -o /tmp/devices.json \
 http://localhost/api/device/export && \
docker cp bridge_service:/tmp/devices.json ~/devices.json



Check Milestone Settings

Check current Milestone settings using the following command:
docker exec bridge_service curl -s --request GET \
 -H "Authorization: Basic YWRtaW46MTIzNDU2" \
 http://localhost/api/milestone/setting




Register a new Milestone Server

To register a new Milestone server on the gateway, execute the following command, replacing "{Milestone_IP_Address}" with the actual IP address of the Milestone server. Additionally, provide the appropriate credentials to the ONVIF bridge module on the Milestone server, input the server's ONVIF bridge username instead of {Server_Username} and the server's ONVIF bridge password instead of {Server_Password}
docker exec bridge_service curl -s --request PUT \
 -H "Authorization: Basic YWRtaW46MTIzNDU2" \
 -H 'Content-Type: application/json' \
 -d '{
    "host": "{Milestone_IP_Address}",
    "username": "{Server_Username}",
    "password": "{Server_Password}"
 }' \
 http://localhost/api/milestone/settings




Delete a Milestone Server

Delete the current Milestone server from the gateway using the following command:
docker exec bridge_service curl -s --request DELETE \
 -H "Authorization: Basic YWRtaW46MTIzNDU2" \
 http://localhost/api/milestone/settings