Differences
This shows you the differences between two versions of the page.
| 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:21] – [通过PING或者NTP功能进入shell] star_twinkling | zh:docs:guide-developer:adding_new_device [2020/09/09 02:44] – [从设备获取数据] star_twinkling | ||
|---|---|---|---|
| Line 129: | Line 129: | ||
| 通过 [[https:// | 通过 [[https:// | ||
| - | ==== Collecting relevant data ==== | + | ==== 收集相关数据 |
| - | On [[https:// | + | 在[[https:// |
| - | Typically one can use the following commands: | + | 通常可以使用以下的命令: |
| + | <code bash> | ||
| dmesg # log buffer might be to small, see note 1. | dmesg # log buffer might be to small, see note 1. | ||
| cat / | cat / | ||
| Line 144: | Line 145: | ||
| ls / | ls / | ||
| brctl show | brctl show | ||
| - | | + | |
| - | Note 1: Often the log buffer is to small and the earliest messages may be missing from the information retrieved with '' | + | </ |
| - | Note 2: http:// | + | **注意1**:通过**dmesg**检索时,如果日志的缓存区太小,就会丢失掉最早的信息。如果从供应商发布的资源中构建库存及镜像文件,则可以在内核配置中设置更大的缓冲区大小。 |
| - | Another useful tool for getting information for setting LEDs might be [[https://github.com/jclehner/gpiodump-mt7620|gpiodump]], a MT7620 GPIOMODE register dumper (RAMIPS). | + | **注意2**: |
| - | ==== Getting collected data from a device | + | 获取设置LED信息的另一个有用的工具是[[https:// |
| - | Sometimes no normal means such as scp or ftp are available for retrieving files from a device. Still one could use httpd and busybox | + | |
| - | Assume the files with relevant data on the device with IP address '' | + | |
| - | On the device do: | + | ==== 从设备获取数据 |
| - | cp important-data.txt /tmp | + | 由于空间有限,常见的文件传输实用程序(例如rsync/ |
| - | mount -o bind /tmp /www | + | |
| - | After that the data on the host connected to the device do: | + | 假设路由器ip为192.168.0.123,要传输的文件位于/ |
| - | wget http:// | + | |
| + | === HTTP通过" | ||
| + | |||
| + | 如果从/www提供Web界面 | ||
| + | |||
| + | == Sender == | ||
| + | <code bash> | ||
| + | mount -o bind /tmp /www | ||
| + | </ | ||
| + | |||
| + | == Receiver == | ||
| + | <code bash> | ||
| + | wget http:// | ||
| + | </ | ||
| + | |||
| + | === FTP通过“busybox ftpput” === | ||
| + | == Receiver == | ||
| + | 设置一个FTP服务器,添加一个具有写权限的匿名账号。 | ||
| + | <code bash> | ||
| + | python -m pyftpdlib -w -p 21 | ||
| + | </ | ||
| + | |||
| + | |||
| + | == Sender == | ||
| + | <code bash> | ||
| + | busybox ftpput 192.168.0.123 important-data.txt / | ||
| + | </ | ||
| + | |||
| + | === netcat通过“buxybox nc” === | ||
| + | == Receiver == | ||
| + | <code bash> | ||
| + | busybox nc -l -p 12345 > important-data.txt | ||
| + | </ | ||
| + | |||
| + | == Sender == | ||
| + | <code bash> | ||
| + | cat / | ||
| + | </ | ||
| + | |||
| + | === TFTP通过“busybox tftp” === | ||
| + | == Receiver == | ||
| + | Setup a tftp server | ||
| + | |||
| + | == Sender == | ||
| + | <code bash> | ||
| + | busybox tftp -p -l / | ||
| + | </ | ||
| + | |||
| + | === 通过终端(terminal)复制 === | ||
| + | 如果上述所有工具/ | ||
| | | ||