Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Next revisionBoth sides next revision
zh:docs:guide-developer:adding_new_device [2020/09/09 02:32] – [Collecting relevant data] star_twinklingzh:docs:guide-developer:adding_new_device [2020/09/09 02:44] – [从设备获取数据] star_twinkling
Line 155: Line 155:
  
  
-==== Getting collected data from a device ==== +==== 从设备获取数据 ==== 
-Sometimes no normal means such as scp or ftp are available for retrieving files from a device. Still one could use httpd and busybox its mount command to do so. How? +由于空间有限,常见的文件传输实用程序(例如rsync/curl/ssh/scp/ftp/http/tftp)可能不可用,精简版version/applet可能在busybox中可用。 
-Assume the files with relevant data on the device with IP address ''192.168.0.123'' are stored under ''/tmp'' and pages of the web interface are served from ''/www''+ 
-On the device do: +假设路由器ip为192.168.0.123,要传输的文件位于/tmp/important-data.txt 
-  cp important-data.txt /tmp + 
-  mount -o bind /tmp /www +=== HTTP通过"httpd"和"busybox mount"=== 
-After that the data on the host connected to the device do: +  
-  wget http://192.168.0.123/important-data.txt+如果从/www提供Web界面 
 + 
 +== Sender == 
 +<code bash> 
 +mount -o bind /tmp /www 
 +</code> 
 + 
 +== Receiver == 
 +<code bash> 
 +wget http://192.168.0.123/important-data.txt 
 +</code> 
 + 
 +=== FTP通过“busybox ftpput” === 
 +== Receiver == 
 +设置一个FTP服务器,添加一个具有写权限的匿名账号。 
 +<code bash> 
 +python -m pyftpdlib -w -p 21 
 +</code> 
 + 
 + 
 +== Sender == 
 +<code bash> 
 +busybox ftpput 192.168.0.123 important-data.txt /tmp/important-data.txt  
 +</code> 
 + 
 +=== netcat通过“buxybox nc” === 
 +== Receiver == 
 +<code bash> 
 +busybox nc -l -p 12345 > important-data.txt  
 +</code> 
 + 
 +== Sender == 
 +<code bash> 
 +cat /tmp/important-data.txt | busybox nc 192.168.0.123:12345  
 +</code> 
 + 
 +=== TFTP通过“busybox tftp” === 
 +== Receiver == 
 +Setup a tftp server 
 + 
 +== Sender == 
 +<code bash> 
 +busybox tftp -p -l /tmp/important-data.txt -r important-data.txt 192.168.0.123 
 +</code> 
 + 
 +=== 通过终端(terminal)复制 === 
 +如果上述所有工具/小工具都不可用,则可以从telnet终端进行复制,但不适用于二进制文件
      
  • Last modified: 2021/04/17 20:24
  • by guyezi