Cov txheej txheem:

ESP32 / 8266 WiFi Lub Zog Muaj Zog: 14 Cov Kauj Ruam
ESP32 / 8266 WiFi Lub Zog Muaj Zog: 14 Cov Kauj Ruam

Video: ESP32 / 8266 WiFi Lub Zog Muaj Zog: 14 Cov Kauj Ruam

Video: ESP32 / 8266 WiFi Lub Zog Muaj Zog: 14 Cov Kauj Ruam
Video: Чем отличается ESP 8266 (12) от ESP 32 2024, Hlis ntuj nqeg
Anonim
Image
Image
ESP32 / 8266 WiFi Lub Zog Muaj Zog
ESP32 / 8266 WiFi Lub Zog Muaj Zog
ESP32 / 8266 WiFi Lub Zog Muaj Zog
ESP32 / 8266 WiFi Lub Zog Muaj Zog
ESP32 / 8266 WiFi Lub Zog Muaj Zog
ESP32 / 8266 WiFi Lub Zog Muaj Zog

Koj puas paub txog WiFi teeb liab lub zog los ntawm ESP? Koj puas tau xav txog kev tau txais ESP01, uas muaj lub kav hlau txais xov me, thiab muab tso rau hauv lub qhov (socket)? Nws puas yuav ua haujlwm? Txhawm rau teb cov lus nug no, Kuv tau ua ntau qhov kev sim sib piv ntau hom microcontrollers, suav nrog ESP32 nrog ESP8266. Peb tshuaj xyuas qhov ua tau zoo ntawm cov cuab yeej no ntawm ob qhov kev ncua deb: 1 thiab 15 meters, ob qho tib si nrog phab ntsa nyob nruab nrab.

Txhua yam no tsuas yog ua kom txaus siab rau kuv tus kheej xav paub. Qhov tshwm sim yog dab tsi? Nov yog qhov tseem ceeb rau ESP02 thiab ESP32. Kuv yuav qhia koj txhua yam hauv cov vis dis aus hauv qab no. Xyuas nws tawm:

Ntxiv nrog rau cov txiaj ntsig thaum muab piv rau ESP chips, Kuv yuav qhia koj hnub no txog yuav ua li cas txhawm rau txhim kho ESP chips sib txawv li Access Points (txhua qhov ntawm cov channel sib txawv), yuav txheeb xyuas lub teeb liab lub zog ntawm txhua tus los ntawm daim ntawv thov ntawm lub xov tooj, thiab thaum kawg, peb yuav los tshuaj xyuas dav dav txog lub teeb liab lub zog ntawm cov tes hauj lwm pom.

Ntawm no, peb muab tus pinning ntawm txhua tus microcontrollers peb tshuaj xyuas:

Kauj ruam 1: WiFi Analyzer

WiFi Analyzer
WiFi Analyzer
WiFi Analyzer
WiFi Analyzer
WiFi Analyzer
WiFi Analyzer

WiFi Analyzer yog daim ntawv thov uas pom WiFi network muaj nyob ib puag ncig peb. Nws kuj tseem qhia lub teeb liab lub zog hauv dBm, thiab cov channel rau txhua lub network. Peb yuav siv nws los ua peb qhov kev tshuaj xyuas, uas muaj peev xwm ua tau los ntawm kev pom kev hauv cov qauv: cov npe lossis kab kos.

PHOTO APP --- Lub app tuaj yeem rub tawm los ntawm Google Play Store los ntawm qhov txuas:

play.google.com/store/apps/details?id=com.farproc.wifi.analyzer&hl=en

Kauj Ruam 2: Tab sis Kuv Yuav Ua Haujlwm Li Cas ESP Chips Uas Tsis Muaj USB input?

Txhawm rau sau koj cov cai ntawm ESP01, saib cov vis dis aus no "RECORDING ON ESP01" thiab pom txhua cov kauj ruam tsim nyog. Cov txheej txheem no yog qhov piv txwv muaj txiaj ntsig, vim nws zoo ib yam li txhua lwm hom microcontrollers.

Kauj Ruam 3: ESP02, ESP201, ESP12

ESP02, ESP201, ESP12
ESP02, ESP201, ESP12
ESP02, ESP201, ESP12
ESP02, ESP201, ESP12
ESP02, ESP201, ESP12
ESP02, ESP201, ESP12
ESP02, ESP201, ESP12
ESP02, ESP201, ESP12

Ib yam li hauv ESP01, koj yuav xav tau FTDI adapter los sau, zoo li ib qho saum toj no. Cov hauv qab no yog qhov txuas xav tau rau txhua qhov ESPs no.

TSEEM CEEB: Tom qab kaw qhov program hauv ESP, nco ntsoov tshem GPIO_0 los ntawm GND.

Kauj ruam 4: Cov tsev qiv ntawv

Tsev qiv ntawv
Tsev qiv ntawv

Yog tias koj xaiv siv ESP8266, ntxiv cov ntawv hauv qab no "ESP8266WiFi".

Cias nkag mus rau "Sketch >> suav nrog Tsev Qiv Ntawv >> Tswj Tsev Qiv Ntawv …"

Cov txheej txheem no tsis tsim nyog rau ESP32, txij li cov qauv no twb los nrog nws lub tsev qiv ntawv teeb tsa.

Kauj ruam 5: Code

Peb yuav siv tib txoj cai hauv txhua daim ESP chips. Tsuas yog qhov sib txawv ntawm lawv yuav yog lub npe ntawm qhov nkag mus thiab cov channel.

Nco ntsoov tias ESP32 siv lub tsev qiv ntawv uas txawv ntawm qhov seem: "WiFi.h". Lwm cov qauv siv "ESP8266WiFi.h".

* ESP32 WiFi.h lub tsev qiv ntawv tuaj nrog pob khoom teeb tsa pawg thawj coj hauv Arduino IDE.

// descomentar a biblioteca de acordo com seu chip ESP //#suav nrog // ESP8266

//#suav nrog // ESP32

Kauj Ruam 6: Pib Pib

Ntawm no, peb muaj cov ntaub ntawv uas yuav hloov pauv los ntawm ib qho ESP mus rau lwm qhov, ssid, uas yog lub npe ntawm peb lub network, tus password network thiab, thaum kawg, cov channel, uas yog cov channel uas lub network yuav ua haujlwm.

/ *Lub npe tsis tau rov qab los senha */const char *ssid = "nomdeDaRede"; const char *password = "senha"; const int channel = 4; / * Endereços para configuração da rede */ IPAddress ip (192, 168, 0, 2); IPAddress rooj vag (192, 168, 0, 1); IPAddress subnet (255, 255, 255, 0);

Kauj ruam 7: Teeb tsa

Hauv kev teeb tsa, peb yuav pib peb qhov chaw nkag thiab teeb tsa qhov chaw.

Muaj cov ntsiab lus rau tus tsim uas peb tuaj yeem txheeb xyuas CHANNEL uas lub network tsim yuav ua haujlwm.

WiFi.softAP (ssid, password, channel);

void teeb () {ncua (1000); Serial.begin (115200); Serial.println (); Serial.print ("Kho qhov chaw nkag …"); /* Você pode remover o parâmetro "password", se quiser que sua rede seja aberta. * / /* Wifi.softAP (ssid, password, channel); */ WiFi.softAP (ssid, password, channel); / * configurações da rede */ WiFi.softAPConfig (ip, rooj vag, subnet); IPAddress myIP = WiFi.softAPIP (); Serial.print ("AP IP chaw nyob:"); Serial.println (myIP); } void voj () {}

Kauj Ruam 8: Kev sim

1. Tag nrho cov chips tau txuas nrog ib txhij, ib sab.

2. Kev sim tau ua tiav hauv ib puag ncig ua haujlwm, nrog rau lwm lub network muaj, yog li peb yuav pom lwm cov cim tom ntej ntawm peb.

3. Txhua tus nti nyob ntawm ib txoj kev sib txawv.

4. Siv daim ntawv thov, peb tshuaj xyuas lub teeb uas tsim tawm raws li qhov sib zog ntawm lub teeb liab, ob qho tib si nyob ze ntawm daim tawv nqaij thiab nyob deb dua ib puag ncig nrog cov phab ntsa hauv txoj kev.

Kauj Ruam 9: Txheeb Xyuas Cov Cim

Txheeb Xyuas Cov Cim
Txheeb Xyuas Cov Cim

Nyob ze rau cov chips - 1 meter

Ntawm no peb qhia thawj cov ntawv ntawm daim ntawv thov. Hauv qhov kev xeem no, qhov ua tau zoo tshaj plaws yog los ntawm ESP02 thiab ESP32.

Kauj Ruam 10: Txheeb Xyuas Cov Cim

Txheeb Xyuas Cov Cim
Txheeb Xyuas Cov Cim

Nyob deb ntawm cov chips - 15 meters

Hauv theem ob no, qhov tseem ceeb dua yog ESP02, uas muaj lub kav hlau txais xov sab nraud ntawm nws tus kheej.

Kauj Ruam 11: Bar Duab - 1 Meter Away

Bar Duab - 1 Meter Away
Bar Duab - 1 Meter Away

Txhawm rau pab kom pom kev, peb teeb tsa kab ntawv no uas qhia cov hauv qab no: qhov me me bar, muaj zog dua lub teeb liab. Yog li ntawm no dua, peb muaj ESP02 kev ua tau zoo tshaj plaws, ua raws ESP32 thiab ESP01.

Kauj Ruam 12: Bar Graph - 15 Meters Away

Bar Graph - 15 Meters Away
Bar Graph - 15 Meters Away

Hauv daim ntawv no peb rov qab mus rau qhov ua tau zoo tshaj plaws ntawm ESP02, ua raws los ntawm ESP32 nyob deb dua.

Kauj ruam 13: Raws

Raws
Raws

Tam sim no, hauv daim duab no, Kuv yuav qhia koj li cas txhua lub nti ua haujlwm ntawm lwm txoj hauv kev.

Kauj Ruam 14: Cov lus xaus

- ESP02 thiab ESP32 sawv tawm thaum peb tshuaj xyuas

teeb liab, ob qho tib si thaum nyob ze thiab thaum nyob deb dua.

- ESP01 muaj zog npaum li ESP32 thaum peb saib ze, tab sis thaum peb txav deb ntawm nws, nws poob ntau lub teeb liab.

Lwm cov chips kawg poob ntau lub zog thaum peb rub mus.

Pom zoo: