Cov txheej txheem:
- Kauj Ruam 1: Yam Yuav Tsum Tau
- Kauj ruam 2: ID nkag mus
- Kauj Ruam 3: Tsawg Ntau Cov Lus txib
- Kauj Ruam 4: Node-RED thiab PHPMyAdmin
- Kauj Ruam 5: Nco Ntsoov Yam
- Kauj Ruam 6: Koj Tus Kheej CPU_Temp_Logger
Video: MySQL thiab Node-RED Nrog Raspberry Pi: 6 Kauj Ruam
2024 Tus sau: John Day | [email protected]. Kawg hloov kho: 2024-01-30 09:27
Nyob zoo phooj ywg. Hauv cov lus qhia no, kuv yuav qhia koj yuav siv Node-RED mysql ntawm qhov twg los ua qhov yooj yim CPU ntsuas kub. Cia peb pib.
Qhov no tseem yuav yog tus pib qhia rau kev kawm:
Node-RED, nws muaj peev xwm, thiab cov ntsiab lus tseem ceeb.
Kev teeb tsa PHPMyAdmin thiab MySQL.
Javascript Function Node hauv Node-RED.
Thov txim rau daim duab plooj.
Kauj Ruam 1: Yam Yuav Tsum Tau
Txog qhov haujlwm no kuv tab tom siv Raspberry Pi Zero vim tias nws me me thiab pheej yig Nws tuaj yeem yooj yim haum rau hauv koj lub hnab ris. Yog li koj lub software taug kev nrog koj. Tab sis koj tuaj yeem siv txhua lub khoos phis tawj uas koj xaiv, tsuav nws yog Debian Linux raws.
Koj tseem yuav xav tau Kev Sib Txuas Hauv Is Taws Nem thiab nkag mus hauv koj lub computer ntawm lub davhlau ya nyob twg (lossis ssh).
Yog tias koj siv Mac lossis Linux:-
$ ssh pi@your_pi's_ip_address
Yog tias koj siv Windows, rub tawm thiab teeb tsa Putty:-
www.chiark.greenend.org.uk/~sgtatham/putty…
Kauj ruam 2: ID nkag mus
Default Raspbian ID nkag mus:-
pi thiab raspberry.
Tom ntej no, khiav cov lus txib no.
sudo apt-tau hloov tshiab
sudo apt-tau hloov tshiab
sudo apt-tau nruab nodejs npm nodered.
Nco ntsoov tias koj yuav tsis tau txais nodered nkag tau yooj yim yog tias koj siv cov laus version ntawm Raspbian, lossis Ubuntu 18.04 LTS lossis Debian 9
Hauv cov xwm txheej no koj yuav tsum ua haujlwm ntawm Node-RED Install script:-
bash <(curl -sL
Kauj Ruam 3: Tsawg Ntau Cov Lus txib
Tom qab koj muaj txhua yam teeb tsa khiav
sudo apt-tau nruab -y mysql-server php-mysql phpmyadmin apache2
Online koj tseem tuaj yeem pom cov lus qhia yuav ua li cas rau nruab phpmyadmin thiab mysql.
sudo nano /etc/apache2/apache2.conf
Mus rau hauv qab thiab ntxiv
Xws li /etc/phpmyadmin/apache.conf
Txuag siv Ctrl + O, Nkag mus. Tawm nrog CTrl + x
sudo /etc/init.d/apache2 rov pib dua
Yog tias phpmyadmin tau teeb tsa tiav koj yuav tsum tuaj yeem nkag mus rau localhost/phpmyadmin
Hloov localhost nrog koj tus IP tus IP.
Nkag mus raws li lub hauv paus thiab tus password koj tau teeb tsa ua ntej thaum lub sijhawm phpmyadmin teeb tsa.
Kauj Ruam 4: Node-RED thiab PHPMyAdmin
Node-RED tso cai rau koj tsim cov duab txuas nrog cov haujlwm lossis ntws. Kawm paub ntau ntxiv txog Node-RED ntawm
Txog tam sim no, kuv yuav qhia koj yuav ua li cas los tsim lub logger yooj yim.
Mus rau https://raspberrypi.local: 1880
Ua raws li cov duab.
Nov yog JSON txoj hlua
[{"id": "7c27ad7b.907564", "type": "tab", "label": "MySQL Test", "Disabled": cuav, "info": "Qhov no yog ntws los qhia tawm MySQL node hauv Node-Red. / NPeb ntsuas qhov ntsuas kub ntawm Raspberry Pi CPU thiab nkag mus rau hauv lub database. "}, {" Id ":" abb00580.da71b8 "," type ":" inject "," z ":" 7c27ad7b. 907564 "," name ":" Trigger "," topic ":" "," payload ":" "," payloadType ":" date "," repeat ":" 2 "," crontab ":" "," ib zaug ": tsis tseeb," onceDelay ": 0.1," x ": 120," y ": 120," xov hlau ":
Luam thiab muab cov hlua no zoo li nws nyob hauv qhov chaw pom hauv daim duab.
Kuv kuj tau tshaj tawm cov duab uas qhia cov nkag hauv PHPMyAdmin.
Kauj Ruam 5: Nco Ntsoov Yam
Ob peb yam tseem ceeb kom nco ntsoov yog tus IP chaw nyob. Nws yuav txawv. Tsis tas li, koj yuav tsum xub tsim cov ntaub ntawv npe Node-RED-test, lub rooj npe hu ua xeem thiab npe lub npe "Field". Koj tuaj yeem ua tiav txhua qhov no nrog kev pab ntawm PHPMyAdmin lub vev xaib cov cuab yeej. Nws ua rau muab cov ntaub ntawv khaws cov ncuav mog qab zib. Muaj ntau qhov peev txheej hauv online los pab koj. Koj yuav tsum nruab vcgencmd ntawm koj lub computer. Nws yog lub cuab tam tseem ceeb uas tso cai rau koj los saib koj cov ntaub ntawv xov xwm. Nws los ua ntej teeb tsa ntawm Raspbian Stretch.
Txhawm rau khiav Node-RED:-
1) ncaj qha-
$ node-liab-pib
2) Hauv txhua qhov khau raj-
$ sudo systemctl pab kom nodered.service
Kauj Ruam 6: Koj Tus Kheej CPU_Temp_Logger
Tam sim no yog tias koj tshawb cov ntaub ntawv hauv phpmyadmin raws li qhia hauv daim duab, koj yuav pom cov ntawv nkag rau hauv koj lub rooj nrog qhov kub ntawm koj li CPU.
Txoj haujlwm Node yog dab tsi tseem ceeb ntawm no. Nws tso cai rau koj los lim cov lus thiab xa cov lus nug nrog rau qhov ntsuas sib txawv. Kuv tau piav qhia nws hauv cov haujlwm muaj nuj nqi. Txheeb nws tawm. Cov ntawv nkag tau ua txhua txhua ob lub vib nas this, tab sis koj tuaj yeem hloov qhov ncua hauv kev txhaj tshuaj.
Muaj Kev lom zem:)
Thov nyiam qhov haujlwm no thiab tshaj tawm cov lus pom, ua rau lawv pab tau tiag tiag. Tsis tas li, nco ntsoov taw qhia ib qho kev ua yuam kev uas kuv tau ua, thiab xav nug cov lus nug.
Ua Tsaug Rau Saib Kab Lus No.
Nyob zoo !!!
Pom zoo:
Fingerprint thiab RFID Raws Kev Koom Tes Nrog Siv Raspberry Pi thiab MySQL Database: 5 Cov Kauj Ruam
Fingerprint thiab RFID Raws Kev Tuaj Koom Nrog Siv Raspberry Pi thiab MySQL Database: Yees duab ntawm Txoj Haujlwm no
Nkag Mus Cov Ntaub Ntawv thiab Npaj Cov Duab Online Siv NodeMCU, MySQL, PHP thiab Chartjs.org: 4 Cov Kauj Ruam
Nkag Mus Cov Ntaub Ntawv thiab Npaj Cov Duab Online Siv NodeMCU, MySQL, PHP thiab Chartjs.org: Cov lus qhia no piav qhia yuav ua li cas peb tuaj yeem siv Node MCU pawg thawj coj los sau cov ntaub ntawv los ntawm ntau lub ntsuas, xa cov ntaub ntawv no mus rau tus tswv PHP cov ntaub ntawv uas tom qab ntawd ntxiv cov ntaub ntawv rau MySQL database. Cov ntaub ntawv tuaj yeem pom online hauv kab ntawv, siv chart.js.A ba
Tswj Kev Nkag Mus Los ntawm Arduino YÚN Nrog MySQL, PHP5 thiab Python: 11 Kauj Ruam (nrog Duab)
Tswj Kev Nkag Mus Los ntawm Arduino YÚN Nrog MySQL, PHP5 thiab Python: Nyob Zoo Cov Phooj Ywg! Zoo, raws li koj paub, nyob rau lub Cuaj Hli qhov kev tshaj tawm tshiab tshaj tawm tshiab ntawm Arduino, Arduino YUN. Tus phooj ywg me me no muaj Linux teeb tsa kab ke uas peb tuaj yeem ua haujlwm txhua yam koj tuaj yeem xav txog (tsawg kawg yog kom deb li deb). Thaum muaj cov ntaub ntawv me me heev
8 Relay Tswj Nrog NodeMCU thiab IR Txais Txais Siv WiFi thiab IR Chaw Taws Teeb thiab Android App: 5 Kauj Ruam (nrog Duab)
8 Relay Tswj Nrog NodeMCU thiab IR Txais Txais Siv WiFi thiab IR Chaw Taws Teeb thiab Android App: Tswj 8 qhov hloov pauv hloov siv nodemcu thiab ir tus txais tshaj wifi thiab ir chaw taws teeb thiab hauv app.the ir tej thaj chaw deb ua haujlwm ywj pheej ntawm wifi txuas. NTUJ
Kub thiab Vaum Zaub thiab Sau Cov Ntaub Ntawv Nrog Arduino thiab Ua: 13 Kauj Ruam (nrog Duab)
Kub thiab Vaum Zaub thiab Sau Cov Ntaub Ntawv Nrog Arduino thiab Ua: Intro: Qhov no yog Txoj Haujlwm uas siv Arduino board, Sensor (DHT11), lub khoos phis tawj Windows thiab Kev Ua Haujlwm (rub tawm dawb) program los tso saib Kub, Cov ntaub ntawv vaum hauv digital thiab bar kab ntawv, tso tawm lub sijhawm thiab hnub tim thiab suav lub sijhawm suav