Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 25 Next »

Download the correct version of the Uplink Gateway package from here.

Windows Installation

  1. Install Docker Desktop for Windows.

  2. Download and unzip the Gateway package.

  3. Open Powershell and go to your working directory.

  4. If your system has Windows Subsystem for Linux (WSL) or Git installed you can start the application using the start script.

    ./start.sh

    Otherwise, run the following commands in Windows Powershell from the Gateway package directory.

    docker image load -i .\camera_agent_gateway_<VERSION>-x64.img
    docker-compose -f .\docker-compose.yml up

    For example if the version is 1.0.3:

    docker image load -i .\camera_agent_gateway_1.0.3-x64.img
  5. The Gateway should now be accessible from the address localhost:8000 or <device-ip>:8000

You should see the container running in your Docker Desktop

image-20240314-205135.png
  1. Disable Windows automatic proxy detection

image-20240328-015159.png

Linux Installation

  1. Download and unzip the Gateway package.

  2. Install Docker Engine and Docker Compose. It can also be done with the script from the package:

    ./docker_install.sh
  3. Run the Gateway using the start script.

    ./start.sh
  4. The Gateway should now be accessible from the address localhost:8000 or <device-ip>:8000

Adding Gateway to the Cloud

  1. Navigate to 127.0.0.1:8000 or <device-ip>:8000, login with username: admin, password: admin, and copy the device UUID.

    Screenshot from 2024-03-13 16-08-37.png

  2. Navigate to the Gateways tab in the Web Client and add the gateway using the UUID.

Screenshot from 2024-03-13 16-04-17.pngScreenshot from 2024-03-13 16-09-28.png

Adding Cameras

  1. Navigate to the Gateway tab in Cloud One and select the gateway you would like to add a camera to.

    Screenshot from 2024-03-13 16-09-57.png

  2. Select the ‘Add Camera To Gateway’ button and fill out the camera information form.

    Screenshot from 2024-03-13 16-10-08.png

    Screenshot from 2024-03-13 16-18-14.png

    Screenshot from 2024-03-13 16-18-23.png

  3. Camera will now have been added to the gateway and cloud one and the camera can be viewed in Gateway’s camera page as well as the Cameras tab.

How to Stop Gateway

  1. Execute the stop script.

    ./stop.sh

How to Update Gateway

  1. Ensure that the old version of Gateway is running.

  2. Navigate to the extracted folder of the new version of the Gateway.

  3. Execute the script update.sh by providing the old Gateway directory and new Gateway directory.

    ./update.sh -orig <path_to_old_version_directory> -dest <path_to_new_version_directory>

API Examples

Request authorization token from Gateway

Retrieve authorization token to send valid API requests.

curl -X POST -L 'http://<DEVICE_IP>:8000/api/auth-token/' -H 'Content-Type: application/json' -d '{"username": "user", "password": "pass"}'

Valid response: 200

{
    "token": "8656763e69dd6ead1d167b865f8caf08bf907227"
}

Get list of cameras on Gateway

Retrieve list of cameras from Gateway database.

curl -H 'Authorization: Token 8656763e69dd6ead1d167b865f8caf08bf907227' -X GET 'http://<DEVICE_IP>:8000/api/cameras/'

Valid response: 200

[
    {
        "camera_id": 1,
        "access_token": "",
        "ip": "104.251.103.214",
        "http_port": 7080,
        "rtsp_port": 7554,
        "is_active": true,
        "pid": 151,
        "serial": "FAKECAMERA69",
        "mac": "FAKECAMERA69",
        "rtsp_only": false
    }
]

Add camera to Gateway

When adding a camera, it is suggested to create an Uplink camera on the Cloud VMS without the provisioning server and then copying the created access token to use in the token field when creating a camera on the gateway. Otherwise, you must create an Uplink camera using the provisioning server and use the same serial number and MAC Address values when creating the camera on the gateway.

curl -H 'Authorization: Token 8656763e69dd6ead1d167b865f8caf08bf907227' -X POST http://<DEVICE_IP>:8000/api/add-camera/ -H "Content-Type: application/json" -d '{"ip": <CAMERA_IP>, "http_port": <HTTP_PORT>, "rtsp_port": <RTSP_PORT>, "serial": <CAMERA_SERIAL>, "mac": <CAMERA_MAC>, "token": <CLOUD_ACCESS_TOKEN>}'

Valid response: 201

{
    "camera_id": 1,
    "access_token": "",
    "ip": "192.168.40.21",
    "http_port": 80,
    "rtsp_port": 554,
    "is_active": false,
    "pid": null,
    "serial": "FAKECAMERA",
    "mac": "FAKECAMERA",
    "rtsp_only": false
}

Delete camera from Gateway

When deleting a camera, the camera ID for the camera on the gateway can be used. If the camera was added using an access token, you can also use the camera’s ID on the Cloud VMS to remove the camera.

curl -H 'Authorization: Token 8656763e69dd6ead1d167b865f8caf08bf907227' -X DELETE http://<DEVICE_IP>:8000/api/cameras/<GATEWAY_CAMERA_ID OR CLOUD_CAMERA_ID>/

Valid response: 204 No Content

Restart Gateway proxy connection

curl -H 'Authorization: Token 8656763e69dd6ead1d167b865f8caf08bf907227' -X POST http://<DEVICE_IP>:8000/api/restart/

Valid response: 200

{"message":"Server restarted successfully"}
  • No labels