Cov txheej txheem:
- Kauj ruam 1: URL API
- Kauj Ruam 2: Node-RED
- Kauj ruam 3: Txaus
- Kauj Ruam 4: Yuav Ua Li Cas Txaus Ntshai - Kauj Ruam 1
- Kauj Ruam 5: Yuav Ua Li Cas Txaus Ntshai - Kauj Ruam 2
- Kauj Ruam 6: Txhim Kho Qhov Tsis Pom Zoo
- Kauj ruam 7: Dashboard
- Kauj Ruam 8: Nws Ua Haujlwm Li Cas
- Kauj Ruam 9: Cov Ntsiab Lus Hais Txog Saum Toj thiab Lawv Cov Chaw
- Kauj Ruam 10: Cov Lus Qhia Ntxiv
Video: Ua Haujlwm Nrog URL API hauv Node-RED: 10 Cov Kauj Ruam
2024 Tus sau: John Day | [email protected]. Kawg hloov kho: 2024-01-30 09:25
Cov lus qhia no yuav qhia koj yuav siv URL API li cas (http tau txais) hauv node-RED. Nws yog txhob txwm yooj yim. Thiab yog tias koj tseem tshiab rau node-RED ces qhov piv txwv no yog rau koj. Kuv yuav qhia koj yuav siv node-RED ib puag ncig thiab yog dab tsi, thiab yuav siv URL API li cas.
Rau kev qhia lub hom phiaj kuv yuav siv NETIO 4Txhua lub ntsej muag ntse ntse, tab sis tsis txhob txhawj NETIO muaj qhov zoo hauv online demo uas peb yuav siv yog li koj tsis tas yuav yuav dab tsi.
Kauj ruam 1: URL API
*Rau kev qhia lub hom phiaj Kuv yuav piav qhia nrog lub hwj chim ntse NETIO 4All
Cov hlua ntawm cov cim tau txais los ntawm NETIO lub cuab yeej hauv URL tau muab faib ua cov lus txib ib leeg thiab cov cuab yeej tom qab teeb nws cov txiaj ntsig rau lub xeev xav tau raws li tus lej ua.
Kev ua nrog cov zis:
- 0 = Cov zis tso tawm (Tawm)
- 1 = Cov zis tau qhib rau (On)
- 2 = Cov zis tawm rau lub sijhawm luv (luv luv)
- 3 = Cov zis tau qhib rau lub sijhawm luv (luv luv)
- 4 = Cov zis hloov pauv los ntawm ib lub xeev mus rau lwm qhov (toggle)
- 5 = Lub xeev tso tawm tsis hloov (tsis hloov)
URL API piv txwv (toggles lub xeev cov zis 1):
netio-4all.netio-products.com:8080/netio.cgi?pass=netio-psw&output1=4
Kauj Ruam 2: Node-RED
Tab sis dab tsi yog node-RED?
Node-RED yog lub cuab yeej rau kev txuas ua ke cov cuab yeej kho vajtse, APIs thiab kev pabcuam online hauv txoj hauv kev tshiab thiab nthuav. Node-RED muab qhov browser-based flow editor thiab xaiv dav ntawm cov nodes thiab kev xaiv.
Nws tau tsim ntawm Node. JS, ua rau nws zoo tagnrho rau kev ua haujlwm ntawm tus nqi qis xws li Raspberry Pi ntxiv rau hauv huab.
Node-RED yog lub platform nrov rau IoT (Internet ntawm Yam) kev thov. Kev ntws (uas yog, tsab ntawv lossis ib qhov project) tuaj yeem hloov pauv tau yooj yim raws li teeb tsa json cov ntaub ntawv.
Kauj ruam 3: Txaus
Thiab tam sim no qhov tseem ceeb. Nov yog yuav ua li cas node-RED ib puag ncig zoo li. Hauv cov kauj ruam tom ntej kuv yuav qhia koj yuav ua li cas ntshuam ntws.
Raws li koj tuaj yeem pom Node-RED muab qhov browser-based flow editor uas ua rau nws yooj yim rau xaim ua ke ntws siv ntau yam ntawm cov nodes hauv cov xim. Cov dej ntws tuaj yeem xa mus rau lub sijhawm ua haujlwm hauv ib-nias.
JavaScript lub luag haujlwm tuaj yeem tsim nyob hauv tus kws kho mob siv cov ntawv nplua nuj. Lub tsev qiv ntawv built-in tso cai rau koj khaws cov haujlwm muaj txiaj ntsig, tus qauv lossis cov dej ntws rov los siv dua.
Kauj Ruam 4: Yuav Ua Li Cas Txaus Ntshai - Kauj Ruam 1
Hauv cov ntawv qhia zaub mov, xaiv Ntshuam -> Clipboard.
Kauj Ruam 5: Yuav Ua Li Cas Txaus Ntshai - Kauj Ruam 2
Tom qab ntawd, theej cov ntawv hauv qab no mus rau qhov chaw qhia thiab nyem Ntshuam.
[{"id": "53632275.7d628c", "type": "tab", "label": "NETIO AN29 (URL API)", "xiam oob qhab": tsis tseeb, "info": ""}, {"id": "bf404b4d.c9abf8", "type": "http request", "z": "53632275.7d628c", "name": "HTTP Request (GET)", "method": "GET", "ret": " txt "," url ":" https://netio-4all.netio-products.com:8080/netio.cgi?pass=&{{msg.payload}} "," tls ":" "," x ": 600, "y": 160, "xov hlau":
Kauj Ruam 6: Txhim Kho Qhov Tsis Pom Zoo
Cov nodes raug thauj mus rau qhov kev xaiv uas tau xaiv. Nws muaj peev xwm hais tias cov lus yuam kev tau tshwm nrog cov npe ntawm cov khoom thaiv uas tau raug xa tab sis tseem tsis tau teeb tsa hauv Node-RED tseem. Hauv qhov no, cov thaiv uas ploj lawm yuav tsum tau teeb tsa. Yog tias muaj cov nodes uas ploj lawm, xaiv Manage palette hauv cov ntawv qhia zaub mov.
Tom qab ntawd xaiv Nruab thiab nrhiav thiab teeb tsa cov node koj ploj lawm.
Kauj ruam 7: Dashboard
Dashboard yog Graphical interface uas koj tuaj yeem ua haujlwm koj li haujlwm yog tias koj xav tau.
Lub Dashboard tuaj yeem qhib los ntawm txhaj lub cim qhia, lossis ntawm qhov chaw nyob ntawm koj li Node-RED server nrog ui txuas ntxiv, piv txwv: 127.0.0.1:1880/ui
Kauj Ruam 8: Nws Ua Haujlwm Li Cas
- Tsib lub khawm tsim hauv Flow tau tshwm rau hauv Dashboard.
- Tom qab nyem qhov Output 1 = ON khawm hauv Dashboard, qhov them nyiaj tau teeb tsa rau 1 (txhais hauv txhua tus khawm kom txhawm rau txheeb xyuas qhov ua).
- Qhov Action Selector node xaiv txoj hlua uas sib haum rau qhov kev nqis tes ua (nkag mus rau qhov them nyiaj) thiab tsim qhov URL qhov tshwm sim rau kev tswj hwm lub qhov hluav taws xob ntse.
- Qhov Kev Thov HTTP (Tau Txais) node sib txuas tus IP chaw nyob + kev nqis tes ua los ntawm tus nqi them tus nqi nkag, thiab xa cov txiaj ntsig uas tau siv HTTP Tau Txais Kev Thov. Cov lus teb server (xwm txheej) raug xa rov qab raws li qhov tso tawm.
- msg.payload node qhia cov lus teb los ntawm HTTP server khiav hauv netio 4Txhua yam khoom siv.
- Thiab Cov Lus Teb los ntawm server node qhia cov lus teb server hauv Dashboard
Kauj Ruam 9: Cov Ntsiab Lus Hais Txog Saum Toj thiab Lawv Cov Chaw
Kauj Ruam 10: Cov Lus Qhia Ntxiv
Ua tsaug rau koj nyeem kuv cov lus qhia. Kuv vam tias koj nyiam nws thiab kawm tau qee yam tshiab.
Cov lus qhia no tau qhia sai ntawm Yuav siv URL API li cas nrog node-RED
Rau cov lus qhia ntxaws nyem rau ntawm qhov link hauv qab no.
www.netio-products.com/en/application-notes/an29-node-red-example-of-url-api-communication-with-netio-4x
Tsis tas li muaj cov lus qhia zoo ib yam txog ntau yam kev siv ntawm node-RED yog li yog koj xav paub xav tshawb fawb ntxiv:
Ua haujlwm nrog REST JSON hauv node-RED
www.netio-products.com/en/application-notes/an30-node-red-example-of-rest-json-communication-with-netio-4x
Ua haujlwm nrog REST XML hauv node-RED
www.netio-products.com/en/application-notes/an31-node-red-example-of-rest-xml-communication-with-netio-4x
Ua haujlwm nrog TCP/Modbus hauv node-RED
Yuav los sai sai
Pom zoo:
Siv Kev Cia Siab Lub Hauv Paus txuas ntxiv txhawm rau Nrhiav Lub Tuam Tsev Tsis Ua Haujlwm Txoj Cai Ua Haujlwm Hauv Koj Tsev Neeg Tsob Ntoo ntawm Kev Tshawb Nrhiav Tsev Neeg: 11 Kauj Ruam
Siv Kev Cia Siab Lub Hauv Paus Txuas Ntxiv kom Nrhiav Lub Tuam Tsev Tsis Ua Haujlwm Ua Haujlwm Hauv Koj Tsev Neeg Tsob Ntoo ntawm Kev Tshawb Nrhiav Tsev Neeg: Lub hom phiaj ntawm cov lus qhia no yog los qhia seb yuav tshawb nrhiav koj tsev neeg tsob ntoo li cas hauv Tsev Neeg Nrhiav rau cov poj koob yawm txwv nrog kev ua haujlwm hauv lub tuam tsev tsis tiav siv Kev Cia Siab lub hauv siab txuas ntxiv. Siv Kev Cia Siab Lub Hauv Paus tuaj yeem ua rau koj qhov kev tshawb nrhiav tsis tiav
Tus Thawj Saib Xyuas Haujlwm - Tsev Haujlwm Ua Haujlwm Hauv Tsev: 5 Kauj Ruam (nrog Duab)
Tus Thawj Saib Xyuas Haujlwm - Tsev Tswj Xyuas Haujlwm Hauv Tsev: Kuv xav sim daws qhov teeb meem tshwm sim tiag tiag hauv peb tsev neeg (thiab, kuv xav txog, ntawm ntau lwm tus neeg nyeem), uas yog yuav faib li cas, txhawb siab, thiab muab nqi zog rau kuv cov menyuam rau kev pab tawm nrog ua haujlwm hauv tsev. Txog tam sim no, peb tau khaws cov ntawv laminated
Kev Nkag Mus Rau Cov Hauv Paus Cov Hauv Paus Cov Ntaub Ntawv Siv DB410 Raws Li Ethernet Dongle: 6 Cov Kauj Ruam
Kev Nkag Mus Rau Cov Hauv Paus Cov Hauv Paus Cov Ntaub Ntawv Siv DB410 Raws Li Ethernet Dongle: Lub Hom Phiaj: Txhim kho cov cuab yeej cuab tam thiab rov ua dua cov ntsiav kom ntxig USB Ethernet CDC Gadget txhawb nqa; Rov tsim boot.img los ntawm Linaro rau khau raj USB Ethernet CDC; Tsim NFS server los tuav lub hauv paus cov ntaub ntawv system; IP teeb tsa hauv DEVICE thiab HOST
Yuav Ua Li Cas Tswj Cov Khoom Siv Hauv Tsev Nrog TV Chaw Taws Teeb Nrog Timer Ua Haujlwm: 7 Cov Kauj Ruam (nrog Duab)
Yuav Ua Li Cas Tswj Cov Khoom Siv Hauv Tsev Nrog TV Chaw Taws Teeb Nrog Lub Sijhawm Ua Haujlwm: Txawm tias tom qab 25 xyoo ntawm nws qhov kev qhia rau cov neeg siv khoom lag luam, kev sib txuas lus infrared tseem muaj feem cuam tshuam nyob rau hnub tsis ntev los no. Txawm hais tias nws yog koj li 55 nti 4K TV lossis koj lub suab lub tsheb, txhua yam xav tau IR chaw taws teeb tswj los teb rau peb
Arduino Tone Generator Tsis Muaj Lub Tsev Qiv Ntawv lossis Cov Haujlwm Ua Haujlwm (Nrog cuam tshuam): 10 Cov Kauj Ruam
Arduino Tone Generator Tsis Muaj Lub Tsev Qiv Ntawv lossis Cov Haujlwm Ua Haujlwm (Nrog cuam tshuam): Qhov no tsis yog ib yam uas kuv ib txwm ua qhia rau, Kuv nyiam kuv cov haujlwm hlau, tab sis raws li kuv yog cov tub ntxhais kawm hluav taws xob engineering thiab yuav tsum tau kawm ib chav ntawm microcontrollers ( Embedded Systems Design), Kuv xav tias kuv yuav ua tus qhia rau ntawm ib qho ntawm kuv li