Cov txheej txheem:

Kev Nyuaj Siab Ntsuas Raspberry Pi: 6 Kauj Ruam (nrog Duab)
Kev Nyuaj Siab Ntsuas Raspberry Pi: 6 Kauj Ruam (nrog Duab)

Video: Kev Nyuaj Siab Ntsuas Raspberry Pi: 6 Kauj Ruam (nrog Duab)

Video: Kev Nyuaj Siab Ntsuas Raspberry Pi: 6 Kauj Ruam (nrog Duab)
Video: Saib Mis paub Poj niam (hluas nkauj) tus yam ntxwv lub siab 2024, Hlis ntuj nqeg
Anonim
Kev Nyuaj Siab Ntsuas Raspberry Pi
Kev Nyuaj Siab Ntsuas Raspberry Pi
Kev Nyuaj Siab Ntsuas Raspberry Pi
Kev Nyuaj Siab Ntsuas Raspberry Pi

Thaum Raspberry Pi thawj zaug tau tso tawm Kuv tau yws yws nyob rau hauv hype ntawm kev yuav ib qho, tab sis thaum kawg kuv tau siv sijhawm ntau nrog Arduino vim tias lawv zoo dua rau cov phiaj xwm hluav taws xob.

Kuv muaj ob Tus Thawj Raspberry Pi nyob hauv lub tsev, thiab kuv xav tias nws txog lub sijhawm kuv tau ua qee yam nrog lawv. Yog li hauv cov lus qhia no kuv yuav qhia koj yuav ua li cas "ntxhov siab" sim koj li Pi CPU los pab koj txiav txim siab npaum li cas koj xav tau txias thiab ntau npaum li cas koj tuaj yeem tuaj yeem overclock nws.

Cov lus qhia no siv Stressberry, Yog tias koj tsis tau siv nws ua ntej tshawb xyuas nws hauv cov nab npawb pob sej.

Kauj ruam 1: Teeb Koj Pi

Teeb Koj Pi
Teeb Koj Pi

Koj yuav xav tau:

  • Raspberry Pi
  • 8GB SD daim npav
  • 5V, 1A fais fab mov nrog micro USB
  • HDMI saib (lossis ib qho nrog S-video/sib xyaw)
  • USB Keyboard & Nas
  • Kev sib txuas hauv Is Taws Nem (txuas nrog lossis txuas USB WiFi adapter)

Txog qhov kev qhia no kuv twb tau ua lub raspberry Pi laptop (daim duab saum toj no). Hmoov tsis zoo kuv tsis tau thaij duab txaus ntawm qhov no yog li kuv tsis tuaj yeem sau cov lus qhia.

Los ntawm kev nyeem cov lus qhia no kuv xav tias koj twb paub yuav ua li cas nyem koj daim npav SD thiab teeb tsa koj Pi. Hauv kuv qhov xwm txheej kuv tau teeb tsa daim npav SD tshiab siv "SD daim npav daim ntawv", tom qab ntawd kuv rub tawm qhov tseeb raspbian ncab img cov ntaub ntawv thiab ua rau nws mus rau SD daim npav nrog win32diskimager. Tom qab ntawd koj yuav tsum tau ntsaws rau hauv nas, keyboard, saib xyuas thiab muab lub zog rau hauv Raspberry Pi nrog koj daim npav SD tshiab. Kuv yuav tsis qhia meej txog qhov tshwj xeeb vim qhov no twb tau sau tseg zoo lawm.

Cov lus qhia hauv qab no tsuas yog ua haujlwm yooj yim nrog Raspbian Stretch. Txawm hais tias koj tuaj yeem siv Wheezy lossis Jessie ntau ntawm cov chaw khaws khoom qub dhau los thiab koj yuav zaum tawm tsam rub tawm thiab sau txhua yam los ntawm qhov chaw. Kuv xub sim nrog Wheezy thiab tawm tsam feem ntau vim tias software tso siab rau Python 3.5 uas tsis tau teeb tsa los ntawm lub hauv paus Wheezy.

Kauj Ruam 2: Rub tawm thiab Nruab Nruab Qhov Software

Rub tawm thiab Txhim Kho Qhov Kev Ntsuam Xyuas Software
Rub tawm thiab Txhim Kho Qhov Kev Ntsuam Xyuas Software
Rub tawm thiab Txhim Kho Qhov Kev Ntsuam Xyuas Software
Rub tawm thiab Txhim Kho Qhov Kev Ntsuam Xyuas Software
Rub tawm thiab Txhim Kho Qhov Kev Ntsuam Xyuas Software
Rub tawm thiab Txhim Kho Qhov Kev Ntsuam Xyuas Software

