Cov txheej txheem:

Tsim Raspberry Pi SUPER Weather Station: 8 Kauj Ruam (nrog Duab)
Tsim Raspberry Pi SUPER Weather Station: 8 Kauj Ruam (nrog Duab)

Video: Tsim Raspberry Pi SUPER Weather Station: 8 Kauj Ruam (nrog Duab)

Video: Tsim Raspberry Pi SUPER Weather Station: 8 Kauj Ruam (nrog Duab)
Video: Raspberry Pi Weather Station 2024, Hlis ntuj nqeg
Anonim
Image
Image

Cia peb ntsib nws, peb tib neeg tham txog huab cua ntau ⛅️. Tus neeg nruab nrab tham txog huab cua plaub zaug hauv ib hnub, rau qhov nruab nrab ntawm 8 feeb thiab 21 vib nas this. Ua lej thiab suav tag nrho 10 lub hlis ntawm koj lub neej uas koj yuav siv yapping txog huab cua. Cov huab cua nyob raws li #1 mus-rau cov ncauj lus rau kev sib tham pib thiab tsis xis nyob ua kom tawg. Yog tias peb yuav tham txog qhov ntawd ntau, peb kuj tseem yuav coj peb txoj kev huab cua txoj kev ntseeg mus rau qib tshiab. Txoj haujlwm lom zem thiab yooj yim no yuav siv Internet ntawm Yam (IoT) thiab Raspberry Pi los ua qhov ntawd.

Peb tab tom tsim peb tus kheej huab cua huab cua hauv zos IoT dashboard, ntes huab cua sab hauv thiab sab nraum peb lub tsev dhau sijhawm. Lwm zaus lwm tus neeg nug koj "ua li cas txog huab cua tsis ntev los no?", Koj yuav tuaj yeem nplawm koj lub xov tooj thiab tso lawv ua pa nrog koj li kev ntsuas huab cua npau npau skillz ☀️.

Yam koj yuav tsum tau kawm kom tiav: 1. Raspberry Pi w/ internet txuas

2. Raspberry Pi SenseHAT

3. Ib 6 40-Pin IDE Txiv neej rau Poj Niam Extension Cable (xaiv tau kom raug qhov tseeb)

4. Ib lub Xeev Thawj tus as khauj

5. Nws yog nws!

Qhov project qib: Pib

Lub sijhawm kwv yees kom tiav: 20 feeb

Kwv yees qhov kev lom zem: Tawm ntawm kab kos

Hauv qhov kev qhia ib qib ib qib, koj yuav: kawm paub siv Weatherstack API kev koom ua ke ntawm Lub Xeev Pib li cas kom tau txais huab cua sab nraud hauv cheeb tsam hauv koj cheeb tsam

