Cov txheej txheem:
- Kauj Ruam 1: Txhim Kho thiab Khiav XAMPP
- Kauj ruam 2: MySQL
- Kauj Ruam 3: Cov Ntaub Ntawv PHP
- Kauj Ruam 4: LUA Cov Ntaub Ntawv
- Kauj ruam 5: Kho kom raug Code
- Kauj Ruam 6: Xaus
Video: NODEMCU LUA ESP8266 Txuas rau MySQL Database: 6 Kauj Ruam
2024 Tus sau: John Day | [email protected]. Kawg hloov kho: 2024-01-30 09:27
Cov lus qhia no tsis yog rau cov neeg qaug zog vim nws siv XAMPP (Apache, MySQL & PHP), HTML thiab tau kawg LUA. Yog tias koj muaj kev ntseeg siab ntawm kev daws cov no, nyeem ntawm no!
Kuv siv XAMPP vim nws tuaj yeem teeb tsa ntawm tus cwj mem lossis koj lub hard drive thiab nws tau teeb tsa kom khiav tam sim. Muaj lwm qhov WAMP (rau Windows) thiab LAMP (rau Linux) cov servers tawm uas yuav ua haujlwm ib yam nkaus thiab yog tias koj muaj lub siab tawv tiag, koj tuaj yeem teeb tsa server los ntawm kos!
Koj tuaj yeem tau txais XAMPP ntawm no:
TSWV YIM: Hloov pauv index.php thiab index.html rau qee yam xws li index1.php thiab index1.html kom koj tau txais cov npe ntawm cov haujlwm hauv browser, ntau dua li nws dhia mus rau XAMPP pib qhov screen.
Kauj Ruam 1: Txhim Kho thiab Khiav XAMPP
Thaum koj tau rub tawm XAMPP, ua raws cov lus qhia ntawm kev teeb tsa thiab thaum koj ua tiav koj yuav tsum tau pib cov ntxaij vab tshaus zoo li cov saum toj no. Koj yuav tsum pib Apache thiab MySql rau LUA txoj haujlwm kom ua haujlwm.
L: / xampp / xampp-control.exe
Hloov daim ntawv tsav (L:) mus rau txhua qhov chaw koj tau teeb tsa XAMPP.
Kauj ruam 2: MySQL
Thaum koj muaj Apache & MySQL khiav pib cmd.exe thiab tom qab ntawd ntaus ntawv
L: thiab RETURN qhov tseem ceeb - lossis txhua qhov chaw koj tau teeb tsa XAMPP (L yog tsab ntawv tsav rau kuv tus cwj mem tsav koj li tej zaum yuav txawv)
ces
CD xampp / mysql / bin thiab RETURN qhov tseem ceeb.
Pib MySql los ntawm kev ntaus qhov no ntawm DOS tam sim (raws li saud).
mysql -u hauv paus -p
tom qab ntawv nyem RETURN thaum nug tus password.
Tom qab ntawd koj tuaj yeem siv cov ntawv sau hauv qab no thiab koj yuav tsum pom qee yam zoo li saum toj no.
USE xeem
QHIA TABLE YOG TUS NEEG YUAV TSUM sau; CREATE TABLE writeread (logdata datetime, teb varchar (20), tus nqi loj (20)); INSERT INTO sau ntawv (logdata, teb, tus nqi) VALUES ('2017-01-01 06:30:10', '24', '67'); SELECT * LOS NTAWM sau ntawv;
Kuv tau siv cov npe hauv paus yam tsis muaj tus password thiab cov ntaub ntawv ntsuas los tsim kuv lub rooj. Nov yog tus txheej txheem teeb tsa rau MySQL uas tsis muaj kev nyab xeeb ua haujlwm.
Kauj Ruam 3: Cov Ntaub Ntawv PHP
Muaj 2 cov ntaub ntawv suav nrog, 1 sau cov ntaub ntawv mus rau lub rooj database thiab 1 nyeem nws rov qab thiab tso tawm hauv qhov browser.
Vim muaj kev ruaj ntseg, PHP cov ntaub ntawv tsis raug tso rau hauv lub xaib no, yog li thaum koj rub tus nyeem ntawv.txt thiab tus kws sau ntawv.txt, hloov lawv mus rau tus nyeem ntawv.php thiab tus sau ntawv.php, thiab thauj lawv mus rau hauv htdocs nplaub tshev ntawm XAMPP.
Koj tuaj yeem sim yog tias writer.php ua haujlwm los ntawm kev ntaus ntawv
localhost/writer.php? teb = 7 & tus nqi = 3
lossis 127.0.0.1/writer.php?field=7&value=3
mus rau hauv qhov browser thiab yog tias txhua yam ua haujlwm koj yuav tsum tau txais kev nkag mus ntxiv hauv cov lus database.
Txoj haujlwm nyeem ntawv.php teev tawm txhua kab ntawm lub rooj rau hauv koj tus browser. Khiav qhov program no los ntawm ob npaug nyem nws hauv qhov browser lossis los ntawm kev ntaus ntawv
localhost/nyeem ntawv.php
lossis 127.0.0.1/reader.php
mus rau qhov chaw nyob bar ntawm qhov browser.
Kauj Ruam 4: LUA Cov Ntaub Ntawv
Cov ntaub ntawv jlwriter.lua yuav tsum yog ntawm ESP8266. Kuv siv nws ntawm WeMos version, tab sis tsis muaj laj thawj vim li cas nws yuav tsum tsis ua haujlwm ntawm ib qho ESP8266.
Yog tias koj tseem nrog kuv thiab txhua yam tau ua haujlwm, koj yuav tsum pom ib qho screen zoo li saum toj no.
TSWV YIM: Thaum siv MySQL nias F3 txuag koj ntaus hauv tag nrho tsab ntawv dua.
Hauv LUA qhov kev hloov pauv (kab 29) rau IP chaw nyob ntawm txhua yam koj lub PC siv los txuas rau koj lub router lossis modem.
conn: txuas (80, '192.168.0.10')
Ntaus ipconfig rau hauv Command prompt (cmd.exe) kom pom koj tus IP chaw nyob.
Kauj ruam 5: Kho kom raug Code
Kuv pom tus lej zoo editor yog Notepad ++ uas tuaj yeem rub tawm ntawm no
notepad-plus-plus.org/
Nws tuaj yeem siv nrog ntau yam lus sib txawv lossis cov ntawv sau thiab nws yog pub dawb.
Kuv tau suav nrog teeb tsa.txt los teeb tsa koj li MySQL cov lus yog tias koj xav siv PHP los ua nws tsis yog txoj hauv kev saum toj no.
Ib zaug ntxiv koj yuav tsum tau hloov lub npe cov ntaub ntawv rau setup.php, tom qab ntawv luam nws mus rau hauv htdocs nplaub tshev.
Ceev faj tias khiav cov ntaub ntawv no yuav tshem tawm cov lus yav dhau los thiab cov ntaub ntawv.
Kauj Ruam 6: Xaus
Qhov no tau qhia yooj yim dua, tab sis thaum kawg kuv tau ua kom nws ua haujlwm. Hauv lub vev xaib, muaj qee qhov haujlwm uas zoo ib yam rau qhov no, tab sis lawv tau sau rau DHT22 sensor. Tom qab sim cov phiaj xwm no nrog qhov ua tsis tiav, Kuv txiav txim siab sau txhua yam kuv tuaj yeem pom txog MySQL sau hauv LUA thiab pib los ntawm kos. Tom qab kev sim ntau thiab ua yuam kev, kuv tuaj nrog qhov no. Kuv tau siv Apache, MySQL, PHP thiab HTML yav dhau los, yog li muaj kev nkag siab txog tias sab ntawd ua haujlwm li cas.
Cov haujlwm no tsuas yog khawb qhov ntawm qhov koj tuaj yeem ua thaum txuas nrog MySQL database. Nws ua rau koj sau cov ntaub ntawv thiab khaws nws ntawm koj tus kheej lub PC ntau dua li qee tus neeg rau zaub mov tsis paub. Kuv vam tias muaj txaus nyob ntawm no los muab rau koj saj rau yam uas tuaj yeem ua tiav nrog cov kev ua haujlwm zoo no.
Pom zoo:
Yuav Ua Li Cas Txuas NodeMCU ESP8266 rau MySQL Database: 7 Kauj Ruam
Yuav Ua Li Cas Txuas NodeMCU ESP8266 rau MySQL Database: MySQL yog siv dav siv cov ntaub ntawv txheeb xyuas kev sib txheeb (RDBMS) uas siv cov lus nug teeb tsa (SQL). Qee lub sijhawm, koj yuav xav upload Arduino/NodeMCU sensor cov ntaub ntawv mus rau MySQL database. Hauv Cov Lus Qhia no, peb yuav pom yuav ua li cas txuas
Txuas Txuas Txuas Txuas: 5 Cov Kauj Ruam
Txuas Txuas Lub Sijhawm: Nyob Zoo! Hauv qhov kev qhia no koj yuav pom yuav ua li cas txuas nrog ib qho khoom siv Arduino sib xws, nruab nrog WiFi, rau REST APIs! Qhov no siv GitKraken Glo Board webapp los tsim cov laug cam, kab & daim npav los npaj khoom! Qee qhov kev paub ntawm yuav ua li cas pej xeem
Kev Sib Txuas Txuas Txuas Txuas Siv Bluefruit: 4 Cov Kauj Ruam
Kev Sib Txuas Tsis Sib Txuas Siv Bluefruit: Nov yog cov lus qhia yooj yim los ntawm kauj ruam qhia los hloov koj cov xov hlau nrog bluetooth tsis muaj zog txuas: Nws coj kuv ib pliag los daws qhov no vim tias tsis muaj cov ntaub ntawv hais txog kev ua qhov no nrog bluetooth niaj hnub tsis muaj zog thev naus laus zis raws li Bluefrui
EZ Kev Sib Txuas Txuas Txuas Txuas Ntxiv - Tsis Muaj Tus Kheej! (CSRC-311): 7 Kauj Ruam
EZ Kev Sib Txuas Txuas Txuas Txuas Ntxiv - Tsis Muaj Tus Kheej! (CSRC-311): Tsis ntev dhau los ntawm Azamom.com (thov txim, tam sim no tau muag tawm) Kuv tau hla qhov kev pom zoo zoo ntawm Common Sense RC CSRC-311 tus qauv-siv servos.Noj zoo, Kuv xav hloov qee yam ntawm tsis tu ncua kev sib hloov. Txoj kev kuv tuaj nrog yog yooj yim heev thiab xav tau
Cov lus qhia rau Ua Plaub Qhov Kev Txuas Txuas Txuas Rau Qhov Chaw Mounted Footrest: 9 Cov Kauj Ruam (nrog Duab)
Cov lus qhia rau Ua Plaub Qhov Kev Txuas Txuas Txuas Rau Lub Hauv Paus Mounted Footrest: Mid-drive fais fab log lub rooj zaum (PWC) tau dhau los ua neeg nyiam nyob rau xyoo tas los no. Txawm li cas los xij, vim qhov kev tso rau pem hauv ntej casters, cov tsoos sab-mounted footrests tau hloov los ntawm ib qho chaw nruab nrab-footrest. Hmoov tsis zoo, center-mou