Peb yuav siv qhov program hu ua "stressberry". Nws thauj CPU mus rau 100% thiab ntsuas qhov ntsuas kub (Kuv kwv yees qhov no yog qhov sov so tsis yog qhov kub saum npoo). Yog tias koj tab tom khiav GUI nyem rau ntawm lub davhlau ya nyob twg kom qhib lub qhov rai tshiab, lwm tus nkag mus rau koj Pi siv kab hais kom ua thiab ntaus cov hauv qab no.

Ua ntej tshaj tawm qhov hloov tshiab:

sudo apt-tau hloov tshiab

Qhov no yuav hloov kho txhua yam yog li peb tau siv cov ntaub ntawv tshiab tshaj plaws. Tom ntej no peb yuav teeb tsa txhua qhov kev xav tau ua ntej siv Strawberry.

Nruab Atlas

sudo apt-tau nruab Libatlas-base-dev

Nruab Cairo

Sudo pip3 nruab cairocffi

Nruab PyQt5

sudo apt-tau nruab python3-pyqt5

Thaum kawg teeb tsa stressberry siv ob qho lus txib hauv qab no

sudo apt nruab kev ntxhov siab

ces

sudo -H pip3 nruab -U stressberry

Thaum lub sijhawm teeb tsa teb yog "Y" rau ib qho kev hais kom sai thaum txhim kho thiab xav tias txhua yam mus tau zoo peb tuaj yeem mus rau theem tom ntej uas yog hloov kho matplotlib backend. Hauv hom davhlau ya nyob twg:

sudo sej 3

Qhov no yuav ua rau lub davhlau ya nyob twg sab hauv lub LXDE lub davhlau ya nyob twg. Koj yuav tuaj yeem qhia vim tias pib ntawm txhua kab yog ua ntej nrog >>. Ntaus cov hauv qab no raws li nkag mus:

>> import matplotlib

ces

>> matplotlib.matplotlib_fname ()

Qhov no yuav muab rau koj qhov chaw nyob uas koj cov ntaub ntawv matplotlib RC tau khaws cia uas peb tam sim no yuav tsum tau hloov kho. Piv txwv li qhov no yog kuv li:

/usr/local/lib/python3.5/dist-packages/matplotlib/mpl-data/matplotlibrc

Yog li koj yuav tsum tau hais ua ntej kab no nrog "sudo nano" qhib lub nano davhlau ya nyob twg cov ntawv nyeem kho kom raug cov ntaub ntawv:

sudo nano /usr/local/lib/python3.5/dist-packages/matplotlib/mpl-data/matplotlibrc

Tam sim no peb tab tom kho cov ntawv kab ntawv peb yuav tsum tau saib rau qhov twg lub backend tau teev tseg. Txog qhov no, nano muaj cov txiaj ntsig tau tsim hauv kev tshawb nrhiav hais tias "qhov twg yog". Txhawm rau siv nws yooj yim tuav Ctrl + W thiab ntaus hauv "backend" thiab nws yuav tshawb xyuas cov ntaub ntawv rau koj, tsis txhob yuav tsum tau hla nws. Tam sim no kho kab:

rov qab: gtk3agg

rau

rov: qg5

Tom qab ntawd thaum koj ua tiav tuav Ctrl + X kom txuag tau. Thaum teb cov lus teb Y lossis yog los cawm ib qho kev hloov pauv thiab sau cov ntawv.

Kauj Ruam 3: Khiav Stressberry

Khiav Stressberry
Khiav Stressberry
Khiav Stressberry
Khiav Stressberry
Khiav Stressberry
Khiav Stressberry
Khiav Stressberry
Khiav Stressberry

Thaum kawg koj tau ua tiav txhua qhov kev xav tau ua ntej koj tuaj yeem thaum kawg ua haujlwm yam tsis muaj teeb meem. Cias ntaus cov lus txib hauv qab no los khiav stressberry:

sudo stressberry-run out.dat

Qhov no ua haujlwm rau koj thiab sau qhov ntsuas kub hauv cov ntawv hauv koj phau ntawv teev npe tsev 'out.dat'. Qhov kev zov me nyuam yuav ua haujlwm CPU tsawg li sai tau kom tso nws "cooldown", tom qab ntawd ua haujlwm luv rau ib ntus ua ntej ua rau nws hnyav nrog qhov siab tshaj plaws rau tsib feeb, tom qab ntawd nres thiab sau cov cooldown. Cov ntaub ntawv raug khaws cia hauv koj phau ntawv teev npe tsev nrog lub npe "out.dat" tab sis koj tuaj yeem hu qhov no txhua yam uas koj nyiam. Stressberry kuj tseem yuav tsim cov duab zoo saib ib yam yog tias koj ua raws cov lus txib hauv qab no tom qab kev ntsuas kev nyuaj siab tiav:

