谷动谷力

标题: 【linux】openwrt安装和使用minicom进行串口通信 [打印本页]

作者: 鸣涧    时间: 2022-7-7 16:32
标题: 【linux】openwrt安装和使用minicom进行串口通信
【linux】openwrt安装和使用minicom进行串口通信

查询软件源里面有没有minicom包

opkg list先看一下软件源里面有没有minicom包

安装 minicom
有的话就直接安装 opkg install minicom,安装完后执行minicom -v查看版本信息确认是否安装成功
没有话联网更新opkg, 操作如下:
  1. root@SunLink:~# opkg update
  2. Downloading [url]http://downloads.openwrt.org/chaos_calmer/15.05.1/ramips/mt7628/packages/base/Packages.gz.[/url]
  3. Updated list of available packages in /var/opkg-lists/chaos_calmer_base.
  4. Downloading [url]http://downloads.openwrt.org/chaos_calmer/15.05.1/ramips/mt7628/packages/base/Packages.sig.[/url]
  5. Signature check passed.
  6. Downloading [url]http://downloads.openwrt.org/chaos_calmer/15.05.1/ramips/mt7628/packages/luci/Packages.gz.[/url]
  7. Updated list of available packages in /var/opkg-lists/chaos_calmer_luci.
  8. Downloading [url]http://downloads.openwrt.org/chaos_calmer/15.05.1/ramips/mt7628/packages/luci/Packages.sig.[/url]
  9. Signature check passed.
  10. Downloading [url]http://downloads.openwrt.org/chaos_calmer/15.05.1/ramips/mt7628/packages/management/Packages.gz.[/url]
  11. Updated list of available packages in /var/opkg-lists/chaos_calmer_management.
  12. Downloading [url]http://downloads.openwrt.org/chaos_calmer/15.05.1/ramips/mt7628/packages/management/Packages.sig.[/url]
  13. Signature check passed.
  14. Downloading [url]http://downloads.openwrt.org/chaos_calmer/15.05.1/ramips/mt7628/packages/packages/Packages.gz.[/url]
  15. Updated list of available packages in /var/opkg-lists/chaos_calmer_packages.
  16. Downloading [url]http://downloads.openwrt.org/chaos_calmer/15.05.1/ramips/mt7628/packages/packages/Packages.sig.[/url]
  17. Signature check passed.
  18. Downloading [url]http://downloads.openwrt.org/chaos_calmer/15.05.1/ramips/mt7628/packages/routing/Packages.gz.[/url]
  19. Updated list of available packages in /var/opkg-lists/chaos_calmer_routing.
  20. Downloading [url]http://downloads.openwrt.org/chaos_calmer/15.05.1/ramips/mt7628/packages/routing/Packages.sig.[/url]
  21. Signature check passed.
  22. Downloading [url]http://downloads.openwrt.org/chaos_calmer/15.05.1/ramips/mt7628/packages/telephony/Packages.gz.[/url]
  23. Updated list of available packages in /var/opkg-lists/chaos_calmer_telephony.
  24. Downloading [url]http://downloads.openwrt.org/chaos_calmer/15.05.1/ramips/mt7628/packages/telephony/Packages.sig.[/url]
  25. Signature check passed.
  26. root@SunLink:~# opkg install minicom
  27. Installing minicom (2.7-1) to root...
  28. Downloading [url]http://downloads.openwrt.org/chaos_calmer/15.05.1/ramips/mt7628/packages/packages/minicom_2.7-1_ramips_24kec.ipk.[/url]
  29. Configuring minicom.
复制代码

查看开发板串口设备
  1. root@SunLink:~# ls /dev/tty*
  2. /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端打串口调试助手,就可以测试串口通信了



作者: 鸣涧    时间: 2022-7-8 23:48
minicom 退出:
ctrl+A  Z X




欢迎光临 谷动谷力 (http://bbs.sunsili.com/) Powered by Discuz! X3.2