DataV-WS integrates the static file service and WebSocket. The static file service is used to load local model addresses. WebSocket can be used in the blueprint editor to connect multiple projects in the same network range without additional development. This topic describes how to use DataV-WS.

DataV-WS document directories

Directories
Notice Do not delete the assets directory.

Start and stop DataV-WS

  • Windows:
    1. Download the DataV-WS installation package.
    2. Decompress the package and double-click the datav_ws_win.exe file.
    3. View the returned message. If the following information appears, DataV-WS is started:
      Server listen on IP address:8181 (for example, 127.0.0.1:8181)     
      Notice Do not close the command prompt after the start.
    4. Develop and demonstrate WebSocket and the static file service after you start DataV-WS. For more information, see Configure DataV-WS.
  • Linux or macOS:
    1. Run the following command to download the DataV-WS installation package:
      wget http://sh-conf.oss-cn-shanghai.aliyuncs.com/doc_files/datav_ws.zip                      
    2. Decompress the package, start the terminal, and enter the service directory, for example, datav-ws.
    3. Run the following commands to start DataV-WS (port 8001 is used by default):
      chmod 777 ./
      sh exec.sh start

      You can run the sh exec.sh stop command to stop DataV-WS.

      You can run the sh exec.sh restart command to restart DataV-WS.

    4. Develop and demonstrate WebSocket and static file service after you start DataV-WS. For more information, see Configure DataV-WS.

Configure DataV-WS

You can configure WebSocket and the static file service.
  • Configure WebSocket.
    • Development:
      1. Start DataV-WS on your local computer. For more information, see Start and stop DataV-WS.
      2. Log on to the DataV console.
      3. Create an empty DataV project.
      4. In the upper-left corner of the canvas editor, click the Blueprint Editor icon. The blueprint editor appears.Blueprint editor
      5. In the blueprint editor, drag and drop the WebSocket node to the canvas.
      6. Click the WebSocket node in the blueprint editor and set Socket Endpoint to ws://127.0.0.1:8181.Socket Service Address
    • Demonstration:
      1. Start DataV-WS on a demonstration server that is in the same network range as the development server. For more information, see Start and stop DataV-WS.
      2. Add a WebSocket node. Set Socket Endpoint of the WebSocket node to ws://IP address of the demonstration server:8181. The projects that use the two WebSocket nodes can communicate with each other.
  • Configure the static file service.
    1. Start DataV-WS on your local computer. For more information, see Start and stop DataV-WS.
    2. Add static files (such as images) to the assets directory.Image resource directory
    3. Log on to the DataV console.
    4. Create an empty DataV project.
    5. In the canvas editor, add an image widget. For more information, see Add a widget.
    6. Set Background Image to http://IP address:8181/p2544435894.webp so that the project can obtain the image from DataV-WS.Image address

References

Data processing