Is the Nx Cloud up? Visit our Status Page for the current health and performance of the Nx Cloud.

Status Page

Bug with doSetSettings of class ConsumingDeviceAgent under Windows 10

Answered

Comments

12 comments

  • Anton Babinov
    • Network Optix team

    Hi Yves,


    I did a quick test with your code on my Windows 10 machine and the issue didn't occur. It's unlikely that the issue is caused by different behavior on the different Windows versions. Could you please tell me VMS builds(4.1.0.xxxxx) numbers of your Win7 and Win10 machines and SDK version which you use to compile the plugin(you can find it in metadata_sdk/src/nx_sdk_version.inc file)?


    Also please show me the log from the Win10 machine after the following scenario:
    1. start Nx Witness
    2. Open PowerShell and run commands

    cd "C:\Windows\System32\config\systemprofile\AppData\Local\nx_ini"

    Get-Content -Path .\mediaserver_stderr.log -Wait

    3. start testCamera (this is optional)
    4. activated my test_plugin (contains a single toggle), press OK
    5. Enable/disable TEST checkbox multiple times and monitor messages "Received settings" in real-time.
    6. Stop Nx Witness server with the enabled plugin and save mediaserver_stderr.log to keep server from overwriting it.
    7. Start media server and collect new file mediaserver_stderr.log.


    Please send both mediaserver_stderr.log files, it would help to determine which component is losing saved configuration.

     

     

    0
  • Permanently deleted user

    Hi Anton,

    Here the asked infos:

    Nx Witness version 4.1.0.31398 (both on Windows 7 and Windows 10)

    SDK version 4.1.0 R9 (both on Windows 7 and Windows 10)

    Visual Studio 2015 v14.0 on Windows 7

    Visual Studio 2017 v14.1 on Windows 10

    The following link contains the 2 log files

    If I miss anything, I will be please to send you any other infos.

    Thanks.

    https://drive.google.com/drive/folders/1qI6VJ_UI_zlLRbjcDdD-zQstfWjTKw2a?usp=sharing 

    0
  • Anton Babinov
    • Network Optix team

    I've checked the logs and didn't find any issues. First logs contains lines:

    [test_plugin_device_{e3e9a385-7fe0-3ba5-5482-a86cde7faf48}] Received settings:
    [test_plugin_device_{e3e9a385-7fe0-3ba5-5482-a86cde7faf48}] {
    [test_plugin_device_{e3e9a385-7fe0-3ba5-5482-a86cde7faf48}] "test": "false"
    [test_plugin_device_{e3e9a385-7fe0-3ba5-5482-a86cde7faf48}] }
    [test_plugin_device_{e3e9a385-7fe0-3ba5-5482-a86cde7faf48}] Received settings:
    [test_plugin_device_{e3e9a385-7fe0-3ba5-5482-a86cde7faf48}] {
    [test_plugin_device_{e3e9a385-7fe0-3ba5-5482-a86cde7faf48}] "test": "true"
    [test_plugin_device_{e3e9a385-7fe0-3ba5-5482-a86cde7faf48}] }
    [test_plugin_device_{e3e9a385-7fe0-3ba5-5482-a86cde7faf48}] Received settings:
    [test_plugin_device_{e3e9a385-7fe0-3ba5-5482-a86cde7faf48}] {
    [test_plugin_device_{e3e9a385-7fe0-3ba5-5482-a86cde7faf48}] "test": "false"
    [test_plugin_device_{e3e9a385-7fe0-3ba5-5482-a86cde7faf48}] }
    [test_plugin_device_{e3e9a385-7fe0-3ba5-5482-a86cde7faf48}] Received settings:
    [test_plugin_device_{e3e9a385-7fe0-3ba5-5482-a86cde7faf48}] {
    [test_plugin_device_{e3e9a385-7fe0-3ba5-5482-a86cde7faf48}] "test": "true"
    [test_plugin_device_{e3e9a385-7fe0-3ba5-5482-a86cde7faf48}] }
    [test_plugin_device_{e3e9a385-7fe0-3ba5-5482-a86cde7faf48}] Received settings:
    [test_plugin_device_{e3e9a385-7fe0-3ba5-5482-a86cde7faf48}] {
    [test_plugin_device_{e3e9a385-7fe0-3ba5-5482-a86cde7faf48}] "test": "false"
    [test_plugin_device_{e3e9a385-7fe0-3ba5-5482-a86cde7faf48}] }
    [test_plugin_device_{e3e9a385-7fe0-3ba5-5482-a86cde7faf48}] Received settings:
    [test_plugin_device_{e3e9a385-7fe0-3ba5-5482-a86cde7faf48}] {
    [test_plugin_device_{e3e9a385-7fe0-3ba5-5482-a86cde7faf48}] "test": "true"
    [test_plugin_device_{e3e9a385-7fe0-3ba5-5482-a86cde7faf48}] }

    and after reboot second log seems to be okay as well:

    [test_plugin_engine] Created 000002270EDEC0C0: "test_plugin"
    [test_plugin_engine_{5f90ef13-ac3b-2ad6-db70-03812e3255fa}] Received settings:
    [test_plugin_engine_{5f90ef13-ac3b-2ad6-db70-03812e3255fa}] {
    [test_plugin_engine_{5f90ef13-ac3b-2ad6-db70-03812e3255fa}] }
    manifestString: {
    "capabilities": "needUncompressedVideoFrames_bgr",
    "deviceAgentSettingsModel":
    {
    "type": "Settings",
    "items":
    [
    {
    "type": "GroupBox",
    "caption": "Test settings",
    "items":
    [
    {
    "type": "CheckBox",
    "name" : "test",
    "caption": "Test",
    "defaultValue": true
    }
    ]
    }
    ]
    }

    }

    analytics_logging.ini (absent) To fill in defaults, touch C:\Windows\system32\config\systemprofile\AppData\Local\nx_ini\analytics_logging.ini
    nx_p2p.ini (absent) To fill in defaults, touch C:\Windows\system32\config\systemprofile\AppData\Local\nx_ini\nx_p2p.ini
    [test_plugin_device_{e3e9a385-7fe0-3ba5-5482-a86cde7faf48}] Created 000002270F0F1620
    [test_plugin_device_{e3e9a385-7fe0-3ba5-5482-a86cde7faf48}] Received settings:
    [test_plugin_device_{e3e9a385-7fe0-3ba5-5482-a86cde7faf48}] {
    [test_plugin_device_{e3e9a385-7fe0-3ba5-5482-a86cde7faf48}] "test": "true"
    [test_plugin_device_{e3e9a385-7fe0-3ba5-5482-a86cde7faf48}] }

    Under windows 7, the following prints appear in mediaserver_stderr.log:

    ========> Here the normal behavior for doSetSetings in ConsumingDeviceAgent <========[Test_plugin_device_{e3e9a385-7fe0-3ba5-5482-a86cde7faf48}] Created 000000000A5895D0

    Device id e3e9a385-7fe0-3ba5-5482-a86cde7faf48 is the same as in your log from Win7 machine. Could you please double check the logs? I'm assuming that either you've collected logs from Win7 machine where the issue isn't reproducing or the issues isn't reproducing with every server restart.

     

    0
  • Permanently deleted user

    Hi Anton,

    I think you miss one trace above the lines you send me.

    This one:

    [test_plugin_device_{e3e9a385-7fe0-3ba5-5482-a86cde7faf48}] Created 000001E971EC5F80
    [test_plugin_device_{e3e9a385-7fe0-3ba5-5482-a86cde7faf48}] Received settings:
    [test_plugin_device_{e3e9a385-7fe0-3ba5-5482-a86cde7faf48}] {
    [test_plugin_device_{e3e9a385-7fe0-3ba5-5482-a86cde7faf48}] }

    0
  • Anton Babinov
    • Network Optix team

    Thanks, now I think I've got the scenario on how to reproduce the issue. I was assuming settings are lost after Nx restart, but it looks that this issue occurs only when enabling plugin for the first time without setting any custom parameters. 

    Are you able to reproduce same issue twice on the same camera? I'm able to reproduce the issue only 1 time per camera. If so, could you please provide steps to reproduce it twice?

     

    0
  • Permanently deleted user

    I can't reproduce same issue twice on the same camera.

    Like you said, I can just reproduce the issue only 1 time per camera.

    0
  • Anton Babinov
    • Network Optix team

    Okay, thanks, but from the first look, it doesn't seem to have any potential to cause any issues for the plugin. When enabling a plugin for the first time, GUI/Server doesn't have any configuration associated with it. It results in sending an empty device agent settings to the device agent. Once a device agent was registered properly in the server's db, plugin received correct setting values. Earlier you've mentioned:

    As you can see, Received settings are empty, which is very annoying with a real plugin (with many settings).

    Do you have a scenario when this would affect plugin functionality in any way?

     

    0
  • Permanently deleted user

    Hi Anton,

    Our Gsdgroup_detection_plugin uses many settings (toggles for detecting cars, trucks, people, faces, etc.; toggles controling used of a tracker, other settings related to detection and tracking, etc.). When the plugin is enabled the first time and the user press Apply (or OK), the function settingsReceived in DeviceAgent is called which in turns called my private function parseSettings: and then, many errors occur since settingValue will fail to retrieve any value (there is nothing in the StringMap).

    Sure, I can verify in doSetSettings (I can overload this method in my DeviceAgent) if parameter settings->count() is 0 and avoid calling settingsReceived.

    The problem with this patch is the consequence for the user: plugin will perform correctly, but only with the default values define by our  plugin. Suppose that the user has defined ROI box as an inclusion area, it will be ignore because by default, there is no ROI box define (which is normal, right). The  same problem occurs for any previous setting defines by the user (suppose he don`t want to detect cars; by default, cars are detected; and so on).

    You have to keep in mind that this bug will occur each time a user disables the plugin, quits Nx Witnees and restarts Nx Witness later.

    It seems to me that this bug can be resolved: when user press Apply, I suppose that your software try to read  the file ecs.sqlite to build the appropriate StringMap key/value. If it works on Windows 7 and not on Windows 10, I  suppose the API of sqlite is not the same version... I don`t know how to read a sqlite file; else I will have already patch this problem.

    Thanks.

    Have a nice day.

    Yves Claude

     

    0
  • Anton Babinov
    • Network Optix team

    Hi Yves,

    thanks for the detailed description. I'll need some time to investigate this further. I'll get back to you next week.

    0
  • Permanently deleted user

    Hi Anton,

    Thanks!

    Have a nice day.

    0
  • Anton Babinov
    • Network Optix team

    Hi Yves,

    I did some testing and confirmed that this bug was resolved in the September patch. You can apply patch to your system or wait public 4.2 release which should be available soon.

    In-Client Upgrade:

    Build Number:   31946
    Password:   1roj7j
    0
  • Permanently deleted user

    Hi Anton,

    Thanks!

    Have a nice day.

    0

Please sign in to leave a comment.