Cov txheej txheem:

Tsev Automation Siv Raspberry Pi 3 thiab Node-RED: 6 Cov Kauj Ruam
Tsev Automation Siv Raspberry Pi 3 thiab Node-RED: 6 Cov Kauj Ruam

Video: Tsev Automation Siv Raspberry Pi 3 thiab Node-RED: 6 Cov Kauj Ruam

Video: Tsev Automation Siv Raspberry Pi 3 thiab Node-RED: 6 Cov Kauj Ruam
Video: Get Started → Learn English → Master ALL the ENGLISH BASICS you NEED to know! 2024, Hlis ntuj nqeg
Anonim
Tsev Automation Siv Raspberry Pi 3 thiab Node-RED
Tsev Automation Siv Raspberry Pi 3 thiab Node-RED

Cov Ntaub Ntawv Yuav Tsum Tau: 1. Raspberry Pi 32. Relay Module3. Jumper WiresFor More Info Xa mus:

Kauj Ruam 1: Txhim Kho Node Liab

Node-RED yog lub cuab yeej pom kev rau xaim Internet ntawm Yam uas tuaj yeem ua haujlwm ntawm Raspberry Pi thiab tso cai rau kev tsim qauv sai ntawm cov haujlwm. Ua ntej kuv pib, kuv xav tshem qee yam: Kuv yog tus tshiab ntawm no yog li nws tuaj yeem ua tau tias kuv tau ua yuam kev. Yog li cia li tsis quav ntsej nws. Teeb Raspberry Pi ntawm lub network thiab hloov kho qhov faib khoom. Koj tuaj yeem khiav cov lus txib hauv qab no hauv qhov dav dav rau qhov ntawd: sudo rpi-updatesudo reboot Tom qab rov pib ua haujlwm raws li cov lus txib: sudo apt-tau hloov tshiab apt-tau hloov tshiab Thaum kawg ntawm qhov haujlwm, kawg cov neeg siv ntawm qhov haujlwm no yuav zoo li cov hauv qab no:

Kauj Ruam 2: Txhim Kho Node-Red

Daim ntawv thov no khiav hauv web browser, yog li koj tsis tas yuav nruab ib daim ntawv thov ntxiv los ua si nrog nws thiab koj tuaj yeem khiav nws los ntawm ib lub xov tooj ntse, ntsiav tshuaj lossis los ntawm PC uas muaj lub vev xaib. Thiab raws li qhov project no txhawj xeeb, koj tuaj yeem siv koj lub tsev nyob hauv koj li network hauv tsev nkaus xwb. Koj tuaj yeem txuas ntxiv kev ua haujlwm ntawm cov kab ke tab sis kuv yuav tsis piav qhia nws hauv qhov haujlwm no. Rau qhov haujlwm no, thawj zaug koj yuav tsum teeb tsa Node-RED ntawm Raspberry Pi 2. Txhua Node-RED ntawm Raspberry PiThere muaj ob txoj hauv kev rau qhov no: Muaj kev teeb tsa ua ntej Node-RED thaum Lub Kaum Ib Hlis 2015 Raspbian Jessie duab. Mus rau: Menu-> Programming-> Node-RED. Or koj tuaj yeem teeb tsa nws tus kheej. Cov ntaub ntawv zoo heev muaj rau qhov ntawd thiab koj tuaj yeem pom nws nyob ntawm no. Running Node-RED Tom qab teeb tsa txhua yam, cov kauj ruam tom ntej yog ua Node-RED. Koj tuaj yeem khiav nws los ntawm Cov Ntawv Qhia lossis los ntawm cov lus txib hauv qab no hauv davhlau ya nyob twg: node-red-startnode-red-stop (kom nres Node-RED) Yog tias koj xav ua haujlwm ntawm Raspberry Pi desktop, tom qab ntawd qhib lub vev xaib thiab nkag mus rau chaw nyob koj tuaj yeem pom raws li pom hauv cov duab hauv qab no tom qab khiav Node-RED:

Kauj Ruam 3: Qhib Node-Liab

Qhib Node-Liab
Qhib Node-Liab

Los yog qhov kev xaiv thib ob (zoo dua li ua haujlwm ntawm tus tswv hauv zos) yog qhib lub vev xaib hauv lwm lub PC (nrawm dua li Raspberry Pi) txuas nrog koj lub network hauv tsev thiab nkag mus rau qhov chaw nyob raws li koj tuaj yeem pom hauv daim duab hauv qab no. Kuv tau siv qhov kev xaiv thib ob Qhib lub vev xaib thiab nkag mus rau qhov chaw nyob ntawm koj tus Raspberry Pi, hauv kuv qhov xwm txheej nws yog: 192.168.1.12:1880 Yog tias txhua yam raug lawm ces koj yuav pom cov txiaj ntsig hauv qab no: Raws li koj tuaj yeem pom ntawm sab laug muaj ntau qhov sib txawv, thiab kuv Kuv yuav siv qee qhov ntawm lawv rau txoj haujlwm no. Tsuas yog Drag thiab Drop los siv lawv.

Kauj Ruam 4: Txhim Kho Ntxiv Ntxiv

Txhim Kho Ntxiv Nodes
Txhim Kho Ntxiv Nodes

ntxiv cov nodes rau koj Raspberry Pi thiab nws yooj yim heev, tsuas yog sau cov lus txib hauv qab no hauv davhlau ya nyob twg: cd ~/.node-rednpm nruab node-red-contrib-gpio (Cov Ntaub Ntawv) npm nruab node-red-contrib-ui (Cov Ntaub Ntawv) Koj tuaj yeem pom ntau lwm cov hauv paus thiab cov ntaub ntawv ntawm no (tsis xav tau rau txoj haujlwm no). Tom qab ua cov lus txib no, Kuv pom zoo kom nres thiab rov pib dua Node-RED yog li nws tuaj yeem hloov kho cov npe ntawm cov npe.

Kauj Ruam 5: Teeb Hareware

Hareware Teeb
Hareware Teeb

Khoos phis tawj Khoos phis tawj Txuas cov khoom siv kho vajtse kom raug raws li koj tau hais hauv Node-RED. Txheeb xyuas ntu ntu kab lus rau kab kos duab.

Pom zoo: