码迷,mamicode.com
首页 > 其他好文 > 详细

nvidia jetson xavier打开风扇,并设置开机启动

时间:2020-06-30 20:30:54      阅读:375      评论:0      收藏:0      [点我收藏+]

标签:style   devices   创建   开启   publish   redis   led   col   The   

英伟达的jetson xavier 或者NX打开风扇都是通过修改下面的文件实现的。

vim /sys/devices/pwm-fan/target_pwm

或者直接

sudo sh -c "echo 150 > /sys/devices/pwm-fan/target_pwm"

但是修改上述文件的时候,重启之后失效,因此可以通过设置开启自启动的方式使风扇的设置重启继续生效,下面简单说一下步骤

1.修改 /sys/devices/pwm-fan/target_pwm文件权限

sudo chmod 777 /sys/devices/pwm-fan/target_pwm

2.将 /lib/systemd/system/rc-local.service 链接到 /etc/systemd/system/ 目录下面来

sudo ln -fs /lib/systemd/system/rc-local.service /etc/systemd/system/rc-local.service

3.查看文件内容

cd /lib/systemd/system
ls -lh
sudo vim rc.local.service

在末尾添加[install字段],如下:
#  This file is part of systemd.
#
#  systemd is free software; you can redistribute it and/or modify it
#  under the terms of the GNU Lesser General Public License as published by
#  the Free Software Foundation; either version 2.1 of the License, or
#  (at your option) any later version.

# This unit gets pulled automatically into multi-user.target by
# systemd-rc-local-generator if /etc/rc.local is executable.
[Unit]
Description=/etc/rc.local Compatibility
ConditionFileIsExecutable=/etc/rc.local
After=network.target

[Service]
Type=forking
ExecStart=/etc/rc.local start
TimeoutSec=0
RemainAfterExit=yes

[Install]  
WantedBy=multi-user.target  
Alias=rc-local.service

4.创建/etc/rc.local文件,并添加权限

touch /etc/rc.local 
chmod 777 /etc/rc.local 

5.编辑rc.local

vim /etc/rc.local 

然后在rc.local中添加如下内容

echo “150” > /sys/devices/pwm-fan/target_pwm

6.然后reboot 查看/sys/devices/pwm-fan/target_pwm内容







nvidia jetson xavier打开风扇,并设置开机启动

标签:style   devices   创建   开启   publish   redis   led   col   The   

原文地址:https://www.cnblogs.com/cumtchw/p/13215565.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!