Giter VIP home page Giter VIP logo

device-onvif-camera's Introduction

Onvif Camera Device Service

Build Status Code Coverage Go Report Card GitHub Latest Dev Tag) GitHub Latest Stable Tag) GitHub License GitHub go.mod Go version GitHub Pull Requests GitHub Contributors GitHub Committers GitHub Commit Activity

Warning
The main branch of this repository contains work-in-progress development code for the upcoming release, and is not guaranteed to be stable or working. It is only compatible with the main branch of edgex-compose which uses the Docker images built from the main branch of this repo and other repos.

The source for the latest release can be found at Releases.

General

Visit the EdgeX documentation page to learn more about the latest release.

License

Apache-2.0

device-onvif-camera's People

Contributors

ajcasagrande avatar christiandarr-personal avatar cloudxxx8 avatar dependabot[bot] avatar edgego avatar ejlee3 avatar ernestojeda avatar fabiopalumbo avatar farshidtz avatar felixting avatar gnunu avatar jumpingliu avatar lenny-intel avatar monicaisher avatar mpvats-intel avatar presatish avatar shafinj1 avatar soda480 avatar trleasher-intel avatar vli11 avatar vyshali-chitikeshi avatar weichou1229 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

device-onvif-camera's Issues

Tapo C200 camera becomes unresponsive after tried adding new scope

Default configuration consists of all fixed scopes. In order to execute 'SetScopes', I have tried to create new scope using AddScopes API. However, adding new scope was unsuccessful and camera becomes unresponsive after that. Had to reboot Tapo C200 camera to make it work again.

Set Credentials for ALL Cameras fails

🐞 Bug Report

Affected Services [REQUIRED]

The issue is located in:

Is this a regression?

Yes, the previous version in which this bug was not present was: before mac-v3 merge

Description and Minimal Reproduction [REQUIRED]

Run bin/set-credentials.sh, select ALL.

🔥 Exception or Error





image

🌍 Your Environment

Deployment Environment:

EdgeX Version [REQUIRED]:

Anything else relevant?

Need to update onvif image tag in add-device-onvif-camera.yml file

Need to change onvif image location in add-device-onvif-camera.yml file.

Currently it has below:
device-onvif-camera:
image: edgex/device-onvif-camera${ARCH}:${DEVICE_ONVIFCAM_VERSION}

It should change to below:
device-onvif-camera:
image: edgexfoundry/device-onvif-camera${ARCH}:${DEVICE_ONVIFCAM_VERSION}

Remove Docker Compose folder now that this is in Compose Builder

🚀 Feature Request

Relevant Package [REQUIRED]

doc/docker-compose folder

Description [REQUIRED]

This is no longer needed now that Compose Builder in edgex-compose has been update to included this
Also https://github.com/edgexfoundry/device-onvif-camera/blob/main/doc/auto-discovery-docker.md
needs to be reworked with compose builder in mind.

Describe the solution you'd like

remove folder and update main README to describe how to use Compose Builder, including any needed Env Overrides or changes in Consul

Describe alternatives you've considered

Have you considered any alternative solutions or workarounds?

Geo vision/Honeywell/Bosch camera- Set DNS API not working correctly

Summary of the problem:
Set DNS API not updating camera DNS settings correctly.

Issue reproducible on below camera models:
Geo Vision GV-BX8700
Honeywell HC30WB5R1
Able to enable/disable DHCP on Geo vision and Honeywell cameras, however not able to update IP address with 'DNS Manual"
Not getting any error, but IP address not updated when verified using Get DNS api.

Bosch DINION 6000HD
Enabling/disabling of DHCP not working

Repro steps:

  1. Execute get DNS rest api to retrieve existing DNS configuration
  2. Enable or disable DHCP using set DNS API
  3. Execute Get DNS api again to verify DNS settings
  4. Execute set DNS with dhcp set to false and updated ip address.
  5. Verify Get DNS api to verify updated Ip address.

Expected result: User should be able to enable/disable DHCP and updated ip address without any issues.
Actual result: On Geo vision camera it fails to set IP address, and on Bosch camera not able to enable/disable DHCP option.

attached set DNS api screenshot.
set_DNS

Discovery breaks when there are spaces in the Manufacturer or Model

edgex-device-onvif-camera | level=INFO ts=2022-03-18T16:37:50.421013331Z app=device-onvif-camera source=async.go:104 msg="Adding discovered device Bosch-DINION IP starlight 6000 HD-00075fc4-23b6-b623-c45f-0700075fc45f to Metadata"
edgex-device-onvif-camera | level=ERROR ts=2022-03-18T16:37:50.423403425Z app=device-onvif-camera source=async.go:120 msg="failed to create discovered device Bosch-DINION IP starlight 6000 HD-00075fc4-23b6-b623-c45f-0700075fc45f: request failed, status code: 400, err: {\"apiVersion\":\"v2\",\"message\":\"*[]requests.AddDeviceRequest json decoding failed\",\"statusCode\":400}\n"
edgex-core-metadata    | level=ERROR ts=2022-03-18T16:33:41.762359038Z app=core-metadata source=http.go:47 X-Correlation-ID=5d990b69-0331-44bf-8fed-15f0232bf0f1 msg="*[]requests.AddDeviceRequest json decoding failed -> AddDeviceRequest.Device.Name field only allows unreserved characters which are ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_~"

Version API doesn't return the SDK version

🐞 Bug Report

Affected Services [REQUIRED]

Version API

Is this a regression?

No

Description and Minimal Reproduction [REQUIRED]

Version API doesn't return the SDK version. Sample responses:

{
    "apiVersion": "v2",
    "version": "0.0.0",
    "serviceName": "device-onvif-camera",
    "sdk_version": "0.0.0"
}

The makefile here is missing the setting of the SDK version
https://github.com/edgexfoundry/device-onvif-camera/blob/main/Makefile#L22-L23
That is done here properly:
https://github.com/edgexfoundry/device-rfid-llrp-go/blob/main/Makefile#L21-L23

Note this looks to be an issue will many or all the Go Devices and App services

🌍 Your Environment

Deployment Environment:

EdgeX Version [REQUIRED]:

Anything else relevant?

Discovery fails for unauthorized devices

Observation
When discovering devices, if the device is password-protected, and the credentials do not match the default credentials, the device will not be added to EdgeX. This is because the GetDeviceInformation requires authentication.

Problem
Without these devices being added to EdgeX there is no way to assign credentials to them. Thus, currently your solution requires all auto-discovered cameras to share the same username, password, and authentication type (which is bad practice).

Proposed Solution

  • If a device fails the GetDeviceInformation, but it is still a valid ONVIF device, it should be added to EdgeX, so that the credentials can be added after the fact.
  • Fix #2 and you will be able to add devices with unique names even without authentication.

Bosch camera- Create users not working.

Summary of the problem:
'Create Users' API not creating new user.

Issue reproducible on below camera models:
#Bosch DINION 6000HD

Reproduce steps:

Execute this command to create a new user (Note : new user only creates through BOSH camera web-page login)

curl -X PUT http://localhost:59882/api/v2/device/name/Bosch-DINION-IP-starlight-6000-HD-00075fd8-7c31-317c-d85f-0700075fd85f/CreateUsers
--header 'Content-Type: application/json'
--data-raw '
{
"CreateUsers": {
"User": [
{
"Username": "Test",
"Password" : "Tes123456!",
"UserLevel": "User"
}
]
}
}'

Expected result: Create users api will creates an user successfully
Actual result: - fault code: SOAP-ENV:Receiver ter:Action -500 return code.

Error in Auto Discovery of Camera

🛑
I followed : https://github.com/edgexfoundry/device-onvif-camera/blob/main/doc/auto-discovery-docker.md ( i.e. Set Up Auto Discovery with Docker)
When I am running the containers I am getting a error in device-onvif-camera:
level=ERROR ts=2022-05-30T04:13:44.682604091Z app=device-onvif-camera source=init.go:42 msg="Failed to init cache: failed to send a http request -> Get "http://edgex-core-metadata:59881/api/v2/device/service/name/device-onvif-camera?limit=-1&offset=0\": dial tcp: lookup edgex-core-metadata on 192.168.0.1:53: read udp 192.168.0.115:33190->192.168.0.1:53: i/o timeout"
level=INFO ts=2022-05-30T04:13:44.682709107Z app=device-onvif-camera source=bootstrap.go:135 msg="Un-Registering service from the Registry"

AND

I followed: https://github.com/edgexfoundry/device-onvif-camera/blob/main/doc/auto-discovery.md (i.e. Auto Discovery)
When I am running the containers I am getting a error in device-onvif-camera:
level=INFO ts=2022-05-30T04:31:51.942762705Z app=device-onvif-camera source=devices.go:49 msg="Loading pre-defined devices from /res/devices"
level=INFO ts=2022-05-30T04:31:51.943721555Z app=device-onvif-camera source=devices.go:85 msg="Device device-onvif-camera exists, using the existing one"
level=INFO ts=2022-05-30T04:31:51.943814738Z app=device-onvif-camera source=message.go:50 msg="Service dependencies resolved..."
level=INFO ts=2022-05-30T04:31:51.943840422Z app=device-onvif-camera source=message.go:51 msg="Starting device-onvif-camera 0.0.0 "
level=INFO ts=2022-05-30T04:31:51.944104305Z app=device-onvif-camera source=message.go:55 msg="Camera device service started"
level=INFO ts=2022-05-30T04:31:51.944130546Z app=device-onvif-camera source=message.go:58 msg="Service started in: 1.279078281s"
level=INFO ts=2022-05-30T04:31:51.94394255Z app=device-onvif-camera source=autodiscovery.go:51 msg="Starting auto-discovery with duration 10s"
level=DEBUG ts=2022-05-30T04:31:51.944162915Z app=device-onvif-camera source=discovery.go:34 msg="protocol discovery triggered"
route ip+net: no such network interface
level=DEBUG ts=2022-05-30T04:31:52.946479407Z app=device-onvif-camera source=async.go:127 msg="Filtered device addition finished"
level=DEBUG ts=2022-05-30T04:32:02.946596983Z app=device-onvif-camera source=discovery.go:34 msg="protocol discovery triggered"
route ip+net: no such network interface
level=DEBUG ts=2022-05-30T04:32:03.949196507Z app=device-onvif-camera source=async.go:127 msg="Filtered device addition finished"
level=DEBUG ts=2022-05-30T04:32:13.949314222Z app=device-onvif-camera source=discovery.go:34 msg="protocol discovery triggered"
route ip+net: no such network interface

Can someone please help me in resolving the above mentioned errors or what can be the cause of the issue?
Thanks in advance.

Bosch camera- Configuration Analytics profile-Remove Configuration not removeing newly added configuration.

Summary of the problem:
'Remove Configuration' API not working.

Issue reproducible on below camera models:
#Bosch DINION 6000HD

Reproduce steps:

Execute this command to set Set metadata configuration

command -add configuration -

Step #1:

curl -X PUT http://localhost:59882/api/v2/device/name/Bosch-DINION-IP-starlight-6000-HD-00075fd8-7c31-317c-d85f-0700075fd85f/AddConfiguration
--header 'Content-Type: application/json'
--data-raw '
{
"AddConfiguration":{
"ProfileToken":"0",
"Name":"Analytics #3",
"Configurations":[
{
"Type":"tt:Viproc",
"Token":"1"
}
]
}
}'

