Page tree
Skip to end of metadata
Go to start of metadata

You can use Visual Studio Code to debug the node process that is running on the SmartServer IoT. 

See https://code.visualstudio.com/docs/nodejs/nodejs-debugging#_remote-debugging.

Setup Instructions

Opening the SmartServer IoT Firewall Port 9229

The firewall on the SmartServer IoT needs to be opened to accept incoming connections on port 9229.

From a console connection, use the following script to open port 9229:  sudo ufw allow 9229

Enabling Remote Debugging

To enable remote debugging, perform the following steps:

  1. Launch the application on the SmartServer IoT from a console connection using the following script:
    node --inspect=<SmartServer IoT IP Address>:9229 index.js

  2. Start Visual Studio Code on your local computer and open the driver-framework folder that was transferred to the SmartServer IoT.

  3. Go to Debug -> Add Configuration and change the contents of launch.json as follows:

                    {
                      // Use IntelliSense to learn about possible attributes.
                      // Hover to view descriptions of existing attributes.
                      // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
                      "version": "0.2.0",
                      "configurations": [
                          {
                              "type": "node",
                              "request": "attach",
                              "name": "Attach to Remote",       
                              "address": "192.168.168.3",
                              "port": 9229,
                              "protocol": "auto",
                              "localRoot": "${workspaceFolder}",
                              "remoteRoot": "/home/apollo/driver-framework"
                           }
                      ]
                    }
  4. Change the "address"  in launch.json to your SmartServer IoT's IP address.

  5. Start Debugging in Visual Studio Code, which should attach the debugger to the code running on the SmartServer IoT as shown below:





  • No labels