Skip to content

Instantly share code, notes, and snippets.

@laris
Forked from lanceliao/openwrt-usb-serial.md
Created June 29, 2018 09:08
Show Gist options
  • Save laris/7c04add7e5bc3fd9f0f262a0c8adb3b5 to your computer and use it in GitHub Desktop.
Save laris/7c04add7e5bc3fd9f0f262a0c8adb3b5 to your computer and use it in GitHub Desktop.
OpenWrt USB转串口模块的调试

###安装

opkg install kmod-usb-serial kmod-usb-serial-pl2303

安装完成之后需要手动载入内核模块:

insmod usbserial
insmod pl2303

###测试 插入USB转串口模块之后,在/dev目录可以看到ttyUSB0设备.

###使用串口

####使用shell 读取:

cat /dev/ttyUSB0

写入:

echo "hello" >  /dev/ttyUSB0

####使用Screen应用 screen和SSH登录的效果一样,具有高亮提示,命令格式:

screen /dev/ttyUSB0 115200

ctrl +a+k退出

####使用minicom 设置minicom -s 波特率等 ctl +a调出菜单

  1. Using GNU screen to debug your serial port
  2. Sending Message to Serial Port of Router using Lua
  3. Serial Programming Guide for POSIX Operating Systems
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment