Skip to main content

HTTP Do Request assistance

Answered

Comments

6 comments

  • Ichiro
    • Network Optix team

    Hi Dan,

    Thanks for your question. Can you explain more about the "focus action" here in your post?  Do you mean the button is to adjust the focal length to get clear image?

    As the behavior sounds not quite common: 

    1) PTZ camera usually has the auto-focus. This is an essential feature for a PTZ camera, otherwise every time you move, the image would get blurred, then it is kind of weird that a PTZ camera got blurred but not get the focus back after any operations. I don't think the camera manufacturer will allow such behavior on a product.
    This sounds not very common, but can you confirm?

    2) We don't support two HTTP requests in one rule, so likely you need to separate these two requests into two actions, meaning two steps(start and stop). 

    3) Of course, if the device is providing the web interface, you may also add a web-page of the device on the desktop client of Nx, then use the provided button on the device web page.

    4) You may also refer to our node.js integration sample here. The sample shows that you can legacy the web hook to allow the soft trigger to send a signal to the web hook, then the web hook executes the HTTP requests or any actions you desired, which means one button for dual HTTP requests to the PTZ camera.

     

    Hope this helps.

     

     

     

    0
  • Dan

    Sometimes the camera auto focusses correctly sometimes not. There isn’t a one click auto focus button. The manual buttons obviously allow me to correct this.

    Can I get a guide for the Quick start please?

    Quick Start

    1. Make sure that you are in the project directory. Ex: 'cd ~/develop/node_js'.
    • What project directory? Node, NX? There is no project directory on my PC at all and no file named node_js
    1. Run 'npm install'.
    • From CMD prompt? Node JS? There is no file on my PC at all named 'npm install'
    1. Go to the examples directory
    • There is no examples directory on my PC at all.
    1. Run 'tsc *.ts'
    • There is no file named tsc on my PC at all.
    1. Edit the nodeConfig.json file with the following. Note: Leave the rules section empty, the scripts will fill it in automatically.
    • There is no file named nodeConfig on my PC at all.
    0
  • Ichiro
    • Network Optix team

    Hi Dan,

    Thank you for your questions. I understand that the quick start guide may seem challenging. The document is likely written based on the knowledge of Linux.

    However, please note that Node.js is available on Windows and is cross-platform, so the integration is definitely working well on Windows as well. You can run it within PowerShell, which is an essential command-line tool on Windows. If you need further assistance,  here is a that introduces Node.js on Windows.

     

     

    Here are a few points that might clarify the document:

    1. If there is no specified directory on your PC, it is likely because you have not yet downloaded the code from the repository. You can download the repository and sample code here if you want to launch the sample.
    This is not a required part of Nx Witness or the OS; it is an integration sample. Once you download the sample code, you can navigate to the appropriate folder.

     

    2. It is npm, not npn. npm is the default package management portal, similar to MS Market or App Stores. It helps you install the required libraries and dependencies quickly. However, you need to install npm first. An installation guide is available here. I believe you have done this correctly.

    3. "npm install" is a command, not a file. You can run this in PowerShell once you have installed npm properly to fetch and install the required dependencies specified in the sample integrations, so you don't need to install them one by one.

     

    4. The example folder will be visible once you download the sample code. It is not a built-in folder in the OS or Nx Witness. Again, this is an integration, so you need to download the sample code to execute and try them.

     

    I have to admit the document might not be very clear for some users, but the first step is to download the code. After that, you should be able to follow the instructions in the rest of the readme.md file.

    I hope this helps. Thank you.

    0
  • Dan

    Hi, 

    Thanks for the detailed reply.

    I've noticed however that tsc doesn't seem to exist in the examples folder.

    Is ts run constantly in another CMD window while the example js file is running in another CMD window?

    Thanks!

    0
  • Ichiro
    • Network Optix team

    Hi Dan,

    Thanks for your question. 

    "tsc" is a command, not a file, so it will not be found in any folders, however, you do need to install it via npm.
    The installation is also a required step in the pre-requirement and listed in the quick start guide. (Run 'npm install typescript -g', just to avoid confusion, I paste the part of typescript below for reference)

     

    if you did not put npm/node under your environment PATH variable, simply use the path which is the same folder as the node.exe.

     

    Thanks.

    0
  • Ichiro
    • Network Optix team

    BTW, tsc is the command line tool for the TypeScript compiler. It compiles TypeScript code into JavaScript code, making it compatible with the browser or any JavaScript runtime environment.

    It is not constantly running in another CMD windows, but sometimes it took time to finish. (ex: 30 seconds)

    0

Please sign in to leave a comment.