日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

jetson nano 自动调节风扇转速

發布時間:2023/12/10 编程问答 51 豆豆
生活随笔 收集整理的這篇文章主要介紹了 jetson nano 自动调节风扇转速 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

jetson nano 如果安裝風扇,需要自輸入控制指令或者寫程序實現自動控制。

sudo sh -c 'echo 255 > /sys/devices/pwm-fan/target_pwm'

這是風扇火力全開

sudo sh -c 'echo 20 > /sys/devices/pwm-fan/target_pwm'

這是風扇關閉,但是要注意執行關閉風扇指令后風扇并不會立即關閉,而是緩慢慢慢的關閉。用jtop(jtop是個軟件,我見經常有問jtop是什么的,搜一下就會有下載方法)查看風扇的轉速,發現他是從100%緩慢降到0的。

?

但是這種方式有點手工,所以自動控制代碼:

#!/usr/bin/python import timewhile True:fo = open("/sys/class/thermal/thermal_zone0/temp","r") #thermal_zone1是cpu的溫度,thermal_zone2是gpu的溫度,thermal_zone0的溫度一直是最高的,可能 #是封裝的溫度,可用jtop查看具體的信息thermal = int(fo.read(10))fo.close()thermal = thermal / 1000if thermal < 60:thermal = 0elif thermal >= 60 and thermal < 70:thermal = thermal - 50else:thermal = thermalthermal = str(thermal)print thermalfw=open("/sys/devices/pwm-fan/target_pwm","w")fw.write(thermal)fw.close()time.sleep(60)

執行的時候注意加sudo權限。

可以看我另一篇文章,免sudo輸入密碼操作,可以最簡單的實現開機自啟,免sudo密碼后,打開ubuntu自帶的啟動應用程序軟件,直接添加 sudo xxx.py就可以開機運行了。

2020-6-1更新:

#!/usr/bin/python import time downThres = 48 upThres = 58 baseThres = 40 ratio = 5 sleepTime = 30while True:fo = open("/sys/class/thermal/thermal_zone0/temp","r")thermal = int(fo.read(10))fo.close()thermal = thermal / 1000if thermal < downThres:thermal = 0elif thermal >= downThres and thermal < upThres:thermal = baseThres + (thermal - downThres) * ratioelse:thermal = thermalthermal = str(thermal)# print thermalfw=open("/sys/devices/pwm-fan/target_pwm","w")fw.write(thermal)fw.close()time.sleep(sleepTime)

?

總結

以上是生活随笔為你收集整理的jetson nano 自动调节风扇转速的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。