【linux】openwrt安装和使用minicom进行串口通信
【linux】openwrt安装和使用minicom进行串口通信查询软件源里面有没有minicom包
opkg list先看一下软件源里面有没有minicom包
安装 minicom
有的话就直接安装 opkg install minicom,安装完后执行minicom -v查看版本信息确认是否安装成功
没有话联网更新opkg, 操作如下:
root@SunLink:~# opkg update
Downloading http://downloads.openwrt.org/chaos_calmer/15.05.1/ramips/mt7628/packages/base/Packages.gz.
Updated list of available packages in /var/opkg-lists/chaos_calmer_base.
Downloading http://downloads.openwrt.org/chaos_calmer/15.05.1/ramips/mt7628/packages/base/Packages.sig.
Signature check passed.
Downloading http://downloads.openwrt.org/chaos_calmer/15.05.1/ramips/mt7628/packages/luci/Packages.gz.
Updated list of available packages in /var/opkg-lists/chaos_calmer_luci.
Downloading http://downloads.openwrt.org/chaos_calmer/15.05.1/ramips/mt7628/packages/luci/Packages.sig.
Signature check passed.
Downloading http://downloads.openwrt.org/chaos_calmer/15.05.1/ramips/mt7628/packages/management/Packages.gz.
Updated list of available packages in /var/opkg-lists/chaos_calmer_management.
Downloading http://downloads.openwrt.org/chaos_calmer/15.05.1/ramips/mt7628/packages/management/Packages.sig.
Signature check passed.
Downloading http://downloads.openwrt.org/chaos_calmer/15.05.1/ramips/mt7628/packages/packages/Packages.gz.
Updated list of available packages in /var/opkg-lists/chaos_calmer_packages.
Downloading http://downloads.openwrt.org/chaos_calmer/15.05.1/ramips/mt7628/packages/packages/Packages.sig.
Signature check passed.
Downloading http://downloads.openwrt.org/chaos_calmer/15.05.1/ramips/mt7628/packages/routing/Packages.gz.
Updated list of available packages in /var/opkg-lists/chaos_calmer_routing.
Downloading http://downloads.openwrt.org/chaos_calmer/15.05.1/ramips/mt7628/packages/routing/Packages.sig.
Signature check passed.
Downloading http://downloads.openwrt.org/chaos_calmer/15.05.1/ramips/mt7628/packages/telephony/Packages.gz.
Updated list of available packages in /var/opkg-lists/chaos_calmer_telephony.
Downloading http://downloads.openwrt.org/chaos_calmer/15.05.1/ramips/mt7628/packages/telephony/Packages.sig.
Signature check passed.
root@SunLink:~# opkg install minicom
Installing minicom (2.7-1) to root...
Downloading http://downloads.openwrt.org/chaos_calmer/15.05.1/ramips/mt7628/packages/packages/minicom_2.7-1_ramips_24kec.ipk.
Configuring minicom.
查看开发板串口设备
root@SunLink:~# ls /dev/tty*
/dev/tty /dev/ttyS0 /dev/ttyS1 /dev/ttyS2 /dev/ttyUSB0/dev/ttyUSB1/dev/ttyUSB2/dev/ttyUSB3
注:
/dev/ttyS0 /dev/ttyS1 /dev/ttyS2 MT7628开发自带的串口
UART2与网口1复用说明
UART2与网口1不能同时使用,只能2选1
/dev/ttyUSB0/dev/ttyUSB1/dev/ttyUSB2/dev/ttyUSB3 是EC20 4G模块枚举的串口,下期讲用4G模块拔打电话时,会用到。
用minicom进行串口通信
我们这次用到的串口是ttyS1,执行minicom -s ttyS1 进行配置,选择serial port setup菜单
配置相应的波特率,关闭流控
然后保存配置,save setup as ttyS1,保存完后选择Exit,进入到minicom主界面
PC端打串口调试助手,就可以测试串口通信了
minicom 退出:
ctrl+AZ X
页:
[1]