Difference between revisions of "Zynthian Webconf debug with Visual Studio Code (VSC)"

From ZynthianWiki
Jump to navigation Jump to search
(Running a VSC debugger against zynthian-webconf)
Line 48: Line 48:
  
 
[[File:Vsc connected.png]]
 
[[File:Vsc connected.png]]
 +
 +
[[File:Vsc remote explorer connect to host.png]]
 +
 +
== Selecting the home directory on the Remote server ==
 +
 +
[[File:Vsc open a folder.png]]
 +
 +
[[File:Vsc select folder default.png]]
 +
 +
[[File:Vsc select folder zynthian webconf.png]]
 +
 +
[[File:Vsc zynthian webconf head.png]]
 +
 +
== Running the Debugger ==
 +
 +
[[File:Vsc start debugging.png]]
 +
 +
[[File:Vsc remote installing.png]]
 +
 +
[[File:Vsc debug selection.png]]
 +
 +
[[File:Vsc already in use.png]]
 +
 +
== Turning off Running Webconf instance ==
 +
 +
[[File:Vsc address already in use with stop.png]]
 +
 +
[[File:Vsc stop webconf systemd.png]]
 +
 +
[[File:Zynthian dead webconf.png]]
 +
 +
Now Start the debugger...
 +
 +
[[File:Zynthian-orig running midi.png]]
 +
 +
[[File:Vsc debug line 132.png]]
 +
 +
[[File:Vsc debug stepover.png]]

Revision as of 16:59, 11 January 2022

Debugging Webconf with Visual Studio Code

This is presented as an example of how a Visual Studio Code can be used to examine a component of the zynthian sub system as it runs using the Visual studio Code extensions, python & remote-ssh. These are loaded using the cog dialog at the bottom of the vsc code page.


Vsc extentions detail.png

Once you have these components added you can attempt to log onto an existing Zynthian from your PC, MAC, or linux machine, just so long as it's capable of running Visual Studio Code. In my own case I have it running on a 64 bit Raspbian instance, and I had to build it from source to get it running which is a degree of proof of the overall flexibility of what is after all a Microsoft product!

I also tend to add the git-graph extension.

Zynthian git graph

The ssh connection

The addition of the remote component adds the Remote Explorer element

Vsc remote explorer section.png

I already have a couple of remote zynthians in the machine and VSC is pretty tenacious at hanging onto remote instances it knows about. But we will try to add a new machine.

I have a zynthian called zynthian-orig.local. It's actually a genuine zynthian product running a Pi3 and no membrane switches and some fairly simplistic interface. Indeed it has to be disassembled to change the ssd. Such were the early days.!

Zynthian-orig.local

1 Visual Studio Code Configure.

Firstly we need to add the extensions.

Vsc extensions.png

activated by the cog in the bottom left hand corner of the Visual Studio Code interface

Vsc remote explorer dialog.png

Vsc remote explorer add new.png

Vsc remote explorer dialog.png

Vsc remote explorer zynthian-orig.png

Vsc remote explorer first login.png

Vsc-remote explorer password.png

Vsc setting up remote server.png

Vsc connected.png

Vsc remote explorer connect to host.png

2 Selecting the home directory on the Remote server

Vsc open a folder.png

Vsc select folder default.png

Vsc select folder zynthian webconf.png

Vsc zynthian webconf head.png

3 Running the Debugger

Vsc start debugging.png

Vsc remote installing.png

Vsc debug selection.png

Vsc already in use.png

4 Turning off Running Webconf instance

Vsc address already in use with stop.png

Vsc stop webconf systemd.png

Zynthian dead webconf.png

Now Start the debugger...

Zynthian-orig running midi.png

Vsc debug line 132.png

Vsc debug stepover.png