基于MT7688模块的开发笔记9——在Ubuntu中以Telnet方式登录MT7688开发板

我在开发的过程中曾思考能否在Ubuntu中登录开发板,答案是肯定的!登录的方式也不不止一种,这里介绍使用Telnet方式登录开发板。试想,如果能在Ubuntu中登录开发板的话,那么就能方便的在同一个平台下进行调试。而且后来我也思考过另一个问题,怎样将Ubuntu中编写的代码放到开发板上执行,有朋友告诉我说先将Ubuntu中写好的用户程序拷贝到SD卡或者U盘再将SD卡或者U盘插到开发板上,这个办法是可行的,但是有点麻烦,不便于开发,所以我也在想办法解决直接将Ubuntu中的文件传到开发板上的方法。这里先解决下Ubuntu中登录开发板的方法。
一、前面已经说过了putty要想登录Ubuntu是要安装SSH的,所以我的Ubuntu已经安装了SSH,以下是SSH的基本查询信息。
root@openwrt:~# ssh -V
OpenSSH_5.9p1 Debian-5ubuntu1.8, OpenSSL 1.0.1 14 Mar 2012
root@openwrt:~#
二、Telnet方式登录开发板:我的开发板的IP地址是192.168.1.1/24,将电脑的IP地址设置成该网段,由于虚拟机与真实主机是采用的桥接模式,所以虚拟机的IP地址也会是同样的网段,最后用网线连接MT7688的LAN口语电脑的网口。
以下是我的Ubuntu的IP信息,它与开发板处于同一网段。
root@openwrt:~# ifconfig eth0
eth0      Link encap:Ethernet  HWaddr 00:0c:29:66:c6:66
          inet addr:192.168.1.100  Bcast:192.168.1.255  Mask:255.255.255.0
          inet6 addr: fe80::20c:29ff:fe66:c666/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:3003 errors:0 dropped:0 overruns:0 frame:0
          TX packets:2461 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:273532 (273.5 KB)  TX bytes:228250 (228.2 KB)
          Interrupt:19 Base address:0x2000

三、要想登录开发板前提是的二者可以相互Ping通。

3.1 Ubuntu Ping MT7688
root@openwrt:~# ping -c 4 192.168.1.1
PING 192.168.1.1 (192.168.1.1) 56(84) bytes of data.
64 bytes from 192.168.1.1: icmp_req=1 ttl=64 time=0.772 ms
64 bytes from 192.168.1.1: icmp_req=2 ttl=64 time=0.861 ms
64 bytes from 192.168.1.1: icmp_req=3 ttl=64 time=0.799 ms
64 bytes from 192.168.1.1: icmp_req=4 ttl=64 time=0.878 ms
--- 192.168.1.1 ping statistics ---
4 packets transmitted, 4 received, 0% packet loss, time 3003ms
rtt min/avg/max/mdev = 0.772/0.827/0.878/0.052 ms

3.2 MT7688 Ping Ubuntu
# ping -c 4 192.168.1.100
PING 192.168.1.100 (192.168.1.100): 56 data bytes
64 bytes from 192.168.1.100: seq=0 ttl=64 time=1.620 ms
64 bytes from 192.168.1.100: seq=1 ttl=64 time=1.020 ms
64 bytes from 192.168.1.100: seq=2 ttl=64 time=0.840 ms
64 bytes from 192.168.1.100: seq=3 ttl=64 time=1.020 ms
--- 192.168.1.100 ping statistics ---
4 packets transmitted, 4 packets received, 0% packet loss

round-trip min/avg/max = 0.840/1.125/1.620 ms


3.3 Telnet登录MT7688:我的MT7688开发板的用户名和密码都是admin。
root@openwrt:~# telnet 192.168.1.1
Trying 192.168.1.1...
Connected to 192.168.1.1.
Escape character is '^]'.
Mediatek login: admin
Password:

BusyBox v1.12.1 (2015-07-14 09:33:29 CST) built-in shell (ash)
Enter 'help' for a list of built-in commands.
# ls
etc     sys     mnt     init    usr     dev     etc_ro  lib
home    bin     proc    var     media   sbin    tmp

3.4在上面可以执行基本的操作,这与在Windows下使用SecureCRT通过串口操作MT7688是一样的,例如:
# cd /
# ls
etc     home    sys     bin     mnt     proc    init    var     usr     media   dev     sbin    etc_ro  tmp     lib
# cd /media/mmcblk0p1/media/
# pwd
/media/mmcblk0p1/media
# ls
阿杜 - 天天看到你.mp3                                   易欣 - 心碎.mp3
阿木 - 有一种爱叫做放手.mp3                          旭日阳刚 - 春天里 - 旭日阳刚组合演唱.mp3
阳阳 - 都是月亮惹的祸.mp3                             方炯镔 - 遗憾.mp3

3.5使用exit退出即可。
# ls
etc     sys     mnt     init    usr     dev     etc_ro  lib
home    bin     proc    var     media   sbin    tmp
# exit
Connection closed by foreign host.
root@openwrt:~#

在下一篇文章中,将讲述怎样在Ubuntu与开发板之间实现文件的互相传输!














  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值