- Kawm paub siv Raspberry Pi nrog Sense HAT (https://www.raspberrypi.org/products/sense-hat/) txhawm rau ntes cov ntaub ntawv huab cua hauv koj lub tsev

- Tsim koj tus kheej lub vaj huam sib luag huab cua huab cua hauv zos uas koj tuaj yeem nkag tau los ntawm txhua lub vev xaib ntawm koj lub khoos phis tawj lossis lub xov tooj ntawm tes

- Muab koj tus kws tshawb fawb huab cua khiav rau lawv cov nyiaj

Khoom siv

Yam koj yuav tsum tau kawm kom tiav:

1. Raspberry Pi w/ internet txuas

2. Raspberry Pi SenseHAT

3. Ib 6 40-Pin IDE Txiv neej rau Poj Niam Extension Cable (xaiv tau kom raug qhov tseeb)

4. Ib lub Xeev Thawj tus as khauj

5. Nws yog nws!

Kauj ruam 1: Pib

Peb twb tau tso ntau txoj haujlwm ua haujlwm rau koj tso cov cai ua ke, thiab npaj cov ntaub ntawv. Peb tsuas yog xav kom koj hloov kho ob peb txoj kev.

Txhawm rau khaws txhua yam uas peb tau npaj rau koj, koj yuav tsum tau clone lub chaw cia khoom los ntawm GitHub. Github yog qhov kev pabcuam txaus uas tso cai rau peb khaws, tshuaj xyuas thiab tswj cov haujlwm zoo li no. Txhawm rau clone lub chaw cia khoom txhua yam peb yuav tsum tau ua yog mus rau hauv peb lub Pi lub davhlau ya nyob twg, lossis koj lub khoos phis tawj davhlau ya nyob twg uas yog SSH'd rau hauv koj tus pi thiab ntaus cov lus txib no:

$ git clone

Ntaus nkag mus thiab koj yuav pom cov ntaub ntawv no:

pi@raspberrypi ~ $ git clone

Cloning rau hauv 'wunderground-sensehat'…

tej thaj chaw deb: Suav cov khoom: 28, ua tiav.

tej thaj chaw deb: Tag nrho 28 (delta 0), rov qab siv 0 (delta 0), ntim rov qab siv 28

Unpacking khoom: 100% (28/28), ua tiav.

Txheeb xyuas kev sib txuas … ua tiav.

Thaum koj pom qhov no ces ua kev zoo siab, koj tau ua tiav cloned Github Repo thiab muaj tag nrho cov ntaub ntawv tsim nyog los tsim koj Lub Chaw Huab Cua Zoo. Ua ntej peb txav mus rau cov kauj ruam tom ntej, cia peb siv sijhawm los tshawb nrhiav ib puag ncig phau ntawv no thiab kawm ob peb qhov kev hais kom ua kab lus yooj yim.

Ntaus cov lus txib hauv qab no rau hauv koj lub davhlau ya nyob twg:

$ ls os

Cov lus txib no teev txhua yam uas muaj nyob hauv phau ntawv teev npe uas koj nyob tam sim no. Cov npe no qhia tau tias peb Github Repo tau ua tiav cloned rau hauv peb cov npe hauv lub npe "wunderground-sensehat." Cia peb saib seb dab tsi hauv phau ntawv teev npe ntawd. Txhawm rau hloov cov npe, txhua yam koj yuav tsum tau ua yog ntaus "cd" thiab tom qab ntawd ntaus lub npe ntawm cov npe uas koj xav mus.

Hauv qhov no, peb yuav ntaus:

$ cd wunderground-sensehat

Thaum peb ntaus nkag mus, koj yuav pom tias tam sim no peb nyob hauv phau ntawv teev npe huab cua-sensehat. Cia peb ntaus ls ntxiv kom pom cov ntaub ntawv twg peb tau teeb tsa ntawm peb tus pi.

README.md sensehat.py sensehat_wunderground.py wunderground.py

Nov peb pom qhov peb tau txais peb cov ntawv nyeem, thiab ob peb cov ntaub ntawv nab nab sib txawv. Cia peb saib ntawm sensehat.py. Hloov chaw dhia mus rau hauv cov ntaub ntawv w/ cd hais kom ua zoo li peb tau ua rau cov npe, peb yuav siv nano hais kom ua. Cov lus txib nano tso cai rau peb qhib nano ntawv kho qhov twg peb muaj tag nrho peb cov nab npawb nab npawb rau txhua ntu ntawm txoj haujlwm no. Mus tom ntej thiab ntaus:

$ nano sensehat.py

Ntawm no koj tuaj yeem pom tag nrho cov cai peb tau npaj rau koj rau txoj haujlwm no. Peb yuav tsis hloov pauv rau cov ntaub ntawv no tseem tsis tau tiav, tab sis xav tias muaj kev ywj pheej mus ncig thiab pom dab tsi peb yuav ua tom qab hauv qhov kev qhia no.

Kauj Ruam 2: Thawj Xeev

Lub Xeev Thawj
Lub Xeev Thawj

Peb xav kom tshaj tawm tag nrho peb cov ntaub ntawv huab cua mus rau huab kev pabcuam thiab muaj qhov kev pabcuam ntawd tig peb cov ntaub ntawv mus rau hauv lub dashboard zoo uas peb tuaj yeem nkag tau los ntawm peb lub khoos phis tawj lossis lub xov tooj ntawm tes. Peb cov ntaub ntawv xav tau lub hom phiaj. Peb yuav siv Thawj Lub Xeev raws li lub hom phiaj ntawd.

Kauj Ruam 1: Sau npe rau Tus Thawj Xeev tus as khauj

Mus rau https://www.initialstate.com/app#/register/ thiab tsim tus account tshiab.

Kauj ruam 2: Nruab ISStreamer

Txhim Kho Thawj Lub Xeev Python module rau koj li Raspberry Pi: Ntawm qhov hais kom sai (tsis txhob hnov qab SSH rau hauv koj Pi ua ntej), khiav cov lus txib hauv qab no:

$ cd/tsev/pi/

$ / curl -sSL https://get.initialstate.com/python -o -| sudo tsoo

Ceeb Toom Kev Ruaj Ntseg: Cov lus txib saum toj no muaj qee lub cev tseem ceeb uas tus neeg siv yuav tsum paub txog.

1) Muaj qhov ua ntej / ua ntej curl. Qhov no yog qhov tseem ceeb kom ntseeg tau tias tsis muaj cov npe cuav tau khiav yog tias ib tus tau tsim. Qhov no pab txo qis kev pheej hmoo ntawm cov lus txib ua ntau dua li lub hom phiaj.