Step #2
Verify with getProfiles command - new configuraiton added sccess fully.
curl -X GET http://localhost:59882/api/v2/device/name/Bosch-DINION-IP-starlight-6000-HD-00075fd8-7c31-317c-d85f-0700075fd85f/Media2Profiles

Step #3
Command to remove the newly added configuration -

curl -X PUT http://localhost:59882/api/v2/device/name/Bosch-DINION-IP-starlight-6000-HD-00075fd8-7c31-317c-d85f-0700075fd85f/RemoveConfiguration\
--header 'Content-Type: application/json'
--data-raw '
{
"RemoveConfiguration": {
"ProfileToken": "0",
"Configurations": [
{
"Type": "tt:Viproc",
"Token": "1"
}
]
}
}'

Executed successfully - but not removed properly verify with GetProfiles command-

Bosch camera- Set metadata configuration not working

Summary of the problem:
'Set metadata configuration' API not working.

Issue reproducible on below camera models:
#Bosch DINION 6000HD

Reproduce steps:
Executed this below command to set-meta data configuration -

curl -C PUT http://localhost:59882/api/v2/device/name/Bosch-DINION-IP-starlight-6000-HD-00075fd8-7c31-317c-d85f-0700075fd85f/MetadataConfiguration
--header 'Content-Type: application/json'
--data-raw '
{
"MetadataConfiguration": {
"Configuration": {
"Token": "1",
"SessionTimeout": "PT60S"
}
}
}'

Expected result: set users api will set metadata configuration successfully
Actual result: - fault code: SOAP-ENV:Receiver ter:Action -500 return code.

Bosch camera- Create Rules - Adding same rule if same create comamnd executes multiple times with same parameter.

Summary of the problem:
'Create Rules' API adding multiple times same rule.

Issue reproducible on below camera models:
#Bosch DINION 6000HD

Reproduce steps:

Command to create rule

curl -X PUT http://localhost:59882/api/v2/device/name/Bosch-DINION-IP-starlight-6000-HD-00075fd8-7c31-317c-d85f-0700075fd85f/CreateRules
--header 'Content-Type: application/json'
--data-raw '

{
"CreateRules": {
    "ConfigurationToken": "1",
    "Rule": [
        {
            "Name": "Test1",
            "Type": "tt:ObjectInField",
            "Parameters": {
                "SimpleItem": [
                    {
                        "Name": "Armed",
                        "Value": "true"
                    }
                ]
            }
        }
    ]
}

}'

Then verify with GetRules command-
curl -x GET GET http://localhost:59882/api/v2/device/name/Bosch-DINION-IP-starlight-6000-HD-00075fd8-7c31-317c-d85f-0700075fd85f/Rules

Actual result - Adding multiple times same rule.
Executed - Should be create one for same rule.

Get credentials retry loop ignores SIGINT

The GetCredentials rety loop is not hooked up with any other signaling to cancel when a SIGINT or other is sent to the process. This will delay shutdown as either the timer has to run out or the user has to SIGKILL the process.

🔥 Exception or Error


level=WARN ts=2022-06-16T21:38:54.879604779Z app=device-onvif-camera source=credentials.go:61 msg="Unable to retrieve camera credentials from SecretProvider at path '3fa1fe68-b915-4053-a3e1-1027f5ea88f4': Error, path (3fa1fe68-b915-4053-a3e1-1027f5ea88f4) doesn't exist in secret store. Retrying for 1m32.987007063s"
level=WARN ts=2022-06-16T21:38:55.879965419Z app=device-onvif-camera source=credentials.go:61 msg="Unable to retrieve camera credentials from SecretProvider at path '3fa1fe68-b915-4053-a3e1-1027f5ea88f4': Error, path (3fa1fe68-b915-4053-a3e1-1027f5ea88f4) doesn't exist in secret store. Retrying for 1m31.986646081s"
level=WARN ts=2022-06-16T21:38:56.880378244Z app=device-onvif-camera source=credentials.go:61 msg="Unable to retrieve camera credentials from SecretProvider at path '3fa1fe68-b915-4053-a3e1-1027f5ea88f4': Error, path (3fa1fe68-b915-4053-a3e1-1027f5ea88f4) doesn't exist in secret store. Retrying for 1m30.986235633s"
^C
level=INFO ts=2022-06-16T21:38:57.799049308Z app=device-onvif-camera source=config.go:318 msg="Watching for 'AppCustom' configuration changes has stopped"
level=INFO ts=2022-06-16T21:38:57.799666781Z app=device-onvif-camera source=messaging.go:88 msg="Disconnected from MessageBus"
level=INFO ts=2022-06-16T21:38:57.799047447Z app=device-onvif-camera source=config.go:467 msg="Watching for '/Writable' configuration changes has stopped"
level=INFO ts=2022-06-16T21:38:57.799768165Z app=device-onvif-camera source=httpserver.go:126 msg="Web server shutting down"
level=ERROR ts=2022-06-16T21:38:57.799842391Z app=device-onvif-camera source=httpserver.go:143 msg="Web server failed: http: Server closed"
level=INFO ts=2022-06-16T21:38:57.801041628Z app=device-onvif-camera source=httpserver.go:128 msg="Web server shut down"
level=WARN ts=2022-06-16T21:38:57.881311693Z app=device-onvif-camera source=credentials.go:61 msg="Unable to retrieve camera credentials from SecretProvider at path '3fa1fe68-b915-4053-a3e1-1027f5ea88f4': Error, path (3fa1fe68-b915-4053-a3e1-1027f5ea88f4) doesn't exist in secret store. Retrying for 1m29.985302169s"
level=WARN ts=2022-06-16T21:38:58.882085199Z app=device-onvif-camera source=credentials.go:61 msg="Unable to retrieve camera credentials from SecretProvider at path '3fa1fe68-b915-4053-a3e1-1027f5ea88f4': Error, path (3fa1fe68-b915-4053-a3e1-1027f5ea88f4) doesn't exist in secret store. Retrying for 1m28.984519117s"
level=WARN ts=2022-06-16T21:38:59.882383818Z app=device-onvif-camera source=credentials.go:61 msg="Unable to retrieve camera credentials from SecretProvider at path '3fa1fe68-b915-4053-a3e1-1027f5ea88f4': Error, path (3fa1fe68-b915-4053-a3e1-1027f5ea88f4) doesn't exist in secret store. Retrying for 1m27.984228452s"

