How to stop USB autosuspend on ubuntu

本文介绍如何在Ubuntu和Debian系统中禁用USB核心模块的自动挂起功能,通过编辑grub配置文件并添加usbcore.autosuspend=-1参数,更新grub并重启系统,以确保USB设备的稳定性和响应速度。

For Ubuntu and Debian, usbcore is compiled in the kernel, so create entries on /etc/modprobe.d will NOT work: we need to change the kernel boot parameters.

Edit the /etc/default/grub file and change the GRUB_CMDLINE_LINUX_DEFAULT line to add the usbcore.autosuspend=-1 option:

GRUB_CMDLINE_LINUX_DEFAULT="quiet splash usbcore.autosuspend=-1"

Note that quit splash were already present options. So keep other options you have too.

After save the file, update grub:

sudo update-grub

And reboot.

Now check autosuspend value:

cat /sys/module/usbcore/parameters/autosuspend

And it should display -1.

In the kernel documentation is stated that someday in the future this param will change to autosuspend_delay_ms (instead of autosuspend).

### 安装 MAVROS 二进制包在 Ubuntu 20.04 系统上的步骤 1. **安装 ROS Noetic** 如果尚未安装 ROS Noetic,可以使用以下命令安装: ```bash sudo apt update sudo apt install ros-noetic-desktop-full ``` 安装完成后,初始化 `rosdep`: ```bash sudo rosdep init rosdep update ``` 2. **安装 MAVROS 二进制包** 使用以下命令安装 MAVROS 及其附加组件: ```bash sudo apt-get install ros-noetic-mavros ros-noetic-mavros-extras ``` 3. **下载并安装 GeographicLib 数据集** MAVROS 依赖 GeographicLib 数据集,可以通过以下步骤下载并安装: - 导航到 MAVROS 目录: ```bash roscd mavros ``` - 下载安装脚本: ```bash sudo wget https://raw.githubusercontent.com/mavlink/mavros/master/mavros/scripts/install_geographiclib_datasets.sh ``` - 为脚本添加执行权限: ```bash chmod +x ./install_geographiclib_datasets.sh ``` - 运行脚本安装数据集: ```bash sudo sh ./install_geographiclib_datasets.sh ``` 4. **测试 MAVROS 安装** 安装完成后,可以启动 MAVROS 并测试其功能。首先,启动 ROS 核心服务: ```bash roscore ``` 在另一个终端中,启动 MAVROS 节点: ```bash roslaunch mavros px4.launch ``` 如果一切正常,应该能够看到 MAVROS 节点成功启动并连接到飞行控制器。 ### 常见问题及解决方法 - **问题:无法找到 MAVROS 包** 确保 ROS Noetic 已正确安装,并且软件源已正确配置。可以尝试更新软件包列表: ```bash sudo apt update ``` - **问题:GeographicLib 数据集安装失败** 检查网络连接并确保脚本具有执行权限。如果问题仍然存在,可以手动下载数据集并将其放置在指定目录。 - **问题:启动 MAVROS 节点时出现错误** 检查飞行控制器是否正确连接,并确保使用的启动文件(如 `px4.launch`)配置正确。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值