arm

您所在的位置:网站首页 get上传文件到开发板 arm

arm

2023-07-28 06:40| 来源: 网络整理| 查看: 265

arm-linux笔记3:arm-linux PC文件传输方法总结(4种最常见的方法)

 

1使用串口终端传输文件 2使用ftp传输文件 3使用nfs传输文件 4使用u盘拷贝

 

串口的优点是方法简单,不需要过多的配置,不需要联接网络,但是发送数据的速度比较慢,不适用于传输超过10M的文件

ftp的配置的时候需要联网,还需要下载ftp服务以及进行复杂的配置,大小文件传输速度都比较快,但是好像只能传输单个文件,没有nfs方便

 

nfs配置的时候也需要联网,还需要下载nfs服务以及进行复杂的配置,配置好了之后,对文件的操作就是本地复制了,大小单双文件随意复制,当然最为方便啦

 

u盘传文件当然也方便,但是容易出问题,因此还是用靠谱一点的方法吧

 

综上:没有网的时候优先选择串口传输,有网的时候小文件就直接用串口,可以避免配置ftp和nfs服务;传输的文件较大的时候就直接用nfs或者ftp,若需要发送文件夹有不想压缩文件就直接用nfs了一串口传输文件(SecureCRT软件) 1 cross fall to download securecrt(ubuntu)  //下载linux下的软件 2install securecrt (deb) //安装软件  dpkg -i xxxx.deb 3install ssh  //安装ssh服务,串口控制arm linux的服务  apt-get install openssh-server  ps -e|grep ssh  to check if it's open,if open you'll see a sshd  if not open, /etc/init.d/ssh start,then it'll open 4 crack securecrt  //下载破解文件securecrt_linux_crack.pl  http://www.cnblogs.com/wangkongming/p/3533240.html      wget http://download.boll.me/securecrt_linux_crack.pl   sudo perl securecrt_linux_crack.pl  /usr/bin/SecureCRT //安装破解文件,最好将该文件放在和deb安装包相同的目录下面   then it will show crack successful  and show Licence;   inpute Licence to software,next time you login,no 30 days warning 注意:从Licence开始复制 已经有.pl文件就不需要wget下载了 5check if your computer has  usbserial(default it has a usbserial)      lsmod | grep usbserial      ->usbserial              38972  1 pl2303    check if computer can recogonize usb      dmesg | grep ttyUSB0      ->usb 2-1.1.3: pl2303 converter now attached to ttyUSB0 6 open secureCRT  //用secureCRT的时候最好要把对应的dev/ttyUSB0串口提一下权限,不然容易出错   open a quick connect    sudo chmod 777 /dev/ttyUSB0->Permission denied  7 transfer file to armBoard 2、Secure 传输文件 cd 到保存文件的目录 输入rz 然后enter就会选择文件了       1、开发板-->PC机            在开发板上输入 sz filename。            在PC机上点击超级终端的菜单“传送”-> “接收文件”,选择下载的位置和Zmodem 与崩溃恢复协议,点击接收即可。 2、PC机-->开发板            在开发板上先进入/tmp 目录,然后输入 rz。            在PC机上点击超级终端的菜单“传送”-> “发送文件”,选择目标文件和Zmodem 与崩溃恢复协议,点击发送即可。 注意:linux下的SecureCRT软件不好下载,下载的时候可能需要翻墙,而且破解文件还要对应相应版本,否则无法下载了也无法使用!使用破解文件账号信息的时候可能一次弄不好,因此要有耐心多复制几次! 这里提供我平时用的一个版本的链接,供大家使用! http://yunpan.cn/cdQNpsTiXI5Sf (提取码:b4c7) 当然,串口传输还可以使用minicom工具,minicom的安装和配置简要说明如下 apt-get install minicom 设置:ctrl + A 之后按Z--> 按 o--> Serial port setup-->A set device :/dev/ttyUSB0-->F No G No--> save ...dfl 确认和选择按enter键 minicom实际上也可传输文件的,但是好像不怎么方便,有兴趣的可以自己去百度一下!

 

 

 

 

二ftp传输文件 1、install ftp

 

 apt-get install ftp

 

 

new a acount: sudo useradd -m ftp //创建一个ftp专用的用户,当然也可以不创建了,对pc上的一个文件提权就行了 sudo passwd ftp enter:111111 new a ftp acount named ftp,passwd is 111111 sudo chmod 777 /home/ftp   2、modify (6410)ip vi  /etc/eth0-setting modify  ip to your computer ip range use ipconfig get ip  original ip is 192.168.1.230 new ip is 192.168.1.109 get(/hoime/plg) write privelige chmod 777 /home/plg you need to restart arm6410 to get the ip 3 use ftp in ubuntu terminal  xg@xg:~$ ftp 192.168.1.109 Connected to 192.168.1.109. 220 FriendlyARM FTP server (Version 6.4/OpenBSD/Linux-ftpd-0.17) ready. Name (192.168.1.109:xg): plg 331 Password required for plg. Password: 230 User plg logged in. Remote system type is UNIX. Using binary mode to transfer files. ftp> lcd /home/ftp Local directory now /home/ftp ftp> cd /home/plg 250 CWD command successful. ftp> pwd 257 "/home/plg" is current directory. ftp> put console local: console remote: console 200 PORT command successful. 150 Opening BINARY mode data connection for 'console'. 226 Transfer complete. 121271 bytes sent in 0.05 secs (2.4505 MB/s) ftp> get console local: console remote: console 200 PORT command successful. 150 Opening BINARY mode data connection for 'console' (121271 bytes). 226 Transfer complete. 121271 bytes received in 0.16 secs (748.6769 kB/s) ftp> bye 221 Goodbye. xg@xg:~$  problems //常见问题 every times you use,you should  chmod 777 /home/user,or you will meet permission denied三 nfs传输文件 A PC上nfs配置 1安装nfs sudo apt-get install nfs-kernel-server 重启nfs sudo service nfs-kernel-server restart   或者 sudo /etc/init.d/nfs-kernel-server restart 2指定PC机nfs的目录 修改/etc/exports 这个文件。在这个文件的最后一行添加如下代码 /home/xg/Desktop *(rw,sync,no_root_squash) 注意:*号前边有个空格,*号后没有空格,并且,逗号前后没有空格。 B 开发板客户端 要想连接上 PC虚拟机 Ubuntu上的/home/xg/Desktop, 1. 首先【必须】保证你的开发板可以 ping 通 PC 虚拟机 Ubuntu,ping ip地址即可 2. 能 ping 通虚拟机 Ubuntu 之后,在开发板上使用 mount 命令来挂载。怎么挂载? mount -t nfs -o nolock 192.168.1.101:/home/xg/Desktop /mnt 说明: a) mount 是挂载命令 b) –t nfs 是 使用 nfs 协议来挂载 c) intr,nolock,rsize=1024,wsize=1024,这几个参数不做过多解释,为了就是保证传 输文件不出错,具体含义,可以百度 d) 192.168.1.100,这个是 PC 虚拟机 Ubuntu 下的 IP 地址,根据自己的情况自行修 改,我的是 192.168.1.101 e) /home/xg/Desktop,这个就是我们前边说的要挂载的绝对路径的目录 f) /mnt 就是开发板上的 mnt 文件夹 如果一切正常,开发板的 mnt 目录下就可以看到 PC 虚拟机 Ubuntu, /home/xg/Desktop这个目录下的内容,也就可以实现文件的互传。 开发板modify (6410)ip vi  /etc/eth0-setting modify  ip to your computer ip range use ipconfig get ip  original ip is 192.168.1.230  //自己设置一个同一局域网下的ip即可 new ip is 192.168.1.109 get(/hoime/plg) write privelige chmod 777 /home/plg you need to restart arm6410 to get the ip pc mount命令,可以现在pc下挂载一下nfs看看nfs是否正常 mount -t ntfs /dev/sda5 /mnt/d     mount sda5 to /mnt/d windows mount  若正常则可以挂载到对应的开发板中,嵌入式开发板还要加 nolock命令 mount –t nfs intr,nolock,rsize=1024,wsize=1024 192.168.1.101:/home/xg/Desktop  /mnt 挂载成功就可以随意复制文件了!四 u盘拷贝文件 对于不想使用各种配置的就可以使用u盘,u盘方便可是容易出问题啊,因此不建议使用! 有时候u盘格式出问题了就复制不了,还有一些非正规的u盘也会出现无法拷贝的情况,一次强烈建议使用以上方法进行传输文件!  

至此,arm-linux下的文件传输就总结完成了,发现问题的请予以指正,以便沟通学习!!

 

 


【本文地址】


今日新闻


推荐新闻


CopyRight 2018-2019 办公设备维修网 版权所有 豫ICP备15022753号-3