2) Cov lus txib yog cov lus txib, yog li thaum ua haujlwm, koj tab tom xa cov ntawv sau uas tau rov qab los ntawm https://get.initialstate.com/python rau hauv qhov hais kom ua sudo bash. Qhov no tau ua kom yooj yim teeb tsa, txawm li cas los xij, nws yuav tsum tau sau tseg tias https tseem ceeb ntawm no txhawm rau pab xyuas kom tsis muaj tus txiv neej-hauv-nruab nrab-kev ua haujlwm ntawm kev teeb tsa tsab ntawv, tshwj xeeb tshaj yog txij li tsab ntawv tau ua haujlwm nrog cov cai tshwj xeeb. Nov yog ib txoj hauv kev yooj yim rau nruab thiab teeb tsa, tab sis yog tias koj tau ceev faj me ntsis muaj qee qhov kev xaiv yooj yim me ntsis: koj tuaj yeem ua txhaum cov lus txib ua ob kauj ruam thiab tshawb xyuas cov ntawv bash tau rub los ntawm curl hais kom ua koj tus kheej kom ntseeg tau Nws yog kev ncaj ncees LOSSIS koj tuaj yeem ua raws cov lus qhia pip, koj tsuas yog tsis tau txais qhov ua piv txwv ua piv txwv tsab ntawv.

Kauj Ruam 3: Ua qee Automagic

Tom qab Kauj Ruam 2 koj yuav pom qee yam zoo ib yam li cov hauv qab no tso rau ntawm qhov screen:

pi@raspberrypi ~ $ / curl -sSL https://get.initialstate.com/python -o -| sudo tsoo

Lo lus zais: Pib ISStreamer Python Kev teeb tsa yooj yim!

Qhov no yuav siv ob peb feeb los teeb tsa, rub qee lub kas fes:)

Tab sis tsis txhob hnov qab rov qab los, Kuv yuav muaj lus nug tom qab!

Pom yooj yim_install: setuptools 1.1.6

Pom pip: pip 1.5.6 los ntawm /Library/Python/2.7/site-packages/pip-1.5.6- py2.7.egg (sej 2.7)

pip loj version: 1

pib me version: 5

ISStreamer pom, hloov kho…

Qhov yuav tsum tau muaj tam sim no: ISStreamer hauv /Library/Python/2.7/site-packages Tu tu…

Koj puas xav tau automagically tau txais cov ntawv piv txwv? [y/N]

(cov zis tuaj yeem sib txawv thiab siv sijhawm ntev dua yog tias koj tsis tau teeb tsa Lub Xeev Pib Python streaming module ua ntej)

Thaum hais kom ua kom tau txais cov ntawv piv txwv, ntaus y.

Qhov no yuav tsim cov ntawv xeem uas peb tuaj yeem ua haujlwm kom ntseeg tau tias peb tuaj yeem xa cov ntaub ntawv mus rau Lub Xeev Pib los ntawm peb Pi. Koj yuav raug ceeb toom:

Koj xav khaws qhov piv txwv nyob qhov twg? [default:./is_example.py]:

Koj tuaj yeem xaiv hom kev cai hauv nroog lossis ntaus nkag mus lees txais lub neej ntawd. Koj yuav tau txais kev ceeb toom rau koj lub npe siv thiab tus lej nkag uas koj nyuam qhuav tsim thaum koj sau npe rau koj Tus Thawj Xib Fwb Lub Xeev. Nkag mus rau ob qho thiab kev teeb tsa yuav ua tiav.

Kauj ruam 4: Nkag Nkag Mus

Cia peb saib qhov piv txwv tsab ntawv uas tau tsim. Hom:

$ nano is_example.py

