一、内核温度系统
注:树莓派自带温度传感器
1、http://shumeipai.nxez.com/2014/10/04/get-raspberry-the-current-
status-and-data.html(资料引用)
sudo nano get.py
贴入如下代码:
import os
# Return CPU temperature as a character string
def getCPUtemperature():
res = os.popen('vcgencmd measure_temp').readline()
return(res.replace("temp=","").replace("'C\n",""))
# Return RAM information (unit=kb) in a list
# Index 0: total RAM
# Index 1: used RAM
# Index 2: free RAM
def getRAMinfo():
p = os.popen('free')
i = 0
while 1:
i = i + 1
line = p.readline()

本文介绍了如何使用Python在树莓派上获取内核温度、内存使用情况和磁盘空间,并定时上传到云端。同时,讲解了树莓派设置静态IP地址和网络连接的方法,包括查看IP地址、设置DNS服务器和测试网络连接。
最低0.47元/天 解锁文章
4514

被折叠的 条评论
为什么被折叠?



