当前位置:   article > 正文

JETSON NANO 2G使用笔记2-查看配置信息 第一个C程序 配置VNC 文件管理SCP_4.9.140-tegra

4.9.140-tegra

此处我用的无头模式。headless。也就是不用显示器 nano没有图形界面所以vnc无法正常工作

如果需要vnc第一次配置系统时请用显示器。 而不是通过usb初始化系统

0查看开发板信息

  1. IP地址
  2. ifconfig
  3. 查看内核版本
  4. leonzhang@linux-nano:~$ cat /proc/version
  5. Linux version 4.9.140-tegra (buildbrain@mobile-u64-4263) (gcc version 7.3.1 20180425 [linaro-7.3-2018.05 revision d29120a424ecfbc167ef90065c0eeb7f91977701] (Linaro GCC 7.3-2018.05) ) #1 SMP PREEMPT Fri Oct 16 12:32:46 PDT 2020
  6. leonzhang@linux-nano:~$ uname -a
  7. Linux linux-nano 4.9.140-tegra #1 SMP PREEMPT Fri Oct 16 12:32:46 PDT 2020 aarch64 aarch64 aarch64 GNU/Linux
  8. leonzhang@linux-nano:~$ lsb_release -a
  9. No LSB modules are available.
  10. Distributor ID: Ubuntu
  11. Description:    Ubuntu 18.04.5 LTS
  12. Release:        18.04
  13. Codename:       bionic
  14. 查看gnome version
  15. leonzhang@linux-nano:~$ gnome-shell --version
  16. GNOME Shell 3.28.4
  17. leonzhang@linux-nano:~$ sudo gdm3 --version
  18. GDM 3.28.3

设置固定IP可以参考

https://www.jianshu.com/p/1fac6cdedd0d

 

1,使用putty通过串口连接开发板

 Serial COM3  115200

屏幕显示   输入用户名和密码

  1. Ubuntu 18.04.5 LTS linux-nano ttyGS0
  2. linux-nano login: leon
  3. Password:
  4. Last login: Wed Nov 4 20:17:01 HKT 2020 on ttyGS0
  5. Welcome to Ubuntu 18.04.5 LTS (GNU/Linux 4.9.140-tegra aarch64)
  6. * Documentation: https://help.ubuntu.com
  7. * Management: https://landscape.canonical.com
  8. * Support: https://ubuntu.com/advantage
  9. This system has been minimized by removing packages and content that are
  10. not required on a system that users do not log into.
  11. To restore this content, you can run the 'unminimize' command.
  12. 60 packages can be updated.
  13. 36 updates are security updates.
  14. leonzhang@linux-nano:~$

升级软件apt

  1. sudo apt-get update
  2. sudo apt-get upgrade

更新会花费一些时间   耐心等待

会提示选择显示管理器

准备编写C程序 需要gcc g++和make支持  确认已经安装

  1. leonzhang@linux-nano:~$ gcc
  2. gcc: fatal error: no input files
  3. compilation terminated.
  4. leonzhang@linux-nano:~$ g++
  5. g++: fatal error: no input files
  6. compilation terminated.
  7. leonzhang@linux-nano:~$ sudo apt-get install build-essential
  8. Reading package lists... Done
  9. Building dependency tree
  10. Reading state information... Done
  11. build-essential is already the newest version (12.4ubuntu1).
  12. build-essential set to manually installed.
  13. 0 upgraded, 0 newly installed, 0 to remove and 3 not upgraded.
  14. leonzhang@linux-nano:~$ make
  15. make: *** No targets specified and no makefile found. Stop.
  16. leonzhang@linux-nano:~$

安装一个代码编辑器nano

sudo apt-get install nano

编写C程序

  1. #include<stdio.h>
  2. int main()
  3. {
  4.         printf("hello jetson nano 2g\r\n");
  5.         return 0;
  6. }
  7. ctl+w保存文件
  8. ctrl+x退出编辑

编译并执行C程序

  1. leonzhang@linux-nano:~$ gcc test.c -o testc
  2. leonzhang@linux-nano:~$ ./testc
  3. hello jetson nano 2g
  4. leonzhang@linux-nano:~$

 

查看python版本

  1. leonzhang@linux-nano:~$ python
  2. Python 2.7.17 (default, Sep 30 2020, 13:38:04)
  3. [GCC 7.5.0] on linux2
  4. Type "help", "copyright", "credits" or "license" for more information.
  5. >>>

exit()退出

leonzhang@linux-nano:/opt/nvidia/jetson-io/Jetson$ python3
python3     python3.6   python3.6m  python3m
leonzhang@linux-nano:/opt/nvidia/jetson-io/Jetson$ python3
Python 3.6.9 (default, Oct  8 2020, 12:12:24)
[GCC 8.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> exit()
 

 

下载安装vnc viewer  目前未成功

https://www.realvnc.com/download/file/viewer.files/VNC-Viewer-6.20.529-Windows.exe

开发板确认vino安装

  1. leonzhang@linux-nano:~$ sudo apt install vino
  2. Reading package lists... Done
  3. Building dependency tree
  4. Reading state information... Done
  5. vino is already the newest version (3.22.0-3ubuntu1.1).
  6. vino set to manually installed.
  7. 0 upgraded, 0 newly installed, 0 to remove and 3 not upgraded.

https://developer.nvidia.com/embedded/learn/tutorials/vnc-setup
https://techdiscoverer.com/linux/how-to-enable-rdp-vnc-in-ubuntu-remotely-ssh/

  1. leonzhang@linux-nano:~$ gsettings set org.gnome.Vino prompt-enabled false
  2. leonzhang@linux-nano:~$ gsettings set org.gnome.Vino require-encryption false
  3. leonzhang@linux-nano:~$ nmcli connection show
  4. NAME UUID TYPE DEVICE
  5. Wired connection 1 74770786-c0f0-45f8-950b-a28c21e85b ethernet eth0
  6. docker0 b2cf27c2-4c0a-4c76-8130-5954870b8c bridge docker0
  7. l4tbr0 465309be-cfce-4c6f-8f27-962b92fcbb bridge l4tbr0

leonzhang@linux-nano:~$ gsettings set org.gnome.Vino enabled true
leonzhang@linux-nano:~$ gsettings set org.gnome.Vino require-encryption false
leonzhang@linux-nano:~$ gsettings set org.gnome.Vino prompt-enabled false
leonzhang@linux-nano:~$ export DISPLAY=:0
leonzhang@linux-nano:~$ /usr/lib/vino/vino-server
No protocol specified
Unable to init server: Could not connect: Connection refused
Cannot open display:
Run 'vino-server --help' to see a full list of available command line options
leonzhang@linux-nano:~$

 

  • 启动 Vino-server
/usr/lib/vino/vino-server 

/usr/lib/vino/vino-server --display=:0

 

 

开发板文件管理winscp

https://winscp.net/download/WinSCP-5.17.8-Setup.exe

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/Monodyee/article/detail/191917
推荐阅读
相关标签
  

闽ICP备14008679号