sudo stressberry-plot tawm.dat

Sim siv cov cua sov sib txawv thiab cov ntaub thaiv, qhov chaw overclocking thiab lwm yam kom pom tias qhov no hloov pauv tus cwj pwm li cas. Txhawm rau phiaj xwm kab ntau ntawm kab ntawv txhua yam koj ua yog ntxiv lawv ua ntej ntawm qhov hais kom ua:

sudo stressberry-phiaj tawm1.dat tawm2.dat tawm3.dat

Koj tseem tuaj yeem txuag daim duab ncaj qha rau-p.webp

sudo stressberry -plot out.dat -o tawm.png

Qhov no yuav khaws cov ntaub ntawv hu ua "out.png" rau koj phau ntawv teev npe tsev. Yog tias koj muaj cov lus yuam kev thaum lub sijhawm teeb tsa ntawm cov kauj ruam dhau los saib qhov teeb meem daws teeb meem.

Kauj Ruam 4: Qee Cov Qauv Piv Txwv

Qee Qhov Piv Txwv
Qee Qhov Piv Txwv
Qee Qhov Piv Txwv Plots
Qee Qhov Piv Txwv Plots

Nov yog qee cov phiaj xwm kuv tau tsim los siv Stressberry. Kuv Pi yog tus pib Pi1, thiab kuv tau ntxiv qee qhov me me txhuas cua sov rau hauv IC, thiab tom qab ntawd kuv tau rov hloov dua tshiab siv lub me me 3cm kiv cua ntxiv (ceeb toom, muab 5cm tab sis qhov no yog qhov tseeb 30mm kiv cua!). Tom qab ntawd kuv teeb tsa overclock rau "Turbo" siv raspi-teeb tsa, tshem tawm lub kiv cua, thiab muab tso rau hauv lub thawv acrylic. Peb daim phiaj yog nyob rau tib daim duab saum toj no

Kauj ruam 5: Troubleshooting

Teeb meem
Teeb meem
Teeb meem
Teeb meem
Teeb meem
Teeb meem

Yog tias koj nyeem cov theem no koj yuav tau muaj qee qhov yuam kev thaum txhim kho lossis khiav stressberry. Ntawm no kuv tau sau txhua qhov teeb meem kuv tau ntsib thaum sim ua qhov no los ua haujlwm, thiab vam tias yuav pab koj kov yeej txhua yam zoo sib xws.

Lus yuam kev 1.

libf77blas.so.3: Tsis tuaj yeem qhib cov khoom sib qhia: tsis muaj cov ntaub ntawv lossis cov npe

Qhov teeb meem yog dab tsi?

Lub pacakage nyob ntawm Atlas uas tsis tau teeb tsa los ntawm lub neej ntawd

Tshuaj

Nruab Atlas nrog cov hauv qab no:

sudo apt-tau nruab Libatlas-base-dev

Lus yuam kev 2

ImportError: cairo backend xav kom cairocffi lossis pycairo raug teeb tsa

Qhov teeb meem yog dab tsi?

Cairo tsis tau teeb tsa los ntawm lub neej ntawd

Tshuaj

nruab cairo nrog cov hauv qab no:

sudo pip3 nruab cairocffi

Lus yuam kev 3

TypeError: Tsis tuaj yeem pom cov hloov pauv txawv teb chaws rau 'cairo. Context'

Qhov teeb meem yog dab tsi?

Qhov teeb meem yog siv GTK3Agg backend, qhov no tuaj yeem hloov pauv hauv cov ntaub ntawv matplotlibrc.

Tshuaj

thaum koj khiav "stressberry-plot out.dat" hloov pauv:

sudo MPLBACKEND = Agg stressberry-phiaj tawm.dat

Qhov no yuav yuam kom stressberry khiav cov kab ke tshwj xeeb ntau dua li khaws cia hauv RC cov ntaub ntawv.

Kauj ruam 6: Ua tiav

Nov tsuas yog ib ntawm ntau txoj hauv kev uas koj tuaj yeem siv los ntsuas koj li Pi. Lwm qhov haujlwm koj tuaj yeem txiav txim siab siv yog "sysbench" uas yuav tsum ua haujlwm tawm ntawm lub thawv yam tsis muaj teeb meem.

Kuv vam tias koj nyiam qhov kev qhia no. Qhia rau kuv paub yog tias koj nyiam qhov no lossis ua rau koj tus kheej. Raws li ib txwm kuv zoo siab tau txais cov lus tawm tswv yim thiab cov lus pom (ua tau zoo, tsis muaj trolls thov).

Pom zoo: