Cov txheej txheem:
- Kauj ruam 1: Txoj kev xav
- Kauj Ruam 2: Npaj Cov Tsev Qiv Ntawv Xav Tau
- Kauj Ruam 3: Sau Txoj Cai Thov Yooj Yim
- Kauj ruam 4: Uploading
- Kauj Ruam 5: Nyeem thiab Python
- Kauj Ruam 6: Ua tiav
Video: ESP8266 thiab Python Kev Sib Txuas Rau Noobs: 6 Kauj Ruam
2024 Tus sau: John Day | [email protected]. Kawg hloov kho: 2024-01-30 09:27
Phau ntawv qhia no tso cai rau koj kom tau txais cov ntaub ntawv los ntawm ESP8266 thiab tswj nws hla nab nab tsis muaj AT cov lus txib.
Rau cov pib, feem ntau ntawm cov lus qhia txog kev siv ESP8266 nyuaj, vim tias lawv xav kom koj nyem "AT COMMANDS" rau hauv nti, uas yog:
- Tsis tau
- Khib lub cim xeeb ntawm ESP
- Muab kev tswj hwm rau koj
- Nyuaj thiab nyuaj
- Thiab tsis haum rau txhua qhov ESP8266 cov qauv
Tias yog vim li cas kuv thiaj tsim tau ib qho yooj yim heev mDNS kev sib txuas lus uas tau raug tswj tsuas yog nrog 3 txoj haujlwm yooj yim. Nws kuj tseem ua rau koj muaj kev tswj hwm tag nrho.
Kauj ruam 1: Txoj kev xav
Peb tus esp txuas rau peb lub wifi thiab tsim lub server hauv zos thiab pib tos thov. Txhua lub sijhawm peb nab nab xa ntawv thov mus rau lub zos ntawd, esp sau cov cai uas xav tau thiab tom qab ntawd xa cov txiaj ntsig raws li kev thov http. Thaum kawg nab hab sej nyeem uas xa cov ntaub ntawv rov qab raws li http thov thiab rub qhov hloov pauv los ntawm nws. Nrog rau qhov no, esp tuaj yeem xa rov qab cov hlua, cov ntaub ntawv thiab kab ntawv. Python code yuav nkag siab lawv cov ntaub ntawv.
Kauj Ruam 2: Npaj Cov Tsev Qiv Ntawv Xav Tau
Ua ntej tshaj plaws, koj yuav tsum rub tawm ESP8266 daim ntawv qiv ntawv rau arduino lub tswv yim. Yog koj tsis paub yuav ua li cas, ntawm no yog phau ntawv qhia.
Tom qab ntawd, koj yuav tsum rub kuv lub tsev qiv ntawv me me ntawm no.
Tom qab koj rub tawm, hauv cov ntawv tais ceev tseg muaj cov ntaub ntawv hu ua "ESP_MICRO.h", luam nws rau koj phau ntawv teev npe ntawm qhov project arduino tam sim no. Yog, tsis txhob theej nws mus rau arduino lub tsev qiv ntawv, nws yog lub tsev qiv ntawv me me yog li koj yuav luam nws mus rau hauv daim nplaub tshev ntawm koj txoj haujlwm tam sim no arduino.
Yog li tam sim no, peb cov kev xav tau txaus siab. Peb tuaj yeem pib sau nws.
Kauj Ruam 3: Sau Txoj Cai Thov Yooj Yim
Thaum koj qhib koj qhov project.ino, koj yuav pom ob lub tab ntawm arduino lub tswv yim. Ib qho yog koj txoj haujlwm, lwm qhov yog "ESP_MICRO.h" peb lub tsev qiv ntawv micro.
Tam sim no koj muaj 5 txoj haujlwm hauv ESP_MICRO.h hauv koj tus lej tseem ceeb, (cov haujlwm tau piav qhia nyob rau thawj kab ntawm ESP_MICRO.h)
Nov yog qhov yooj yim sib txawv nce qib.
Arduino chaws:
/* F5 TEST RAU ESP2PY
* Sau los ntawm Junicchi * https://github.com/KebabLord/esp_to_python * Nws yooj yim nce thiab rov qab hloov pauv txhua lub sij hawm nab nab xav tau * * #suav nrog "ESP_MICRO.h" // suav nrog lub tsev qiv ntawv micro int testvariable = 0; teeb tsa tsis muaj dab tsi () {Serial.begin (9600); // Pib qhov chaw nres nkoj rau pom cov ntsiab lus pib ("USERNAME", "PASSWORD"); // EnAIt yuav txuas rau koj lub wifi nrog muab cov ntsiab lus} void loop () {waitUntilNewReq (); // Tos kom txog thaum thov tshiab los ntawm nab hab sej tuaj** nce qhov ntsuas thaum qhov kev thov tshiab tuaj*/testvariable += 1; returnThisInt (testvariable); // Rov qab cov ntaub ntawv rau sej}
Kauj ruam 4: Uploading
Programming Nodemcu ESP8266s tsuas yog ntsaws usb thiab xa cov duab kos los ntawm arduino.
Tab sis cov phiaj xwm ESP8266-1 nyuaj dua, muaj ob txoj hauv kev los ua haujlwm rau lawv
Programming ESP los ntawm arduino
Yog tias koj ua tau zoo nrog cov dhia, koj tuaj yeem program nws los ntawm arduino nrog rau hauv Circuit no. Tab sis ntev mus, nws mob. Yog li kuv qhia lwm txoj hauv kev.
Ua nws nrog ESP programmer
Nws yooj yim dua thiab sai dua. Nws tsuas yog 1 duas las, yuav ib qho thiab siv tus programmer usb.
Kawm tus IP chaw nyob ntawm ESP
Thaum txoj cai tau raug xa tawm, qhib qhov chaw nres nkoj, koj yuav pom cov ntsiab lus tau luam tawm thaum rub tawm tiav. Kawm tus IP ntawm esp thiab nco ntsoov qhov ntawd. Nco ntsoov, ESP's IP ntawm lub zos; hloov pauv los ntawm wifi rau wifi, tsis yog kev sib ntsib rau ntu, yog li thaum koj kaw thiab qhib nws tom qab, nws yuav tsis hloov pauv.
Kauj Ruam 5: Nyeem thiab Python
Hauv esp_to_python/tsev qiv ntawv muaj "EXAMPLE_PYTHON_READER.py"
kho nws, hloov kab thib 5 nrog IP chaw nyob ntawm tus qauv esp uas luam tawm ntawm cov ntawv txuas thiab khiav cov ntawv nab nab. Hauv txoj haujlwm no, kuv siv nab nab los xa thiab nyeem ntawv thov. Tab sis koj kuj tseem tuaj yeem saib cov ntaub ntawv nyoos nrog lub browser thaum hla tus ip ntawm ESP ntawm qhov browser. Lossis koj tuaj yeem ua daim ntawv thov nyeem nws, lossis koj tseem tuaj yeem siv lwm yam lus. Tswj cov qauv hla nab hab sej kuj tau piav qhia hauv "ledControl" qhov haujlwm hauv cov piv txwv.
Kauj Ruam 6: Ua tiav
Txhua lub luag haujlwm thiab cov lej tau piav qhia hauv ESP_MICRO.h thiab hauv README.md cov ntaub ntawv.
Yog tias txoj haujlwm no tau pab koj, koj tuaj yeem ua lub hnub qub thawj qhov haujlwm ntawm github.
Pom zoo:
Raspberry PI 3 - Pab Kev Sib Txuas Txuas rau TtyAMA0 rau BCM GPIO 14 thiab GPIO 15: 9 Cov Kauj Ruam
Raspberry PI 3 - Pab Txhawb Kev Sib Txuas rau TtyAMA0 rau BCM GPIO 14 thiab GPIO 15: Kuv nyuam qhuav muaj kev txaus siab los ua kom UART0 ntawm kuv Raspberry Pi (3b) yog li kuv tuaj yeem txuas nws ncaj qha rau RS -232 teeb liab qib ntaus ntawv siv tus qauv 9 -pin d-sub txuas tsis tas yuav hla USB mus rau RS-232 adapter. Ib feem ntawm kuv qhov kev xav
Arduino Neeg Hlau Nrog Kev Nyob, Kev Qhia thiab Qib Kev Sib Hloov (Sab Hnub Poob, Sab Hnub Poob, Sab Qaum Teb, Sab Qab Teb) Tswj los ntawm Lub Suab Siv Bluetooth Module thiab Kev Siv Tus Neeg Siv Hluav Taws Xob: 6 Kauj Ruam
Arduino Neeg Hlau Nrog Kev Nyob, Kev Qhia thiab Qib Kev Sib Hloov (Sab Hnub Poob, Sab Hnub Poob, Sab Qaum Teb, Sab Qab Teb) Tswj los ntawm Lub Suab Siv Bluetooth Module thiab Kev Siv Tus Neeg Siv Hluav Taws Xob: Cov lus qhia no piav qhia yuav ua li cas thiaj tsim tau Arduino Robot uas tuaj yeem txav mus raws qhov xav tau (Forward, Backward) , Sab laug, Txoj Cai, Sab Hnub Poob, Sab Hnub Poob, Sab Qaum Teb, Sab Qab Teb) xav tau Kev nrug deb hauv Centimeters siv lub suab hais kom ua. Neeg hlau kuj tseem tuaj yeem txav tau tus kheej
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