树莓派ubuntu:vscode远程SSH开发调试

使用VSCODE可以SSH连接远程开发板,在开发板上调试开发程序

1. VSCODE安装插件"Remote - SSH"

2. 新建SSH连接配置

例如:ssh ubuntu@192.168.43.102

自动生成的配置文件内容如下:

bash 复制代码
Host 192.168.43.101
  HostName 192.168.43.101
  User ubuntu

添加新的连接后,可能需要重启VSCODE,否则看不到新增的SSH连接

3. 连接SSH

输入密码,点击回车

连接成功,可以像在本机一样编程开发了

4. 执行终端命令

VSCODE远程打开终端,执行编译运行等命令,调试开发更加方便

5. 安装git

将开发板上的源码同步上传到gitee或github,避免开发调试的代码只留在开发板上,造成源码丢失。

5.1 安装
bash 复制代码
sudo apt-get install git

如果出现如下错误,重启ubuntu再执行

bash 复制代码
ubuntu@ubuntu:~/pro/4WD-CAR-PY$ sudo apt-get install git
E: Could not get lock /var/lib/dpkg/lock-frontend. It is held by process 2711 (unattended-upgr)
N: Be aware that removing the lock file is not a solution and may break your system.
E: Unable to acquire the dpkg frontend lock (/var/lib/dpkg/lock-frontend), is another process using it?

参照gitee或github去初始化仓库以及上传

复制代码
mkdir test
cd test
git init 
touch README.md
git add README.md
git commit -m "first commit"
git remote add origin https://gitee.com/zhb32412/test.git
git push -u origin "master"
相关推荐
嵌入式学习和实践3 小时前
虚拟机 Ubuntu 磁盘扩容完全指南:从原理到实践,一步到位
linux·ubuntu·磁盘扩容
木心术110 小时前
TypeScript实战进阶:从基础类型到高级类型编程
javascript·ubuntu·typescript
Webgiserin12 小时前
nvm+vscode配置安装暂记
ide·vscode·编辑器
charlie11451419113 小时前
嵌入式C++工程实践——第13篇:第一次重构 —— enum class取代宏,类型安全的开始
开发语言·c++·vscode·stm32·安全·重构·现代c++
sheeta199815 小时前
TypeScript references 配置与 emit 要求详解
javascript·ubuntu·typescript
天月风沙15 小时前
Betaflight飞控、树莓派RP2350B主控编译教程
linux·单片机·嵌入式硬件·mcu·无人机·树莓派
ancktion16 小时前
ubuntu多gcc版本切换
linux·运维·ubuntu
传说中胖子16 小时前
Magento服务器VSCode开启XDebug方法
服务器·vscode·php
贵沫末16 小时前
Claude Code使用
ubuntu
DeepHacking17 小时前
Ubuntu 22.04 安装 Allow Locked Remote Desktop 扩展:解决锁屏后 mstsc 无法连接的问题
linux·运维·ubuntu