Changes

Jump to navigation Jump to search
Line 1: Line 1:  
== Debugging Webconf with Visual Studio Code ==
 
== 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.
+
This is presented as an example of how Visual Studio Code (VSC) 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.
+
These are loaded using the cog dialog at the bottom of the Visual Studio Code page.
       
[[File:Vsc_extentions_detail.png|thumb|center ]]
 
[[File:Vsc_extentions_detail.png|thumb|center ]]
   −
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!   
+
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.  
 
I also tend to add the git-graph extension.  
Line 14: Line 14:     
== The ssh connection ==  
 
== The ssh connection ==  
 +
 +
To configure SSH connection to the Zynthian:
 +
 +
* Click on the green icon at the bottom left of VSC (tooltip: Open a Remote Window) or F1 then type "Connect to host"
 +
* Select "Connect to host..."
 +
* Select "+ Add New SSH Host..."
 +
* Enter "ssh root@zynthian.local" (use the hostname or IP address of your Zynthian)
 +
* Select "/home/<username>/.ssh/config" to store this configuration in your ssh file (may differ on non *nix systems)
 +
 +
To connect to Zynthian:
 +
 +
* Click on the green icon at the bottom left of VSC (tooltip: Open a Remote Window) or F1 then type "Connect to host"
 +
* Select the entry for the previously configured host, e.g. "zynthian.local"
 +
* Enter password
    
The addition of the remote component adds the Remote Explorer element  
 
The addition of the remote component adds the Remote Explorer element  
 
[[File:Vsc_remote_explorer_section.png|thumb|center]]
 
[[File:Vsc_remote_explorer_section.png|thumb|center]]
   −
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 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.!
+
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.!
   −
[[File:Zynthian-orig.local.png|frame|center|400px|Zynthian-orig.local]]
+
The fact that one can run this debug against the modern code is a sign of great overall consistancy.
 +
 
 +
[[File:Zynthian-orig.local.png|center|500px|Zynthian-orig.local]]
    
== Visual Studio Code Configure. ==
 
== Visual Studio Code Configure. ==
   −
Firstly we need to add the extensions.
+
First we need to add the extensions.
 
[[File:Vsc_extensions.png|thumb|center|800px]]
 
[[File:Vsc_extensions.png|thumb|center|800px]]
   Line 87: Line 103:  
== Running the Debugger ==
 
== Running the Debugger ==
   −
[[File:Vsc start debugging.png|thumb|center]]
+
Once you have a specific module in focus you can run the debugger within that module. In this case zynthian_webconf.py ( The module that runs the webconf implementation). We are going to watch MIDI signals being acknowledged in the webconf display.
 +
 
 +
[[File:Vsc start debugging.png|800px|center]]
 +
 
 +
Make sure you have the python debugger extension loaded. This is done via the Cog in the lower left corner and selecting Extensions. Search on Python in the dialog and you should see a similar list to that below. It's a Microsoft component so it's efficacy is established. Select nd it will load it's self, It's pretty good at doing this but do give it some time to complete...
   −
[[File:Vsc remote installing.png|thumb|center]]
+
[[File:Vsc remote installing.png|800px|center]]
   −
[[File:Vsc debug selection.png|thumb|center]]
+
Selecting Run from Top meu will offer a set of options including debug. Press on this, and you will be offered a selection of options as below that allow choice of various environments in the python world that you may wish to be involved with. Select the top option.  
   −
[[File:Vsc already in use.png|thumb|center]]
+
[[File:Vsc debug selection.png|800px|center]]
    
== Turning off Running Webconf instance ==
 
== Turning off Running Webconf instance ==
584

edits

Navigation menu