当前位置: 首页 > news >正文

wordpress注册页面独立站seo是什么

wordpress注册页面,独立站seo是什么,湛江做网站,河南省建设厅执业资格注册中心Linux(Ubuntu 22.04)系统中固定串口 文章目录 前言正文查看linux串口信息修改udev固化串口校验是否修改完成 注意 前言 在Linux系统中固定串口(通常指的是串行通信接口,如/dev/ttyS0或/dev/ttyUSB0)的原因有几个方面&…

Linux(Ubuntu 22.04)系统中固定串口

文章目录

  • 前言
  • 正文
    • 查看linux串口信息
    • 修改udev固化串口
    • 校验是否修改完成
  • 注意

前言

在Linux系统中固定串口(通常指的是串行通信接口,如/dev/ttyS0或/dev/ttyUSB0)的原因有几个方面:

  • 稳定性与可靠性:
    固定串口可以确保每次重启系统后,特定的硬件设备总是映射到相同的串行端口。这对于需要稳定连接的应用程序特别重要,比如工业自动化、远程监控和数据采集系统。
  • 简化配置:
    当串口被固定后,应用程序或服务的配置文件可以使用固定的设备路径来引用相应的串行端口。这使得配置过程更加简单且易于管理。
  • 避免冲突:
    有些情况下,不同的外部设备可能会连接到同一类型的串口上。固定串口可以确保每个设备都有一个明确的端口分配,从而避免端口冲突。
  • 便于调试和维护:
    在开发过程中,如果串口是固定的,那么当出现问题时,开发者可以更快地定位问题所在的串口,进而进行调试。
  • 自动化脚本:
    对于依赖于特定串口的自动化脚本或任务,固定串口可以让这些脚本更加可靠。

正文

在Linux中,可以通过udev规则来实现串口的固定。udev是一个设备管理器,它可以基于设备的属性来设置规则,从而将设备绑定到特定的设备节点上。例如,你可以创建一个udev规则文件,通过识别串口设备的唯一标识符(如USB设备的ID_VENDOR和ID_MODEL),确保它始终被映射到同一个设备节点(如/dev/ttyUSB0)。这样,在设备插入后,udev就会根据规则自动为该设备分配预先定义好的设备节点名。

查看linux串口信息

方法一:使用lsusb查看信息

$ lsusb
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 004: ID 0573:1573 Zoran Co. Personal Media Division (Nogatech) USB Audio and HID
Bus 001 Device 003: ID 0bda:c821 Realtek Semiconductor Corp. Bluetooth Radio 
# 下边这个是usb串口设备
Bus 001 Device 002: ID 1a86:7523 QinHeng Electronics CH340 serial converter
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

这里idVendor是1a86,idProduct是7523

方法二:使用dmesg命令

$ sudo dmesg | grep tty
[    0.114228] printk: console [tty0] enabled
[    2.802954] usb 1-4: ch341-uart converter now attached to ttyUSB0

确定串口为ttyUSB0后使用udevadm,同样可获得idVendor、idProduct

$ udevadm info -a -p /sys/class/tty/ttyUSB0 
# 下边是详细信息
Udevadm info starts with the device specified by the devpath and then
walks up the chain of parent devices. It prints for every device
found, all possible attributes in the udev rules key format.
A rule to match, can be composed by the attributes of the device
and the attributes from one single parent device.looking at device '/devices/pci0000:00/0000:00:14.0/usb1/1-4/1-4:1.0/ttyUSB0/tty/ttyUSB0':KERNEL=="ttyUSB0"SUBSYSTEM=="tty"DRIVER==""ATTR{power/async}=="disabled"ATTR{power/control}=="auto"ATTR{power/runtime_active_kids}=="0"ATTR{power/runtime_active_time}=="0"ATTR{power/runtime_enabled}=="disabled"ATTR{power/runtime_status}=="unsupported"ATTR{power/runtime_suspended_time}=="0"ATTR{power/runtime_usage}=="0"looking at parent device '/devices/pci0000:00/0000:00:14.0/usb1/1-4/1-4:1.0/ttyUSB0':KERNELS=="ttyUSB0"SUBSYSTEMS=="usb-serial"DRIVERS=="ch341-uart"ATTRS{port_number}=="0"ATTRS{power/async}=="enabled"ATTRS{power/control}=="auto"ATTRS{power/runtime_active_kids}=="0"ATTRS{power/runtime_active_time}=="0"ATTRS{power/runtime_enabled}=="disabled"ATTRS{power/runtime_status}=="unsupported"ATTRS{power/runtime_suspended_time}=="0"ATTRS{power/runtime_usage}=="0"...looking at parent device '/devices/pci0000:00/0000:00:14.0/usb1/1-4':KERNELS=="1-4"SUBSYSTEMS=="usb"DRIVERS=="usb"ATTRS{authorized}=="1"ATTRS{avoid_reset_quirk}=="0"ATTRS{bConfigurationValue}=="1"ATTRS{bDeviceClass}=="ff"ATTRS{bDeviceProtocol}=="00"ATTRS{bDeviceSubClass}=="00"ATTRS{bMaxPacketSize0}=="8"ATTRS{bMaxPower}=="98mA"ATTRS{bNumConfigurations}=="1"ATTRS{bNumInterfaces}==" 1"ATTRS{bcdDevice}=="0264"ATTRS{bmAttributes}=="80"ATTRS{busnum}=="1"ATTRS{configuration}==""ATTRS{devnum}=="2"ATTRS{devpath}=="4"# 这里idVendor是1a86,idProduct是7523ATTRS{idProduct}=="7523"ATTRS{idVendor}=="1a86"ATTRS{ltm_capable}=="no"ATTRS{maxchild}=="0"ATTRS{physical_location/dock}=="no"ATTRS{physical_location/horizontal_position}=="left"ATTRS{physical_location/lid}=="no"ATTRS{physical_location/panel}=="top"ATTRS{physical_location/vertical_position}=="upper"ATTRS{power/active_duration}=="9948388"ATTRS{power/async}=="enabled"ATTRS{power/autosuspend}=="2"ATTRS{power/autosuspend_delay_ms}=="2000"ATTRS{power/connected_duration}=="9948388"ATTRS{power/control}=="on"ATTRS{power/level}=="on"ATTRS{power/persist}=="1"ATTRS{power/runtime_active_kids}=="1"ATTRS{power/runtime_active_time}=="9948108"ATTRS{power/runtime_enabled}=="forbidden"ATTRS{power/runtime_status}=="active"ATTRS{power/runtime_suspended_time}=="0"ATTRS{power/runtime_usage}=="1"ATTRS{product}=="USB Serial"ATTRS{quirks}=="0x0"ATTRS{removable}=="fixed"ATTRS{rx_lanes}=="1"ATTRS{speed}=="12"ATTRS{tx_lanes}=="1"ATTRS{urbnum}=="469"ATTRS{version}==" 1.10"

修改udev固化串口

$ sudo touch /etc/udev/rules.d/70-serial_usb.rules$ sudo vim /etc/udev/rules.d/70-serial_usb.rules
ACTION=="add", KERNEL=="ttyUSB*", ATTRS{idProduct}=="7523", ATTRS{idVendor}=="1a86", MODE:="0777", SYMLINK+="serial_usb"

修改完成后重新加载生效:

$ sudo udevadm control --reload

重新插拔usb串口转换器即可

校验是否修改完成

$ ls -al /dev/serial_usb lrwxrwxrwx 1 root root 7  725 14:37 /dev/serial_usb -> ttyUSB0

可以看到自动并联到ttyUSB0,现在通过/dev/serial_usb即可访问串口。

注意

如果sudo dmesg | grep tty发现串口一连接就断开可以参考如下12

# 卸载冲突的brltty软件
sudo apt-get remove brltty

理论上应该可以正常使用了。


  1. virtualbox 虚拟机ubuntu22 识别不了CH340串口_ubuntu 不识别ch340-CSDN博客 ↩︎

  2. Ubuntu22.04 | 串口设备/dev/ttyUSB0无法发现_ubuntu串口不显示-CSDN博客 ↩︎

http://www.tj-hxxt.cn/news/69649.html

相关文章:

  • 网站一屏做多大如何提升关键词的自然排名
  • 品牌策划公司哪里有白帽seo公司
  • 做推文网站除了秀米还要什么市场营销专业就业方向
  • 免费做的英文网站拼多多代运营一般多少钱
  • 网站备案 香港空间国外直播平台tiktok
  • 新乡哪里做网站优化大师手机版下载
  • 公司网站排名优化手段多少关键词排名优化软件
  • 做网站排名费用多少钱石家庄seo排名外包
  • 网站做全局搜索免费域名解析平台
  • 网站建设所需美工个人网站设计毕业论文
  • php 网站超市柳州网站建设哪里有
  • 网站建设公司咋样宝鸡百度seo
  • 中央农村工作会议召开seo推广是什么意思呢
  • 网页设计与网站建设完全教程看b站视频下载软件
  • 找题做的网站品牌推广活动有哪些
  • 化妆品网站建设的维护网页制作免费模板
  • 网站建设的淘宝模板外包网
  • 网站建设下一步工作计划如何线上推广自己产品
  • asp网站目录权限谷歌seo运营
  • 都哪些网站可以做gif网络竞价托管公司
  • 我爱建站免费空间张掖seo
  • 网站开发资金投入百度搜索引擎的特点
  • 网站开发综合技能实训心得体会网站统计分析工具的主要功能
  • 做网站的技术性说明淘宝运营培训班
  • 在线课程网站建设规范电商网站seo优化
  • 常见网站开发的语言淘宝关键词搜索量查询
  • 网站制作设计培训多少钱天津seo托管
  • 自学网站开发哪个网站好比较火的推广软件
  • 浙江省建筑市场监管公共服务平台站长工具seo查询5g5g
  • 找做课件的网站爱站网官网