Anything else relevant?

Should probably use similar code to the taskLoop

Bosch camera- Delete Rules - Not deleting if same rule is added mutliple times.

Summary of the problem:
'Delete Rules' API not working for same rule if added multiple times.

Issue reproducible on below camera models:
#Bosch DINION 6000HD

Reproduce steps:
Execute this command

curl -X PUT http://localhost:59882/api/v2/device/name/Bosch-DINION-IP-starlight-6000-HD-00075fd8-7c31-317c-d85f-0700075fd85f/DeleteRules
--header 'Content-Type: application/json'
--data-raw '
{
"DeleteRules": {
"ConfigurationToken": "1",
"Rule": [
{
"RuleName": "NEW object"
},
{
"RuleName": "Armed"
}
]
}
}'

Then verify with GetRules command-
curl -x GET GET http://localhost:59882/api/v2/device/name/Bosch-DINION-IP-starlight-6000-HD-00075fd8-7c31-317c-d85f-0700075fd85f/Rules

Actual result - Not deleting rule
Executed - Should be deleted rule

Geo vision/Honey well/Bosch camera- Set video encoder configuration not working correctly

Summary of the problem:
Not able to update video encoder configuration using 'set video encoder configuration' API

Issue reproducible on below camera models:
Geo Vision GV-BX8700
Bosch DINION 6000HD
Honeywell HC30WB5R1

Repro steps:

  1. Execute Get video encoder configuration API to retrieve existing video encoder configuration details
  2. Update video encoder configuration using 'set video encoder configuration'. For e.g. Govlength different than default
  3. Intermittently its giving SOAP error on some cameras (Bosch), sometimes it wont give any error but not updating video encoder values as expected.

Expected result: able to update video encoder configuration values correctly
Actual result: set video encoder configuration api not working as expected.

netscan discovery was called, but DiscoverySubnets are empty!

📚 Docs or Wiki Bug Report

Description [REQUIRED]

According to the steps of

auto-discovery-docker.md i get an msg below:

level=WARN ts=2022-07-01T07:46:12.894347595Z app=device-onvif-camera source=driver.go:580 msg="netscan discovery was called, but DiscoverySubnets are empty!"

and i found the DiscoverySubnets is empty in configration.toml which is in device-onvif-camera container

and i can not change it because it's read_only

what can i do now?

Missing device service API specification

📚 Docs or Wiki Bug Report

Description [REQUIRED]

The API of the device service translates REST/HTTP requests to SOAP/HTTP. The onvif features section of README links to ONVIF specs which document the SOAP API.
Things are straight forward when it comes to GET commands. However, it isn't that easy to figure out the data model of the input.
The only documented example of a SET command is in docs/getting-started-guide.

It took me some time to figure out how to do a RelativeMove. This only became obvious after I accidentally discovered the device-onvif-camera's Postman collection. It would be nice to make that more accessible. I could use that to figure out how to do RelativeMove:

curl -X PUT http://0.0.0.0:59882/api/v2/device/name/tp-link-Tapo-C210-3fa1fe68-b915-4053-a3e1-14ebb69b5003/RelativeMove -H 'Content-Type: application/json' \
    -d '{"RelativeMove": {"ProfileToken": "profile_1","Translation": {"PanTilt": {"x": 50,"y": 50}}}}'

which isn't obvious by just looking at the onvif spec:
image

I think instead of the Postman collection, the service should publish the spec based on the default camera.yaml profile using OpenAPI spec, added to the docs with Swagger UI.

🔬 Minimal Reproduction

What's the affected URL? [REQUIRED]

https://github.com/edgexfoundry/device-onvif-camera/tree/main/doc

Expected vs Actual Behavior

API specification is not available.

Unable to configure and launch device-onvif-camera

Hello

I am trying to setup a video streaming from my mobile to edgex. Following steps have been followed: -

  1. Installed IP Camera app on my android mobile
  2. Included device-onvif container in my docker-compose
  3. Tried to configure device and profile by changing relevant parameters
  4. device address and port = ip and port displayed on mobile by IP Phone app
  5. EndpointRefAddress = my laptop wifi ip address
  6. BaseNotificationURL = ip and port displayed on mobile by IP Phone app
  7. [AppCustom.CredentialsMap]
    credentials001 = MAC address of my mobile
  8. Updated Generic-Onvif-Provision-Watcher.json. identifier address = ip and port displayed on mobile by IP Phone app
  9. Added 3 parameters in docker-compose - DEVICE_DEVICESDIR: /custom-config/devices
    DEVICE_PROFILESDIR: /custom-config/profiles
    DEVICE_PROVISIONWATCHERDIR: /custom-config/provision_watchers (not sure about this one, how can we override provision watcher location??)

Attaching config files for reference as well as error log from docker desktop. Any help to resolve this will be highly appreciated. Thanks in advance.
config and log.zip

Geo vision/Honey well/Bosch camera- Set scopes API not working correctly

Summary of the problem:
Set scope API deleting all configurable scopes instead of updating scope item.

Issue reproducible on below camera models:
Geo Vision GV-BX8700
Bosch DINION 6000HD
Honeywell HC30WB5R1

Repro steps:

  1. Execute get scopes rest api to retrieve existing scopes
  2. If there are no existing 'configurable' scopes, then add 2 new scopes with 'Add scopes' API
  3. Execute get scopes api and check 2 new configurable scopes have added
  4. Execute set scopes api to update all configurable scopes with updated scope item. Attached is the postman screenshot showing how we are executing 'set scopes' api.

Expected result: all configurable scopes updated correctly with desired scope item mentioned in 'set scopes' command
Actual result: Deletes all configurable scopes

Note: Not getting any error after executing ' set scopes' api, it gives 200/success message.

Docker build failing in latest main

Step 13/23 : RUN ${MAKE}
 ---> Running in 0e1f4ef4bbdb
CGO_ENABLED=1 GO111MODULE=on go build -ldflags "-X github.com/edgexfoundry/device-onvif-camera.Version=0.0.0" -o cmd/device-onvif-camera ./cmd
go: updates to go.mod needed; to update it:
        go mod tidy
make: *** [Makefile:19: cmd/device-onvif-camera] Error 1
The command '/bin/sh -c ${MAKE}' returned a non-zero code: 2

Unable to retrieve camera credentials from SecretProvider at path 'credentials001': No value for the keys: [mode] exists. Retrying for 11.859810351s

i follow getting-started-with-docker-security.md, getting-started-with-docker.md, Run device-onvif-camera with edgex-compose to config device-onvif-camera,the auto discovery can work, but the log has the warn info below

Unable to retrieve camera credentials from SecretProvider at path 'credentials001': No value for the keys: [mode] exists. Retrying for 11.859810351s

i has do secret, like this, the return code is 201 that i think is success, so what can i do now

root@xinyustorage:~# curl --request POST 'http://localhost:59984/api/v2/secret' --header 'Content-Type: application/json' --data-raw '{
"apiVersion":"v2",
"path": "credentials001",
"secretData":[
{
"key":"username",
"value":"admin"
},
{
"key":"password",
"value":"Admin12345"
}
]
}'
{"apiVersion":"v2","statusCode":201}

Startup delay/blocking when missing credentials

On startup, the service attempts to create a device client for each registered device. This causes it to lookup the camera credentials secrets. When the secrets do not exist, it waits up to 2 minutes for them, for each device. This all happens serially and delays the starting of the service.

level=INFO ts=2022-03-29T00:39:55.184382784Z app=device-onvif-camera source=driver.go:86 msg="Initializing device client for '3fa1fe68-b915-4053-a3e1-1027f5ea88f4' camera"
level=WARN ts=2022-03-29T00:39:55.184402418Z app=device-onvif-camera source=driver.go:283 msg="Unable to retrieve camera credentials from SecretProvider at path '3fa1fe68-b915-4053-a3e1-1027f5ea88f4': Error, path (3fa1fe68-b915-4053-a3e1-1027f5ea88f4) doesn't exist in secret store. Retrying for 1m59.999998509s"
level=WARN ts=2022-03-29T00:39:56.184607352Z app=device-onvif-camera source=driver.go:283 msg="Unable to retrieve camera credentials from SecretProvider at path '3fa1fe68-b915-4053-a3e1-1027f5ea88f4': Error, path (3fa1fe68-b915-4053-a3e1-1027f5ea88f4) doesn't exist in secret store. Retrying for 1m58.999817495s"
...
level=ERROR ts=2022-03-29T00:41:55.234543205Z app=device-onvif-camera source=driver.go:90 msg="failed to initial device client for '3fa1fe68-b915-4053-a3e1-1027f5ea88f4' camera, skipping this device."

https://github.com/edgexfoundry-holding/device-onvif-camera/blob/27426708967fb713f3ef9396d946112ad1b0b7a6/internal/driver/driver.go#L80-L91

checkStatuses takes too long to complete

🐞 Bug Report

Description and Minimal Reproduction [REQUIRED]

  • Run device-onvif-camera and connect it to 10 simulated or real onvif cameras.
  • Disconnect the cameras
  • Take note of how long it takes to complete the checkStatuses call

For me, this took about 44 seconds when running as stated above. Using multiple goroutines is able to shorten that to about 11 seconds, but still pretty long.

Obviously this will cause issues, as the default time period between checks are 30 seconds, so the code needs to complete before then.

🔥 Exception or Error





🌍 Your Environment

Deployment Environment:

EdgeX Version [REQUIRED]:

Anything else relevant?

Build docker image failed due to "libcurl-7.80.0-r1: package mentioned in index not found"

Environment: Ubuntu 20.04 LTS

Please see the full log:

$ make docker
docker build . \
	--build-arg http_proxy= \
	--build-arg https_proxy= \
	--build-arg no_proxy= \
	-t edgexfoundry/device-onvif-camera:1194f4c37254434fbe91228c6fb68d2a7544bc72 \
	-t edgexfoundry/device-onvif-camera:0.0.1-dev.20-dev
Sending build context to Docker daemon  165.9MB
Step 1/23 : ARG BASE=golang:1.17-alpine3.15
Step 2/23 : FROM ${BASE} AS builder
 ---> 862d0b7eee94
Step 3/23 : ARG MAKE="make build"
 ---> Using cache
 ---> c4da64680ca2
Step 4/23 : ARG ALPINE_PKG_BASE="make git gcc libc-dev zeromq-dev libsodium-dev"
 ---> Using cache
 ---> 084c1ba974c1
Step 5/23 : ARG ALPINE_PKG_EXTRA=""
 ---> Using cache
 ---> a8512d659cef
Step 6/23 : LABEL Name=edgex-device-onvif-camera
 ---> Using cache
 ---> dd57e68fa0e7
Step 7/23 : RUN sed -e 's/dl-cdn[.]alpinelinux.org/nl.alpinelinux.org/g' -i~ /etc/apk/repositories
 ---> Using cache
 ---> 93d717721dea