Ntawm kab 15, koj yuav pom kab uas pib nrog streamer = Streamer (thoob _…. Cov kab no tsim cov ntaub ntawv tshiab lub npe hu ua “Python Stream Piv Txwv” thiab cuam tshuam nrog koj tus lej nyiaj. Qhov koom haum no tshwm sim vim yog access_key =”…” parameter ntawm kab ntawd tib yam. Cov kab ntawv ntev thiab cov lej yog koj li Thawj Lub Xeev tus lej nkag mus siv tus lej. Yog tias koj mus rau koj Lub Xeev Thawj tus lej hauv koj lub vev xaib, nyem rau ntawm koj lub npe siv nyob rau sab xis, tom qab ntawd mus rau "kuv tus account", koj yuav pom tus yuam sij nkag tib yam hauv qab ntawm nplooj ntawv hauv qab "Cov Ntsiab Lus Nkag Mus Rau Hauv".

Txhua lub sijhawm koj tsim cov ntaub ntawv kwj, tus yuam sij nkag mus yuav ncaj qha cov ntaub ntawv xa mus rau koj tus lej nyiaj (yog li tsis txhob faib koj tus yuam sij rau leej twg).

Kauj Ruam 5: Khiav Tus Qauv

Khiav cov ntawv xeem kom paub tseeb tias peb tuaj yeem tsim cov ntaub ntawv xa mus rau koj Tus Thawj Xeev tus as khauj.

Khiav cov hauv qab no:

$ python is_example.py

Kauj Ruam 6: Nyiaj tau los

Rov qab mus rau koj lub Xeev Thawj tus lej hauv koj lub vev xaib. Ib lub thoob cov ntaub ntawv tshiab hu ua "Python Stream Piv txwv" yuav tsum tau tshwm nyob rau sab laug hauv koj lub txee rau khoom (koj yuav tau rov ua nplooj ntawv tshiab). Nyem rau ntawm lub thoob no thiab tom qab ntawd nyem rau ntawm Waves icon kom pom cov ntaub ntawv ntsuas.

Koj yuav xav nqis tes los ntawm Kev qhia nthwv dej kom paub koj tus kheej nrog yuav ua li cas siv cov cuab yeej pom kev pom no. Tom ntej no, saib cov ntaub ntawv hauv Cov Vuas kom pom cov ntaub ntawv zoo ib yam no hauv daim ntawv dashboard.

Tam sim no koj tau npaj los pib tshaj tawm cov ntaub ntawv tiag tiag los ntawm Wunderground thiab ntau ntxiv.

Kauj Ruam 3: Paub HAT

Sense HAIS
Sense HAIS
Sense HAIS
Sense HAIS
Sense HAIS
Sense HAIS

Sense HAT yog ib qho ntxiv rau ntawm lub Rooj Tswjhwm Saib Raspberry Pi uas muaj tag nrho cov ntsuas, LEDs, thiab me me joystick. Dab tsi yog qhov zoo txog qhov ntxiv me me no yog tias nws yooj yim heev rau nruab thiab siv ua tsaug rau lub tsev qiv ntawv Python zoo heev uas koj tuaj yeem nruab sai. Txog qhov haujlwm no, peb yuav siv qhov ntsuas kub, av noo, thiab ntsuas ntsuas qhov ntsuas cua ntawm Sense HAT. Cia peb teeb tsa.

Thawj kauj ruam hauv kev siv Sense HAT yog lub cev nruab nws rau koj Pi. Nrog Pi txhawb zog, txuas HAT raws li qhia hauv daim duab.

Fais fab ntawm koj Pi. Peb yuav tsum teeb tsa lub tsev qiv ntawv Python kom yooj yim nyeem qhov ntsuas qhov ntsuas los ntawm Sense HAT. Ua ntej, koj yuav tsum xyuas kom txhua yam hloov kho tshiab ntawm koj li Raspbian version los ntawm kev ntaus:

$ sudo apt-tau hloov tshiab

Tom ntej no, nruab Sense HAT Python lub tsev qiv ntawv:

$ sudo apt-tau nruab kev nkag siab-lub kaus mom

Reboot koj Pi

Peb tau npaj los ntsuas Sense HAT los ntawm kev nyeem cov ntaub ntawv sensor los ntawm nws thiab xa cov ntaub ntawv ntawd mus rau Lub Xeev Pib.

Cia peb sim peb Sense HAT kom paub tseeb tias txhua yam ua haujlwm. Peb yuav siv tsab ntawv nyob ntawm https://github.com/InitialState/wunderground-sensehat/blob/master/sensehat.py. Koj tuaj yeem luam tsab ntawv no mus rau cov ntaub ntawv ntawm koj Pi lossis nkag mus los ntawm peb Github chaw cia khoom uas peb tau cloned ua ntej. Hloov mus rau hauv koj phau ntawv teev npe wunderground-sensehat thiab tom qab ntawd nano rau hauv koj daim ntawv sensehat.py los ntawm kev ntaus ntawv:

$ nano sensehat.py

Daim ntawv ceeb toom ntawm thawj kab uas peb tab tom ntshuam lub tsev qiv ntawv SenseHat rau hauv tsab ntawv. Ua ntej koj pib sau tsab ntawv no, peb yuav tsum teeb tsa peb cov neeg siv khoom.

# --------- Tus Neeg Siv Chaw --------- Nroog = "Nashville"

BUCKET_NAME = ": ib nrab_sunny:" + Nroog + "Huab Cua"

BUCKET_KEY = "kev xav"

ACCESS_KEY = "Koj_Access_Key"

SENSOR_LOCATION_NAME = "Chaw Haujlwm"

MINUTES_BETWEEN_SENSEHAT_READS = 0.1

# ---------------------------------

Tshwj xeeb, koj yuav tsum teeb tsa koj li ACCESS_KEY rau koj li Thawj Lub Xeev tus lej nkag mus siv tus lej. Pom tias nws yooj yim npaum li cas los nyeem cov ntaub ntawv los ntawm Sense HAT hauv ib kab ntawm Python (piv txwv li sense.get_temperature ()). Ntawm qhov hais kom sai ntawm koj Pi, khiav tsab ntawv:

$ sudo nab hab sej sensehat.py

Mus rau koj Tus Thawj Xib Fwb Lub Xeev thiab saib lub thoob cov ntaub ntawv tshiab tsim los ntawm Sense HAT.

Tam sim no, peb tau npaj los tso nws txhua qhov ua ke thiab tsim peb cov huab cua huab cua hauv zos!

Kauj Ruam 4: Hyper Local Weather Dashboard

Hyper Local Weather Dashboard
Hyper Local Weather Dashboard
Hyper Local Weather Dashboard
Hyper Local Weather Dashboard

Kauj ruam kawg hauv txoj haujlwm no tsuas yog sib txuas peb Cov Ntaub Ntawv Huab Cua thiab peb Sense HAT tsab ntawv rau hauv ib qho Dashboard. Txhawm rau ua qhov no, peb yuav siv Thawj Qhov Kev Sib Koom Hauv Xeev nrog Weatherstack txhawm rau ntxiv cov ntaub ntawv huab cua rau hauv peb Sensehat dashboard peb tau tsim hauv theem kawg.

Siv Weatherstack API yog qhov yooj yim heev. Yav dhau los ntawm qhov kev qhia no, peb tau koj tsim thiab khiav ib tsab ntawv los rub cov ntaub ntawv los ntawm huab cua cov ntaub ntawv api, tab sis txij li thaum pib ntawm qhov kev qhia no Lub Xeev Pib tau tsim cov Cov Ntaub Ntawv Kev Lag Luam Kev Lag Luam. Cov Ntaub Ntawv Kev Lag Luam Ua Lag Luam muab rau koj lub zog siv thiab nkag mus rau API's rau Thawj Lub Xeev dashboard uas tsis muaj tus lej. Nws yog cia li ob peb nas nias thiab BAM: cov ntaub ntawv huab cua. Ntawm nruab nrab, Kuv tau sau ntau qhov kev qhia ntxaws ntxaws txog yuav siv Weatherstack li cas thiab tsim kev ceeb toom huab cua, tab sis kuv yuav sau sai sai yuav pib li cas hauv qab no.

Siv Kev Tshawb Fawb Huab Cua

1. Nkag mus rau hauv koj lub Xeev Tus Kheej Tus Kheej

2. Nyem rau khawm cov ntsiab lus ntawm lub thawv Weatherstack ntawm nplooj ntawv sib koom ua ke. Nplooj ntawv no yuav qhia koj txhua yam ntaub ntawv yooj yim txog kev sib koom ua ke thiab yam uas yuav tsum tau siv nws. Hauv qhov no, koj tsuas yog xav tau tus lej zip (lossis latitude & longitude) ntawm qhov chaw uas koj yuav xav saib xyuas huab cua rau, thiab koj yuav tsum paub cov koog twg koj yuav xav pom cov ntaub ntawv ntawd hauv (metric, scientific lossis Asmeskas imperial).

3. Nyem rau Start Setup khawm thiab koj yuav pom lub modal pop up los ntawm sab xis ntawm koj lub vijtsam. Tsuas yog ob peb kauj ruam yooj yim ua ua ntej peb tuaj yeem pib saib cov ntaub ntawv huab cua no hauv:

4. Muab koj lub dashboard tshiab lub npe. Kuv lub npe hu ua kuv Nashville Weather. Pro cov lus qhia: Kuv nyiam siv emoji hauv kuv lub dashboards cov npe kom muab lawv me ntsis ntxiv. Txoj hauv kev nrawm los rub emojis ntawm Mac yog Ctrl+Command+Space bar. Rau Windows tuav lub Windows khawm thiab lub sijhawm (.) Lossis semicolon (;). 25. Ntaus koj qhov chaw nyob. Kuv siv Tus Zip Code ntawm thaj chaw kuv xav taug, tab sis koj tseem tuaj yeem tso Latitude thiab Longitude kom meej dua. Nws yog qhov yooj yim los nrhiav txoj kab nruab nrab thiab ntev ntawm koj thaj chaw tsuas yog mus rau hauv google maps, tshawb nrhiav qhov chaw thiab tom qab ntawd luam theej duab latitude & longitude tawm ntawm qhov browser thiab muab nws tso rau hauv daim ntawv. Tsuas yog Asmeskas, UK thiab Canada qhov chaw tuaj yeem siv nyob rau lub sijhawm no.

6. Xaiv koj chav nyob. Kuv xaiv US/Imperial vim kuv nyob hauv Tebchaws Meskas.

7. Xaiv los tsim lub thoob tshiab lossis xa koj li Weatherstack cov ntaub ntawv mus rau lub thoob uas twb muaj lawm. lub thoob.

8. Xaiv seb koj puas xav tau txhua cov ntaub ntawv uas Weatherstack xa lossis yog koj xav tau cov ntaub ntawv huab cua tshwj xeeb xa rau koj lub dashboard. Koj tuaj yeem xa tag nrho cov ntaub ntawv thiab nqa ob peb vuas tawm tom qab.

9. Xaiv ntau npaum li cas koj xav kom koj lub dashboard hloov kho nrog huab cua. Koj tuaj yeem xaiv nruab nrab ntawm txhua 15 feeb lossis teev ib teev. Nco ntsoov tias xa cov ntaub ntawv txhua 15 feeb tus nqi ntxiv token piv rau xa nws txhua teev. Yog li, yog tias koj xav siv lwm qhov kev sib koom ua lag luam nyob rau tib lub sijhawm ces koj tuaj yeem xav tsuas yog pov npav txhua teev. Koj ib txwm tuaj yeem nres xa cov ntaub ntawv los ntawm kev sib koom ua ke thiab pib dua, lossis hloov qhov zaus uas koj xa cov ntaub ntawv tom qab. Txawm li cas los xij, yog tias koj nres nws thiab rov pib dua yuav muaj qhov khoob ntawm koj cov ntaub ntawv.

10. Nyem Pib Kev Sib Koom. Tam sim no koj tau tshaj tawm cov ntaub ntawv los ntawm Weatherstack! Nyem rau "Saib hauv IoT App" khawm kom pom thawj cov ntaub ntawv cov ntsiab lus yob hauv.

11. Kho koj lub dashboard. Yog tias koj tau ntws mus rau lub thoob tshiab, peb tau teeb tsa koj nrog tus qauv kom koj pib. Txawm li cas los xij, koj yuav tsum ua koj tus kheej! Nias tus xub xub nyob rau sab saum toj ntawm koj lub dashboard kom txo qis sijhawm, nyem Kho kom raug cov vuas, txav qee cov vuas ncig, hloov lawv thiab hloov keeb kwm yav dhau. Ua lub dashboard raws li qhov koj xav tau kom nws yooj yim rau koj nkag mus rau cov ntaub ntawv koj xav sau. Koj kuj tseem tuaj yeem siv lwm tus qauv Weatherstack uas peb tau tsim rau koj ntawm no. Txhawm rau ntxiv cov ntsiab lus me me rau koj lub dashboard, koj tseem tuaj yeem ntxiv daim duab qhia chaw uas qhia qhov chaw ntawm qhov chaw koj tab tom saib xyuas huab cua. Koj lub dashboard yuav zoo li liab qab me ntsis thaum xub thawj, tab sis muab nws qee lub sijhawm thiab nws yuav sau nrog cov ntaub ntawv huab cua zoo nkauj yav dhau los.

Kauj Ruam 5: Ntxiv Daim Ntawv Qhia rau Koj Lub Dashboard (Bonus)

Ntxiv Daim Ntawv Qhia rau Koj Lub Dashboard (Bonus)
Ntxiv Daim Ntawv Qhia rau Koj Lub Dashboard (Bonus)
Ntxiv Daim Ntawv Qhia rau Koj Lub Dashboard (Bonus)
Ntxiv Daim Ntawv Qhia rau Koj Lub Dashboard (Bonus)
Ntxiv Daim Ntawv Qhia rau Koj Lub Dashboard (Bonus)
Ntxiv Daim Ntawv Qhia rau Koj Lub Dashboard (Bonus)

Peb tuaj yeem yooj yim ntxiv daim phiaj qhia chaw rau peb lub dashboard qhia qhov chaw ntawm peb cov huab cua. Koj tuaj yeem kawm paub ntau ntxiv txog kev sib tham daim duab qhia chaw hauv cov vuas atttp: //support.initialstate.com/knowledgebase/articles/800232-tiles-map-view. Peb tuaj yeem yooj yim ntxiv cov lus tshiab streamer.log hauv peb tsab ntawv Python (thiab kuv yuav piav qhia koj yuav ua li cas thaum kawg ntawm ntu no). Hloov chaw, peb yuav siv sijhawm no los qhia koj lwm txoj hauv kev xa cov ntaub ntawv rau hauv koj lub dashboard.

Kauj Ruam 1: Tau Txais Koj Qhov Chaw Nyob Qhov Caij Nyoog/Ntev Ntev Ua Haujlwm

Koj yuav tsum tau txais qhov latitude/longitude coordinates ntawm koj qhov chaw nyob. Ib txoj hauv kev los ua qhov no yog mus rau Google Maps, tshawb nrhiav koj qhov chaw, thiab nthuav dav rau koj qhov chaw nyob. Hauv qhov URL, koj yuav pom koj qhov latitude/longitude coordinates. Hauv qhov piv txwv saum toj no, kuv qhov kev sib koom tes yog 35.925298, -86.8679478.

Luam koj cov ntawv tswj hwm (koj yuav xav tau lawv hauv qib 2), thiab nco ntsoov tias koj tsis yuam kev luam cov cim ntxiv los ntawm URL.

Kauj ruam 2: Tsim qhov URL kom xa cov ntaub ntawv rau hauv koj lub Dashboard

Nyem rau ntawm "teeb tsa" txuas hauv qab lub npe thoob hauv lub thoob ntim khoom. Qhov no yuav coj qhov screen saum toj no. Luam cov ntawv hauv seem API Endpoint thiab muab tshuaj txhuam rau hauv koj cov ntawv nyeem uas koj nyiam. Peb yuav siv qhov no los tsim qhov URL uas peb tuaj yeem siv xa cov ntaub ntawv mus rau hauv peb lub thoob uas twb muaj lawm thiab dashboard. Hauv kuv lub thoob, cov ntawv uas kuv tau theej zoo li: https://groker.initialstate.com/api/events?accessKey=bqHk4F0Jj4j4M4CrhJxEWv6ck3nfZ79o&bucketKey=shwu1 Koj qhov URL yuav muaj koj accessKey thiab bucketKey. Peb yuav tsum tau ntxiv cov npe dej thiab tus nqi rau qhov URL kom ua tiav qhov URL.

Ntxiv "& MapLocation = YOUR_COORDINATES_FROM_STEP1" rau koj qhov URL

(ntxig qhov kev tswj hwm los ntawm Kauj Ruam 1, tsis muaj qhov chaw thiab tsis txhob luam kuv !!)

Nov yog qhov kuv zoo li: https://groker.initialstate.com/api/events?accessKey=bqHk4F0Jj4j4M4CrhJxEWv6ck3nfZ79o&bucketKey=shwu1&MapLocation=35.925298, -86.8679478

Muab koj qhov URL ua tiav rau ntawm qhov chaw nyob bar ntawm koj tus browser thiab ntaus nkag (lossis siv 'curl' hais kom ua ntawm qhov hais kom ua sai sai) kom xa koj daim ntawv qhia chaw mus rau kwj, "MapLocation", hauv koj lub thoob tshiab.

Yog tias koj saib koj lub dashboard hauv Cov Pob Zeb tam sim no (koj yuav tsum tau rov ua dua yog tias koj tsis ua siab ntev), Cov Pobzeb tshiab hu ua MapLocation yuav tsum tau nthuav dav nthuav rau koj qhov chaw tam sim no.

Kauj Ruam 2 Kev Xaiv: Hloov Kho Koj Tsab Ntawv

Yog tias koj tsis nyiam Kauj Ruam 2 saum toj no, koj tuaj yeem yooj yim ntxiv lwm cov ntsiab lus streamer.log rau koj tsab ntawv Python. Tsuas ntxiv kab

streamer.log ("MapLocation", "YOUR_COORDINATES_FROM_STEP1")

qee qhov sab hauv def lub ntsiab (): ua haujlwm ntawm sensehat_wunderground.py tsab ntawv (them nyiaj rau kev nkag mus b/c Python xav kom koj ua raws txoj cai nruj rau kev nkag mus). Piv txwv li, kuv ntxiv streamer.log ("MapLocation", "35.925298, -86.8679478") tom qab kab 138.

Kauj Ruam 6: Txhim Kho Qhov Ntsuas Qhov Ntsuas Qhov Ntsuas Kub

Txhim Kho Sense Lub Ntsuas Kub Kev Nyeem Ntawv
Txhim Kho Sense Lub Ntsuas Kub Kev Nyeem Ntawv
Txhim Kho Qhov Ntsuas Qhov Ntsuas Qhov Ntsuas Kub
Txhim Kho Qhov Ntsuas Qhov Ntsuas Qhov Ntsuas Kub
Txhim Kho Qhov Ntsuas Qhov Ntsuas Qhov Ntsuas Kub
Txhim Kho Qhov Ntsuas Qhov Ntsuas Qhov Ntsuas Kub

Koj yuav pom tias koj li kev paub HAT qhov ntsuas kub zoo li me ntsis - qhov ntawd yog vim lawv yog. Tus neeg ua txhaum yog cua sov tsim los ntawm Pi lub CPU ua kom cua sov nyob ib puag ncig Sense HAT thaum nws zaum saum lub Pi.

Txhawm rau ua qhov ntsuas kub ntsuas tau txais txiaj ntsig, peb yuav tsum tau txais HAT kom deb ntawm Pi (uas yuav tshem tawm qhov txiaj ntsig tseem ceeb ntawm kev ua kev daws teeb meem me me) lossis sim ntsuas qhov ntsuas kub ntsuas. CPU yog thawj qhov ua rau muaj cua sov cuam tshuam rau peb qhov ntsuas kub, yog li peb yuav tsum txheeb xyuas qhov sib txheeb. Thaum tshuaj xyuas Enviro pHAT rau Pi Zero peb tau los nrog qhov sib npaug kom suav nrog CPU kub cuam tshuam rau lub kaus mom kub nyeem ntawv. Peb tsuas yog xav tau CPU kub thiab ntsuas qhov ntsuas los ntsuas qhov ntsuas kub:

temp_calibrated = temp - ((cpu_temp - temp)/FACTOR)

Peb tuaj yeem nrhiav qhov ntsuas los ntawm kev ntsuas qhov ntsuas kub tiag tiag thiab daws rau nws. Txhawm rau nrhiav qhov ntsuas kub nyob hauv chav, peb xav tau qhov ntsuas kub sib txawv teeb tsa. Siv lub DHT22 sensor (teeb tsa cov lus qhia ntawm no thiab tsab ntawv ntawm no), peb tuaj yeem sau thiab pom ob qho tib si kub ib txhij:

Qhov tshwm sim qhia pom tias Sense HAT nyeem tau tawm los ntawm 5-6 degrees Fahrenheit zoo nkauj tas li. Ntxiv CPU qhov kub mus rau hauv qhov sib xyaw (nrog tsab ntawv no), thawj zaug qhia tau tias nws kub heev, thiab qhov thib ob tawm qhia txog qhov nthwv dej uas Sense HAT ntsuas ntsuas.

Tom qab kaw txog 24 teev, Kuv tau daws qhov teeb meem uas siv rau kev nyeem sib txawv ntawm rau rau lub ntsiab lus sib txawv hauv lub sijhawm. Qhov nruab nrab qhov tseem ceeb tau muab qhov txiaj ntsig zaum kawg ntawm 5.466. Siv qhov kev ua zauv

temp_calibrated = temp - ((cpu_temp - temp) /5.466)

qhov ntsuas kub tau los rau hauv ib qib ntawm qhov ntsuas kub tiag tiag:

Koj tuaj yeem ua qhov kev ntsuas ntsuas no ntawm Pi nws tus kheej, sab hauv ntawm wunderground_sensehat.py tsab ntawv.

Kauj Ruam 7: Cov Nyiaj Tau Los: Kho Koj Tus Kheej Txog Huab Cua

Lawm: Kho Koj Tus Kheej Huab Cua Alerts
Lawm: Kho Koj Tus Kheej Huab Cua Alerts
Lawm: Kho Koj Tus Kheej Huab Cua Alerts
Lawm: Kho Koj Tus Kheej Huab Cua Alerts

Cia peb tsim SMS ceeb toom thaum twg qhov kub poob qis dua khov.

Peb yuav ua raws Txoj Cai Teeb Meem teeb tsa txheej txheem teev tseg ntawm nplooj ntawv txhawb nqa.

Xyuas kom tseeb tias koj cov ntaub ntawv huab cua thoob.

Nyem rau ntawm lub thoob teeb tsa hauv cov ntaub ntawv khaws tseg (hauv nws lub npe).

Nyem rau ntawm Triggers tab.

Xaiv cov ntaub ntawv kwj kom ua rau (koj tuaj yeem siv daim ntawv teev npe nqis los xaiv los ntawm cov kwj uas twb muaj lawm ib zaug cov ntaub ntawv tau ntim lossis koj tuaj yeem ntaus lub npe kwj/tus yuam sij ntawm tus kheej; *ceeb toom Safari tsis txhawb nqa HTML5 cov npe poob). Hauv kuv qhov piv txwv piv txwv saum toj no, Kuv xaiv Kub (F).

Xaiv tus neeg teb xov tooj raws li txoj cai, hauv qhov no '<'.

Xaiv tus nqi txhais uas yuav ua rau kev nqis tes ua (ntaus tus kheej hauv tus nqi xav tau). Hauv qhov no, ntaus 32 raws li qhia saum toj no.

Nyem rau '+' khawm ntxiv qhov ua rau mob.

Xaiv qhov kev nqis tes ua (kev ua tam sim no muaj qhia los ntawm SMS lossis email).

Nyem rau '+' khawm ntxiv qhov ua. Nkag mus rau ib qho lej pov thawj yog tias ntxiv tus lej xov tooj tshiab lossis email kom ua tiav kev teeb tsa.

Koj qhov ntsuas tam sim no nyob thiab yuav tua thaum qhov xwm txheej tau ntsib. Nyem ua kom rov qab mus rau lub vijtsam tseem ceeb.

SMS PIB

Thaum twg qhov kub tau qis dua 32, koj yuav tau txais ntawv xov xwm. Koj teeb tsa kev ceeb toom ntawm ib yam dab tsi hauv koj cov ntaub ntawv huab cua (*nco ntsoov tias koj yuav tsum siv emoji tokens, tsis yog emojis tiag).

Piv txwv li, thaum twg los nag

: cloud: Weather Conditions =: umbrella:

Thaum twg nws yog cua hlob

: khiav ceev: Cua Ceev (MPH)> 20

lwm yam.

Kauj ruam 8:

Internet ntawm Yam Kev Sib Tw 2016
Internet ntawm Yam Kev Sib Tw 2016
Internet ntawm Yam Kev Sib Tw 2016
Internet ntawm Yam Kev Sib Tw 2016

Qhov khoom plig thib ob hauv Internet ntawm Kev Sib Tw Xyoo 2016

Pom zoo: