Skip to content
This repository has been archived by the owner on Aug 25, 2023. It is now read-only.

Latest commit

 

History

History
204 lines (172 loc) · 9.65 KB

README.md

File metadata and controls

204 lines (172 loc) · 9.65 KB

Guides how to convert your IDE to remote one...

Why

Problem appiered when you start using Raspberry Pi as IDE .Its TOO SLOW!. In Raspbians VScode you do not have Intelsens(auto complite line.shows methodds of the class e.t.c), Debugger. This topic was created to solve this problems using remote build options in Visual studio or in VSCODE in the remote machines. where Raspberry PI will be used as compiler of programm.

Visual Code


Its assumed what you already installed gcc, CMake, Cutycapt, OpenVG etc on Raspberry.In version 1.42 (2020) of VsCode Microsoft still did not added ARM procesors support(no intellsans and debuging) but they said they will add in future proof,but they added remote IDE functionality. It means what you code projectfor example in ubuntu and use Raspberry Pi as compiler/linker.

Prepare Raspberry Pi

  • Pluged on Raspbbery and Enabled SSH
    Start->Preferences->Raspberry Pi Configuration->Interfaces->"Enable SSH."
  • Raspberry Pi hostname
    Use this command in console to get hostname:
    $ hostname -I
  • Must be installed on Linux machine.command for installation(probably you can survive without gdb stuff):
    $ sudo apt-get install openssh-server g++ gdb gdbserver

Preparations VsCode

Most importanly what allows you to turn your IDE as remote one (install on client side) is:

Magick can start

1.In VS Code, press on green rect(at the left lower corner)

2.chose from popup window Remote-SSH connect to host

3.For new conection press on "Add New SSH Host"

4.VS will ask you to witch device to connect. in edit box enter connection request/command
example of input request

ssh pi@${yours PIs hostname}


5.VS will ask where to save/edit your .ssh config chose first one.
5.1. inf .ssh config (see pic below how it looks like) you can rename your connection if needed change hostname/port/user etc

6.press again on green rect to start session and chose needed conection
7.VS will ask you password . enter pasword of remote machine
8.VS will do its magick(installation of vscode server etc)
9.install on remote machine(press in vscode extensions tab) additional extensions(c++ language support,cmake support etc)
10.press on Explorer (Ctrl+Shift+E) press on open folder button(you are now in yours pi cataloge LOL).
11.??????
12.PROFIT!

Microsoft readable source

Magick ingredients aka extensions

Installed VsCode on your working machine not on Pi.
Installed Extensions in VsCode server part:

FAQ

VSCode can be installed on windows.Can I use it in same way as in Linux?

ДА.

How you debug project?

printf("DEBUG style \n");  

How you use intelsanse if VSCode do not have ARM support? ->

under construction

MVS


THIS WORKS UNDER WINDOWS OS ONLY . (kinda tested on windows 7 and 10)
Maybe solution could be faund here

What do you need to start

  • N Straigth arms

  • Pluged on Raspbbery and Enabled SSH
    Start->Preferences->Raspberry Pi Configuration->Interfaces->"Enable SSH."

  • Raspberry Pi hostname
    Use this command in console to get hostname:

    $ hostname -I
  • crap what must be installed on Linux machine
    command for installation:

    $ sudo apt-get install openssh-server g++ gdb gdbserver
  • Installed Putty on Windows

  • Obviosly installed MVS on Windows with Linux package
    in VS installer

    If needed install it
    1)Start->Visual Studio installer

    2)"in Installed page"
    more->modify

    3)in "WORKLOADS"
    scroll down and press on "Linux development with C++"

    4)press "modify" button

    5)???

    6)PROFIT!!!

VS configuration part

1)Open MVS and chose "Create new project"

2)Chose "Makefile Project" if you havent it back to "What do you need to start" *punkt 6

3)Write path where to store it on your machine

*MVS migth show you pop out window where you need to enter Linux device info(hostname,user,password etc) fill it with info if it did not appiered its ok!
4)Connect your Linux machine to MVS:
In projec:Tools->Options->Cross Platform->press "Add button" fill pop out window with needed info(hostname,username e.t.c)

5)Configure project to understand make for Make
5.1)Project type:
Project->$(Your project name)Properties..->General
Configuration Type->Makefile

5.2)For compilator to understand
Project->$(Your project name)Properties..->Remote Build

5.3)For Debuging
Project->$(Your project name)Properties->Debugging
Program->$(FULL_PATH_TO_EXE)/$(EXE_NAME)

Test project

Create Source.cpp file in VS (it can be with different name I used this for guides purpose) in Source.cpp paste this code:

#include <iostream> 
	
int main(){  
	
	std::cout << "HELLO WORLD I AM ALIVE!@\n";  
	
	return 0;  
}

Create simple Makefile in project folder:

#Something like that
	CC= g++ -g -Wall
	#compiling project and linking
	Hello:Source.o
		$(CC) -o $@ Source.cpp
	#command what allows you to delete obj files by using this command-> make clean
	.PHONY:clean
	clean:
		-rm *.o

FINNALY PRESS CTRL+F5 then thru putty open yours project folder in linux machine and type this in console

$ ./$(Your project name.exe)  

wow

Source list

ENG

Microsoft blog | More MS blog | Even more MS blog |

RUS

Habr | ТЫК |

Archive

VSCODE template