Available translations

Exchange Raw Data - Start Debugging

foundations.png
Summary: The procedure to debug this sensor bot is fairly simple. Just run VS Code with your breakpoint set, go to the UI and start the Sensor Bot Task with the menu option DEBUG.
Almost instantaneously you will see that VS Code stops at the breakpoint you set. From there you can go step by step checking any of the variable values. If you let the code to run, you will notice that a single execution will try to fetch all the missing objects since the last time it ran until present time.
When it finishes, the Sensor Bot will go to sleep for 60 seconds and them it will try to do the same stuff again, and again.
Not Working?
It might happen that the procedure did not work as expected. Check the VS Code console if you have an output similar to this one:
 C:\Program Files\nodejs\node.exe --inspect-brk=43774 Task.js 
Debugger listening on ws://127.0.0.1:43774/7e591f55-d67e-4afe-ba9b-24a6b5763824
For help, see: https://nodejs.org/en/docs/inspector
Debugger attached.
If not, you will need to do some troubleshooting. stat with this:
1. Run Superalgos client
2. Close VS CODE
3. Locate the Task Server folder
4. Right click there and OPEN with VS CODE
5. Without adding yet the Projects folder, run VS CODE
6. See if the VS CODE console shows something similar to what I sent you
Superalgos Client is not Running
If you see a message like this at the VS Code console, that means that the Superalgos Client is not currently running.
 [ERROR] Task Server -> Event Server Client -> setuptWebSockets -> On connection error -> error = undefined
EventServerClient.js:50
[ERROR] This could mean that the port 18041 is taken by some other app running at your system. To resolve this issue, please pick another port number and change it at the.ENV file inside the Superalgos folder AND at the.Environment.js file inside the TaskServer folder. After that run the app again.
EventServerClient.js:51
[ERROR] If you are debugging, it can also mean that the Superalgos Client is not running.
Check Launch.json
If you still can not see the debugger listening on ws port, then you should check that the launch.json file you have at the.vscode folder is similar to this one.
 {
    // 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": "launch",
            "name": "Launch Program",
            "skipFiles": [
                "/**"
            ],
            "program": "${workspaceFolder}\\Task.js"
        }
    ]
}
That might be the reason why it is not starting the debugging session.
On Linux?
Users reported that on Linux, you need to adjust the Launch.json file to have this line:
 "program": "${workspaceFolder}/Task.js"
Feel free to try it out.
Previous
Exchange Raw Data - Locate The Sensor Bot Code
Next
Exchange Raw Data - Find Out Why Is Not Working