Step 8/23 : RUN apk add --no-cache ${ALPINE_PKG_BASE} ${ALPINE_PKG_EXTRA}
 ---> Running in def34c0717a2
fetch https://nl.alpinelinux.org/alpine/v3.15/main/x86_64/APKINDEX.tar.gz
fetch https://nl.alpinelinux.org/alpine/v3.15/community/x86_64/APKINDEX.tar.gz
(1/25) Installing libgcc (10.3.1_git20211027-r0)
(2/25) Installing libstdc++ (10.3.1_git20211027-r0)
(3/25) Installing binutils (2.37-r3)
(4/25) Installing libgomp (10.3.1_git20211027-r0)
(5/25) Installing libatomic (10.3.1_git20211027-r0)
(6/25) Installing libgphobos (10.3.1_git20211027-r0)
(7/25) Installing gmp (6.2.1-r1)
(8/25) Installing isl22 (0.22-r0)
(9/25) Installing mpfr4 (4.1.0-r0)
(10/25) Installing mpc1 (1.2.1-r0)
(11/25) Installing gcc (10.3.1_git20211027-r0)
(12/25) Installing brotli-libs (1.0.9-r5)
(13/25) Installing nghttp2-libs (1.46.0-r0)
(14/25) Installing libcurl (7.80.0-r1)
(15/25) Installing expat (2.4.7-r0)
ERROR: libcurl-7.80.0-r1: package mentioned in index not found (try 'apk update')
(16/25) Installing pcre2 (10.40-r0)
(17/25) Installing git (2.34.2-r0)
(18/25) Installing musl-dev (1.2.2-r7)
(19/25) Installing libc-dev (0.7.2-r3)
(20/25) Installing libsodium (1.0.18-r0)
(21/25) Installing pkgconf (1.8.0-r0)
(22/25) Installing libsodium-dev (1.0.18-r0)
(23/25) Installing make (4.3-r0)
(24/25) Installing libzmq (4.3.4-r0)
(25/25) Installing zeromq-dev (4.3.4-r0)
Executing busybox-1.34.1-r5.trigger
1 error; 141 MiB in 39 packages
The command '/bin/sh -c apk add --no-cache ${ALPINE_PKG_BASE} ${ALPINE_PKG_EXTRA}' returned a non-zero code: 1
make: *** [Makefile:37: docker] Error 1

Geo vision/Bosch camera- Set system date and time not working correctly

Summary of the problem:
Set system date and time API not working as expected .

Issue reproducible on below camera models:
Geo Vision GV-BX8700
On Geo Vision camera, NTP enable/disable works correctly but not able to set date manually.

Bosch DINION 6000HD
On Bosch camera, NTP enable/disable does not work and not able to set date manually.

Repro steps:

  1. Execute get system date and time api to retrieve current camera date and time settings.
  2. Enable/disable NTP and try updating system date and time using set system date and time API.
  3. Execute get system date and time to verify updated date and time settigns.

Expected result: User able to set date NTP settings and set date manually.
Actual result:
On Geo Vision camera, NTP enable/disable works correctly but not able to set date manually.
On Bosch camera, NTP enable/disable does not work and not able to set date manually.

attached set system date and time APi screenshot
set_system_date_and_time
.

Geo vision/Honey well/Bosch camera- Delete user not working

Summary of the problem:
'Delete Users' API not deleting users.

Issue reproducible on below camera models:
Geo Vision GV-BX8700
Bosch DINION 6000HD
Honeywell HC30WB5R1

Repro steps:

  1. add new test user as user/orator 'add user' api
  2. Execute get users to verify newly created user details
  3. Delete test user which is created in step 1 using 'Delete Users' API.
  4. Execute get users api to verify deletion of test user.

Expected result: Delete users api deletes user successfully
Actual result: Not getting any error after executing delete users api, but its not deleting user.

Attached delete user API screenshot.
delete_users

Panic during AutoEvent - reading Users

NOTE: This issue happens randomly, and is not always reproduce-able.

Provision Watcher

{
  "provisionwatcher":{
     "apiVersion":"v2",
     "name":"Test-Provision-Watcher_Emulator",
     "adminState":"UNLOCKED",
     "identifiers":{
        "Manufacturer": "Happytimesoft",
        "Model": "IPCamera"
     },
     "serviceName": "device-onvif-camera",
     "profileName": "onvif-camera",
     "autoEvents": [
         { "interval": "15s", "sourceName": "Users" }
      ]
  },
  "apiVersion":"v2"
}

Panic

level=DEBUG ts=2022-02-17T17:23:55.687729987Z app=device-onvif-camera source=discovery.go:35 msg="protocol discovery triggered"
Onvif WS-Discovery: Find 192.168.0.215:2020 
Onvif WS-Discovery: Find 192.168.0.53:5357 
Error 192.168.0.53:5357
camera is not available at 192.168.0.53:5357 or it does not support ONVIF services
level=DEBUG ts=2022-02-17T17:23:56.759283954Z app=device-onvif-camera source=onvifclient.go:227 msg="SOAP Request: <tds:GetDeviceInformation></tds:GetDeviceInformation>"
level=DEBUG ts=2022-02-17T17:23:56.789358733Z app=device-onvif-camera source=onvifclient.go:245 msg="SOAP Response: <GetDeviceInformationResponse><Manufacturer>TP-Link</Manufacturer><Model>C200</Model><FirmwareVersion>1.1.16 Build 211209 Rel.37726n(4555)</FirmwareVersion><SerialNumber>00c20000</SerialNumber><HardwareId>1.0</HardwareId></GetDeviceInformationResponse>"
level=DEBUG ts=2022-02-17T17:23:56.789400759Z app=device-onvif-camera source=driver.go:333 msg="Discovered camera from the address '192.168.0.215:2020'"
level=DEBUG ts=2022-02-17T17:23:56.789450723Z app=device-onvif-camera source=async.go:140 msg="Device TP-Link-C200-00c20000's Manufacturer value TP-Link did not match PW identifier: Happytimesoft"
level=DEBUG ts=2022-02-17T17:23:56.789476407Z app=device-onvif-camera source=async.go:127 msg="Filtered device addition finished"
level=DEBUG ts=2022-02-17T17:24:10.68887651Z app=device-onvif-camera source=executor.go:52 msg="AutoEvent - reading Users"
level=DEBUG ts=2022-02-17T17:24:10.688932544Z app=device-onvif-camera source=command.go:127 msg="Application - readDeviceResource: reading deviceResource: Users; X-Correlation-ID: "
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x28 pc=0x8efc0e]
goroutine 61 [running]:
github.com/IOTechSystems/device-onvif-camera/internal/driver.(*DeviceClient).callOnvifFunction(0x0, 0xc00058b560, 0x6, 0xc00058b568, 0x8, 0xdf8c70, 0x0, 0x0, 0x0, 0x0, ...)
    /device-onvif-camera/internal/driver/onvifclient.go:217 +0x14e
