Skip to content

Instantly share code, notes, and snippets.

@lanceliao
Created August 19, 2014 11:48
  • Star 1 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save lanceliao/9cdb3a2f06afead108bf 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