Cov txheej txheem:

Yuav Ua Li Cas Txuas NodeMCU ESP8266 rau MySQL Database: 7 Kauj Ruam
Yuav Ua Li Cas Txuas NodeMCU ESP8266 rau MySQL Database: 7 Kauj Ruam

Video: Yuav Ua Li Cas Txuas NodeMCU ESP8266 rau MySQL Database: 7 Kauj Ruam

Video: Yuav Ua Li Cas Txuas NodeMCU ESP8266 rau MySQL Database: 7 Kauj Ruam
Video: How I Made this Electric Car that can go Anywhere 2024, Kaum ib hlis
Anonim

MySQL yog siv dav siv kev txheeb xyuas cov ntaub ntawv txheeb xyuas qhov system (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 NodeMCU ESP8266 rau MySQL database.

Ntawm no kuv yuav siv 000webhost los tuav MySQL database vim tias yooj yim thiab muaj pub dawb. Txawm li cas los xij, koj tuaj yeem siv txhua lub platform nrog LAMP (Linux, Apache, MySQL/MariaDB, PHP) pawg teeb tsa ntawm nws. Txawm tias koj tuaj yeem siv XAMPP los tuav MySQL database hauv zos ntawm koj lub Windows PC.

Hauv cov lus qhia no, Kuv yuav tsis siv ib qho sensor. Kuv yuav cia li nce ob qhov sib txawv thiab ntxig lawv rau hauv lub database. Txawm li cas los xij, koj tuaj yeem txuas ib qho sensor nrog koj lub rooj tsavxwm.

Yuav tsum muaj:-

  1. NodeMCU ESP8266 pawg thawj coj loj
  2. Dawb version ntawm 000webhost tus account (lossis MySQL teeb tsa ntawm localhost)
  3. Filezilla FTP tus thov kev pab (dawb version)

Kauj Ruam 1: Tsim Web Application

  • Nkag mus rau 000webhost.com thiab nkag mus rau koj tus lej nyiaj.
  • Nrhiav Tsim Qhov Chaw Tshiab khawm nyob rau sab xis saum toj ntawm lub qhov rais.
  • Nkag mus rau qhov chaw xav tau lub npe thiab tus lej nkag mus thiab tom qab ntawd nyem lub khawm tsim. (Nco tseg qhov chaw tus lej zais hauv qhov chaw nyab xeeb vim tias peb yuav siv nws hauv cov theem tom ntej).
  • Txuas mus rau Kev Tswj Xyuas Lub Vev Xaib xaiv.

Kauj ruam 2: Tsim MySQL Database

Tsim MySQL Database
Tsim MySQL Database

Nkag mus rau Cov Cuab Yeej >> Tus Thawj Tswj Database thiab tom qab ntawd tsim cov ntaub ntawv tshiab.

Tom qab ua tiav tsim cov ntaub ntawv khaws cia, mus rau Kev Tswj >> PhpMyAdmin.

Kauj Ruam 3: Tsim MySQL Database Table

Tsim MySQL Database Table
Tsim MySQL Database Table
Tsim MySQL Database Table
Tsim MySQL Database Table
  • Nrhiav thiab nyem rau ntawm lub npe database hauv lub vaj huam sib luag sab laug ntawm PhpMyAdmin Window (raws li qhia hauv screenshot a).
  • Sau lub npe lub npe thiab naj npawb ntawm kab (cia nws yog 5). Tom qab ntawv ntaus lub pob Mus.
  • Tsim kab (raws li cov qauv qhia hauv qhov screenshot b) thiab tom qab ntawd nyem khawm txuag.

Xwb, koj tuaj yeem tsim cov lus los ntawm kev ua cov lus txib hauv qab no:-

CREATE TABLE `id13263538_sumodb`. `SIJ HAWM TSIS NULL, Thawj KEY (` id`)) ENGINE = InnoDB;

Kauj Ruam 4: Rub tawm thiab Kho Cov Ntaub Ntawv PHP

Rub tawm thiab Kho Cov Ntaub Ntawv PHP
Rub tawm thiab Kho Cov Ntaub Ntawv PHP
Rub tawm thiab Kho Cov Ntaub Ntawv PHP
Rub tawm thiab Kho Cov Ntaub Ntawv PHP
  • Rub tawm dbwrite.php thiab dbread.php cov ntaub ntawv los ntawm Github (lossis rub tawm cov ntawv txuas).
  • Hloov kho cov ntsiab lus khaws tseg thiab lub npe npe hauv dbwrite.php thiab dbread.php (raws li qhia hauv screenshot).

Kauj ruam 5: Upload PHP Cov Ntaub Ntawv rau Tus Neeg rau zaub mov

Upload PHP Cov Ntaub Ntawv rau Server
Upload PHP Cov Ntaub Ntawv rau Server
Upload PHP Cov Ntaub Ntawv rau Server
Upload PHP Cov Ntaub Ntawv rau Server
  • Mus rau Tswj Lub Vev Xaib >> Lub Vev Xaib Chaw >> Dav Dav.
  • Nco tseg lub npe hostname, lub npe siv, chaw nres nkoj thiab tus lej nkag (tus lej nkag tau zoo ib yam li lo lus zais chaw tsim hauv qib 1).
  • Siv cov ntsiab lus no txhawm rau txuas rau tus neeg siv khoom siv Filezilla FTP tus thov kev pab (raws li qhia hauv screenshot).
  • Nkag mus rau public_html nplaub tshev thiab xa cov ntaub ntawv dbwrite.php thiab dbread.php.

Kauj Ruam 6: Kho thiab Upload Arduino (.ino) Cov Ntaub Ntawv rau NodeMCU ESP8266

Kho thiab Upload Arduino (.ino) Cov Ntaub Ntawv rau NodeMCU ESP8266
Kho thiab Upload Arduino (.ino) Cov Ntaub Ntawv rau NodeMCU ESP8266
Kho thiab Upload Arduino (.ino) Cov Ntaub Ntawv rau NodeMCU ESP8266
Kho thiab Upload Arduino (.ino) Cov Ntaub Ntawv rau NodeMCU ESP8266
  • Nkag mus rau Tswj Lub Vev Xaib >> Lub Vev Xaib Chaw >> Dav Dav thiab sau cia Website_Name (chaw URL).
  • Kho kom raug.ino cov ntaub ntawv los hloov piv txwv.com nrog lub npe ntawm koj lub xaib. Tsis txhob hnov qab hloov kho WiFi SSID thiab tus password.
  • Thaum kawg, Tshaj tawm cov cai rau NodeMCU.

Kauj Ruam 7: Txheeb xyuas Kev Sib Txuas rau MySQL Database

Txheeb xyuas Kev Sib Txuas rau MySQL Database
Txheeb xyuas Kev Sib Txuas rau MySQL Database

Thaum cov cai tau xa mus rau NodeMCU, nws yuav pib xa cov ntaub ntawv mus rau MySQL database.

Mus ntsib "piv txwv.com/dbread.php" los saib cov txiaj ntsig database.

Vam tias koj pom cov ntawv qhia no muaj txiaj ntsig. Txaus siab rau!

Pom zoo: