' view in ' My Account Settings '2 url:http://api.yeelink.net/v1.0/device/13926/sensor/23121/datapoints3 Writing Python source programWith the Yeelink platform, what we do is we need to upload the temperature data to Yeelink on the Raspberry Pi B +, and create a new pi_temp.py python file.#!/usr/bin/env python#-*-coding:utf-8-*-import requestsimport jsonimport timeimport commandsdef Main (): # FileRecor d = Open ("Result.txt", "W") # Filerecord.write ("Connect to yeelink\n"); # Filerecord.cl
1. Raspberry Pie Display Temperature
Import Commands
def get_cpu_temp ():
tempfile = open ("/sys/class/thermal/thermal_zone0/temp")
cpu_temp = Tempfile.read ()
tempfile.close () return
float (cpu_temp)/1000
# Uncomment the next line if you want the temp I n Fahrenheit
#return float (1.8*cpu_temp) +32
def get_gpu_temp ():
gpu_temp = Commands.getoutput ('/opt/vc/ Bin/vcgencmd measure_temp '). Replace (' temp= ', '). Re
data = str(a).encode('utf8') + getCPUtemperature().encode('utf8') #s.send(str(a).encode('utf8')) print(data) #print(data) threading._sleep(10)def getCPUtemperature(): res = os.popen('vcgencmd measure_temp').readline() return(res.replace("temp=","").replace("'C\n",""))if __name__ == '__main__': Start()
The simple code snippet should be able to write a rough prototype next week. Now we can test the server stability on the server.
The above is all the c
frequency can be displayed in Hz. The value is 700000.
The best method is:
Vcgencmd get_config arm_freq
The running result is as follows:
Arm_freq= 700
* Note: It may also display arm_freq = 0. I have seen such an output, but ignore it.
The benchmark frequency shown here is 700 Mhz, which is also the Default Frequency of Raspberry Pi, but can it be faster?
How to overclock Raspberry Pi
You can use software to overclock Raspberry Pi, but some warning
Go to a script written in Python that outputs the various states and data of the Raspberry Pi, including CPU temperature, CPU usage, memory usage, and hard disk usage.
Article from: Raspberry Pi Lab
First, create a script:
sudo nano get.py
Second, paste the following code: Bash
Import OS # Return CPU temperature as a character string Def getcputemperature (): res = Os.popen (' Vcgencmd measure_temp '). ReadLine () Return (Res.replace ("temp="
Contact Us
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.