Set cameras time via ONVIF
Use the cams.conf-file to configure access to all cameras. For every camera, provide a block as follows:
[CameraName]
host: <ip adress of camera>
port: <onvif port e.g 2020>
user: <http basic auth user>
pass: <http basic auth password>
The API can be launched in two ways: either directly via python or via docker.
Install the requirements from src/requirements.txt.
One option is to create a virtual environment:
python3 -m venv .venv
source .venv/bin/activate
pip install --upgrade pip
pip install -r src/requirements.txt
Then you can simply run the src/app.py
python3 src/app.py
To launch the app in a docker container, there is the compose.yaml.
Start the docker container by executing the following command in the working directory:
docker-compose up -d
This will build the docker image and launch a container on port 5000. Modify the compose.yaml as needed.
This will launch the API on port 5000.
To invoke the time setting function for a camera, call the API with the camera name, specified in the cams.conf:
Possible results are:
- 200: Time set successfully
- 404: Camera name not in config
- 500: Camera not reachable