github.com/IOTechSystems/device-onvif-camera/internal/driver.(*DeviceClient).CallOnvifFunction(0x0, 0xc00011c8f7, 0x5, 0xc00009bb30, 0xc00011c910, 0x6, 0xa36b4c, 0xb, 0xdf8c70, 0x0, ...)
    /device-onvif-camera/internal/driver/onvifclient.go:143 +0x14b
github.com/IOTechSystems/device-onvif-camera/internal/driver.(*Driver).HandleReadCommands(0xc0003dec00, 0xc000028ac0, 0x1d, 0xc0005122d0, 0xc00009af00, 0x1, 0x1, 0x1, 0x5, 0x0, ...)
    /device-onvif-camera/internal/driver/driver.go:146 +0x1ba
github.com/edgexfoundry/device-sdk-go/v2/internal/application.(*CommandProcessor).ReadDeviceResource(0xc00053bba8, 0xc0005159e0, 0xc, 0xc0005159db)
    /go/pkg/mod/github.com/edgexfoundry/device-sdk-go/[email protected]/internal/application/command.go:146 +0x55b
github.com/edgexfoundry/device-sdk-go/v2/internal/application.CommandHandler(0x970001, 0x0, 0x0, 0xc0005cdd78, 0x0, 0x0, 0x0, 0xc0003d5620, 0x0, 0x0, ...)
    /go/pkg/mod/github.com/edgexfoundry/device-sdk-go/[email protected]/internal/application/command.go:107 +0x59d
github.com/edgexfoundry/device-sdk-go/v2/internal/autoevent.readResource(0xc0000c2190, 0xc0003d5620, 0x16, 0xc0002984f0, 0x1)
    /go/pkg/mod/github.com/edgexfoundry/device-sdk-go/[email protected]/internal/autoevent/executor.go:89 +0x1a6
github.com/edgexfoundry/device-sdk-go/v2/internal/autoevent.(*Executor).Run(0xc0000c2190, 0xae8c58, 0xc0003dec40, 0xc000416110, 0xc0000c6070, 0xc0003d5620)
    /go/pkg/mod/github.com/edgexfoundry/device-sdk-go/[email protected]/internal/autoevent/executor.go:53 +0x296
created by github.com/edgexfoundry/device-sdk-go/v2/internal/autoevent.(*manager).triggerExecutors
    /go/pkg/mod/github.com/edgexfoundry/device-sdk-go/[email protected]/internal/autoevent/manager.go:78 +0x245

Device Discovery should use EndpointReference for uniqueness

Observation
We have discovered that our Tapo C200 cameras all return the same serial number when queried via GetDeviceInformation.
We have also learned that the happytime-multi-onvif-server sets all camera serial numbers to 123456 by default.

Problem
Only 1 device of each type Tapo C200 and happytime can be added to EdgeX due to name conflicts.

Proposed Solution

Use the Endpoint Reference as specified in the ONVIF spec. This is available during WS-Discovery:

7.3.1 Endpoint reference
A device or an endpoint that takes the client role should use a URN:UUID [RFC4122] as the address property
of its endpoint reference.

The device or an endpoint that takes the client role shall use a stable, globally unique identifier that is constant
across network interfaces
as part of its endpoint reference property. The combination of an wsadis:Address
and wsadis:ReferenceProperties provide a stable and globally-unique identifier.

Source

We have indeed confirmed that even when the device IP address changes, the EndpointReference stays the same, and is unique to all of our cameras.

[Bosch] Setuser can modify only if user is created through camera web interface

Summary of the problem:
'Set Users' API working only if new user through camera web-interface.

Issue reproducible on below camera models:
#Bosch DINION 6000HD

Reproduce steps:

Execute this command to set a new user (Note : new user only create through bosch camera web-page login)

curl -X PUT http://localhost:59882/api/v2/device/name/Bosch-DINION-IP-starlight-6000-HD-00075fd8-7c31-317c-d85f-0700075fd85f/Users
--header 'Content-Type: application/json'
--data-raw '
{
"Users":{
"Username":"User",
"Password":"Password1123!",
"UserLevel":"User"
}
}'

Expected result: set users api will modify an user successfully
Actual result: - fault code: SOAP-ENV:Receiver ter:Action -500 return code.

Bosch/Geo Vision/Hikvision cameras- Set network interfaces API not working correctly

Summary of the problem:
Not able to enable/disable DHCP with set network interfaces api on Bosch camera

Issue reproducible on below camera models:
Bosch DINION 6000HD

Repro steps:

  1. Execute get network interfaces command to retrieve existing network interfaces configuration
  2. Execute set network interface to enable and/or dhcp option.
  3. Execute get network interfaces command to verify updated network interfaces configuration
    Expected result: User should be able to enable/disable DHCP on network interface using set network interfaces api.
    Actual result: Enabling/Disabling of DHCP fails.

attached set network interfaces api screenshot
set_network_interfaces

Can DisconnectDevice be safely removed?

Why does DisconnectDevice exist? It does not appear to implement any interface, and it just warns that it is not implemented. Can it be safely removed?

// DisconnectDevice handles protocol-specific cleanup when a device
// is removed.
func (d *Driver) DisconnectDevice(deviceName string, protocols map[string]models.ProtocolProperties) error {
d.lc.Warn("Driver's DisconnectDevice function not implemented")
return nil
}

Core data client issues fatal errors

What is this client used for? I have been running this service in an environment without core-data and the software stack works just fine.

https://github.com/edgexfoundry-holding/device-onvif-camera/blob/72c31d4250f40c982c4b3924e6f71b4c9e8a6948/cmd/res/configuration.toml#L61-L64

However, something about the last 4 commits has broken it, as i get an endless stream of errors:

level=WARN ts=2022-05-05T03:47:31.959858833Z app=device-onvif-camera source=clients.go:137 msg="unable to Get service endpoint for 'core-data': no matching service endpoint found. retrying..."
level=WARN ts=2022-05-05T03:47:32.961778923Z app=device-onvif-camera source=clients.go:137 msg="unable to Get service endpoint for 'core-data': no matching service endpoint found. retrying..."
level=WARN ts=2022-05-05T03:47:33.962877041Z app=device-onvif-camera source=clients.go:137 msg="unable to Get service endpoint for 'core-data': no matching service endpoint found. retrying..."
level=WARN ts=2022-05-05T03:47:34.964178535Z app=device-onvif-camera source=clients.go:137 msg="unable to Get service endpoint for 'core-data': no matching service endpoint found. retrying..."
level=WARN ts=2022-05-05T03:47:35.965569188Z app=device-onvif-camera source=clients.go:137 msg="unable to Get service endpoint for 'core-data': no matching service endpoint found. retrying..."
level=WARN ts=2022-05-05T03:47:36.966632657Z app=device-onvif-camera source=clients.go:137 msg="unable to Get service endpoint for 'core-data': no matching service endpoint found. retrying..."
level=WARN ts=2022-05-05T03:47:37.967566331Z app=device-onvif-camera source=clients.go:137 msg="unable to Get service endpoint for 'core-data': no matching service endpoint found. retrying..."
level=WARN ts=2022-05-05T03:47:38.968655964Z app=device-onvif-camera source=clients.go:137 msg="unable to Get service endpoint for 'core-data': no matching service endpoint found. retrying..."
level=WARN ts=2022-05-05T03:47:39.969798371Z app=device-onvif-camera source=clients.go:137 msg="unable to Get service endpoint for 'core-data': no matching service endpoint found. retrying..."

I think it may be related to the security hardening PR. The service no longer starts.

HTTP 503 error responses from core command

This seems to happen when the device service is stuck in a getCredentials retry loop. Even devices which DO have proper authentication are getting 503 errors when being called by the command service. I assume this is due to some sort of blocking or botteneck occurring in the sdk from the getCredentials loop.

image

Bosch camera- modify Rule - If multiple same rule added then no modfication but if only one time added a rule then it works.

Summary of the problem:
'modify Rule' API not working for same rule if added multiple times.

Issue reproducible on below camera models:
#Bosch DINION 6000HD

Reproduce steps:
Execute this command

Step #1
created rule multiple times with same parameter- same rule are added as previous issue report.(issue #35)

Step #2
Modifying the same added rule -

curl -X PUT http://localhost:59882/api/v2/device/name/Bosch-DINION-IP-starlight-6000-HD-00075fd8-7c31-317c-d85f-0700075fd85f/Rules
--header 'Content-Type: application/json'
--data-raw '
{
"Rules": {
"ConfigurationToken": "1",
"Rule": [
{
"Name": "Test1",
"Type": "tt:ObjectInField",
"Parameters": {
"SimpleItem": [
{
"Name": "Armed",
"Value": "true"
}
]
}
}
]
}
}
'

Then verify with GetRules command-
curl -x GET GET http://localhost:59882/api/v2/device/name/Bosch-DINION-IP-starlight-6000-HD-00075fd8-7c31-317c-d85f-0700075fd85f/Rules

Actual result - Not modifying rule, but working if rule is added one time only.
Executed - Should be modifying all same rule added before.

Service should support ONVIF snapshots

As discussed at today's TSC meeting since the plan is to deprecate the existing device-camera service once this service has been released, we should ensure that this service provides the capability to capture camera snapshots (e.g. see the OnvifSnapshot device resources in the old service), as otherwise we're not replacing the existing functionality.

Bosch camera- Modify Analytics Modules not working.

Summary of the problem:
'Modify Analytics Modules' API not working.

Issue reproducible on below camera models:
#Bosch DINION 6000HD

Reproduce steps:

Execute this command to Modify Analytics Modules

curl -X PUT http://localhost:59882/api/v2/device/name/Bosch-DINION-IP-starlight-6000-HD-00075fd8-7c31-317c-d85f-0700075fd85f/AnalyticsModules
--header 'Content-Type: application/json'
--data-raw '

{
"AnalyticsModules": {
    "ConfigurationToken": "1",
    "AnalyticsModule": [
        {
            "Name": "Viproc",
            "Parameters": {
                "SimpleItem": [
                    {
                        "Name": "Mode",
                        "Value": "Profile 144"
                    }
                ]
            }
        }
    ]
}

}'

Actual result - Soap error, 500
Executed - should be successfully modify

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.