You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As discussed in a chat with @UncleSamSwiss, it would be nice if dev-server can be used remote.
This would be very useful especially for embedded systems (like a Raspberry Pi). So you can run your dev environment on your (powerfull) desktop PC and test the adapter on the remote embedded system, maybe with special hardware attached.
The files which will be included in the npm package should be synced to the remote on change.
Debugging
For debugging it should be possible to attach a debugger (like vscode-js-debug).
The adapter node process has to be started with the additional arguments:
--inspect-brk=0.0.0.0:9229 or --inspect=0.0.0.0:9229 (maybe with -brk, the IP and the port configurable)
--nolazy (needed for correct breakpoint locations at startup)
For TypeScript adapters, "inlineSourceMap": true have to be set in tsconfig.json.
Using the "normal" "sourceMap": true option, I wasn't able to get the sourcemaps running for remote debugging. The breakpoints are set in the remote process, but not mapped back to the sources in VSCode and only the build js files were shown.
To check the VSCode debugger session setup, you may run "Debug: Create Diagnostic Information for Current Session" from the command palette and then select "Why my breakpoints don't bind". If there are three green check marks you are fine.
The source files (from src/) are not needed on the remote system. The mapping from the build files to the source files is performed in VSCode.
The launch.json to attach the debugger may look like:
{"version": "0.2.0","configurations": [{"type": "node","protocol": "inspector","request": "attach","name": "Attach Remote","address": "192.168.1.50","port": 9229,"smartStep": true,"skipFiles": ["<node_internals>/**"],"outFiles": [// for TypeScript adapters"${workspaceFolder}/build/**/*.js"],"sourceMaps": true,// for TypeScript adapters"localRoot": "${workspaceFolder}","remoteRoot": "/opt/iobroker/node_modules/iobroker.canbus",// full path to remote adapter directory"trace": true}],}
localRoot and remoteRoot are needed for correct mapping of the remote URLs provided by the debugger to the locals URLs in your workspace. address and port may be defined using the ${inputs:xxx} syntax for a more flexible setup.
The text was updated successfully, but these errors were encountered:
As discussed in a chat with @UncleSamSwiss, it would be nice if dev-server can be used remote.
This would be very useful especially for embedded systems (like a Raspberry Pi). So you can run your dev environment on your (powerfull) desktop PC and test the adapter on the remote embedded system, maybe with special hardware attached.
Possible setup and run
dev-server setup --remote pi@192.168.1.50
dev-server watch --remote pi@192.168.1.50
The files which will be included in the npm package should be synced to the remote on change.
Debugging
For debugging it should be possible to attach a debugger (like vscode-js-debug).
The adapter node process has to be started with the additional arguments:
--inspect-brk=0.0.0.0:9229
or--inspect=0.0.0.0:9229
(maybe with-brk
, the IP and the port configurable)--nolazy
(needed for correct breakpoint locations at startup)For TypeScript adapters,
"inlineSourceMap": true
have to be set intsconfig.json
.Using the "normal"
"sourceMap": true
option, I wasn't able to get the sourcemaps running for remote debugging. The breakpoints are set in the remote process, but not mapped back to the sources in VSCode and only the build js files were shown.To check the VSCode debugger session setup, you may run "Debug: Create Diagnostic Information for Current Session" from the command palette and then select "Why my breakpoints don't bind". If there are three green check marks you are fine.
The source files (from
src/
) are not needed on the remote system. The mapping from the build files to the source files is performed in VSCode.The
launch.json
to attach the debugger may look like:localRoot
andremoteRoot
are needed for correct mapping of the remote URLs provided by the debugger to the locals URLs in your workspace.address
andport
may be defined using the${inputs:xxx}
syntax for a more flexible setup.The text was updated successfully, but these errors were encountered: