谷动谷力

 找回密码
 立即注册
查看: 3978|回复: 1
打印 上一主题 下一主题
收起左侧

【linux】openwrt安装和使用minicom进行串口通信

[复制链接]
跳转到指定楼层
楼主
发表于 2022-7-7 16:32:06 | 只看该作者 |只看大图 回帖奖励 |倒序浏览 |阅读模式
【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端打串口调试助手,就可以测试串口通信了


+10

本帖被以下淘专辑推荐:

回复

使用道具 举报

沙发
 楼主| 发表于 2022-7-8 23:48:20 | 只看该作者
minicom 退出:
ctrl+A  Z X
+10
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|Archiver|手机版|深圳市光明谷科技有限公司|光明谷商城|Sunshine Silicon Corpporation ( 粤ICP备14060730号|Sitemap

GMT+8, 2024-12-28 00:13 , Processed in 0.091776 second(s), 45 queries .

Powered by Discuz! X3.2 Licensed

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表