Cov txheej txheem:

ESP Ib Yam: 6 Kauj Ruam
ESP Ib Yam: 6 Kauj Ruam

Video: ESP Ib Yam: 6 Kauj Ruam

Video: ESP Ib Yam: 6 Kauj Ruam
Video: Nraug txuj kev hlub 2024, Hlis ntuj nqeg
Anonim
ESP Ib yam dab tsi
ESP Ib yam dab tsi
ESP Ib yam dab tsi
ESP Ib yam dab tsi
ESP Ib yam dab tsi
ESP Ib yam dab tsi
ESP Ib yam dab tsi
ESP Ib yam dab tsi

Kuv lub hom phiaj ntawm no yog qhia kuv kev paub nrog ESP8266 los ntawm ESP-01, ESP-12 thiab NodeMCU cov qauv.

Kuv mam piav qhia:

1. Yuav ua li cas txuas ESP-01 rau koj lub khoos phis tawj

2. Rov qab qhib AT firmware

3. Siv Arduino IDE los teeb tsa lub nti

4. Node MCU kev paub dhau los

5. DeepSleep lossis txhawb koj lub zog nrog roj teeb

6. Ntshiab ESP12 - Txuas nws rau koj lub khoos phis tawj thiab npaj rau cov phiaj xwm kos

Kauj Ruam 1: ESP -01 - Kev Sib Txuas Lus

ESP -01 - Kev Sib Txuas Lus
ESP -01 - Kev Sib Txuas Lus
ESP -01 - Kev Sib Txuas Lus
ESP -01 - Kev Sib Txuas Lus
ESP -01 - Kev Sib Txuas Lus
ESP -01 - Kev Sib Txuas Lus

Koj xav tau:

  1. ESP-01 module ntawm chav kawm
  2. Serial-USB adapter
  3. Tus tswj hwm 3.3V, Kuv siv LE33CZ (max 100mA), nws ua haujlwm tab sis kuv pom zoo ua qauv nrog 1A Max.

Ua raws li schematic.

Nco tseg: CH_PD xav tau txuas nrog +VCC, raws li nws tau hais hauv daim ntawv ntawm ESP8266.

Sib tham nrog ESP:

Feem ntau thaum koj yuav cov khoom xws li:

  • AT firmware twb nyob hauv lub cim xeeb lawm
  • lub neej ntawd ceev ceev yog 115200 bps

Hauv kev xav, koj tuaj yeem siv ib qho software Sib Txuas Lus. Tsuas yog saib xyuas ntxiv Kab Tshiab & Carriage Rov Qab tom qab txhua lo lus txib.

Kuv sim siv PutTTY xa AT cov lus txib tab sis tsis muaj kev vam meej, vim yog cov Kab Tshiab & Carriage Return cov cim. Kuv tsis pom txoj hauv kev ua nws

Yog li kuv tau siv lub ntsuas saib ntawm ARDUINO, saib xyuas teeb tsa "Ob NL & CR" lwm qhov nws yuav tsis ua haujlwm

Thaum koj npaj txhij:

  • Sim ntaus: AT
  • ESP yuav tsum teb: OK

Tam sim no koj nyob hauv. Xa mus rau Espressif cov ntaub ntawv rau AT cov lus txib.

Nrog AT cov lus txib koj tuaj yeem txuas rau WiFi thiab tsim HTTP server. Tab sis koj tsis tuaj yeem hais kom GPIO.

Kauj Ruam 2: ESP -01 - Rov qab qhib AT Firmware

Nyob rau hauv rooj plaub thaum koj tau txais cov qauv tsis muaj software sab hauv (tab sis ib txwm nws yog), Kuv piav qhia ntawm no yuav ua li cas rov qab nws nrog cov cuab yeej siv ntau lub platform.

Koj tuaj yeem hla cov kauj ruam no yog tias yav dhau los ua tau zoo rau koj.

Thawj yam koj yuav tsum paub:

  • Txhawm rau nkag mus rau hauv hom haujlwm koj yuav tsum tso GPIO0 ntawm 0V thiab ua RESET thaum GPIO0 tseem nyob ntawm 0V.
  • Tom qab ntawd tus qauv npaj kom thauj khoom firmware hauv lub cim xeeb nyem

Mus rau Espressif.com txhawm rau rub tawm SDK:

Hauv daim nplaub tshev bin/at, README cov ntaub ntawv yuav qhia koj tias cov ntaub ntawv twg yuav tsum ntsaws rau hauv lub cim xeeb thiab pib chaw nyob

Piv txwv:

# NON-BOOT MODE ## rub tawm

eagle.flash.bin 0x00000

eagle.irom0text.bin 0x10000

blank.bin

Flash loj 8Mbit: 0x7e000 & 0xfe000

Flash loj 16Mbit: 0x7e000 & 0x1fe000

Flash loj 16Mbit-C1: 0xfe000 & 0x1fe000

Flash loj 32Mbit: 0x7e000 & 0x3fe000

Flash loj 32Mbit-C1: 0xfe000 & 0x3fe000

esp_init_data_default.bin (yeem)

Flash loj 8Mbit: 0xfc000

Flash loj 16Mbit: 0x1fc000

Flash loj 16Mbit-C1: 0x1fc000

Flash loj 32Mbit: 0x3fc000

Flash loj 32Mbit-C1: 0x3fc000

Nco tseg: Koj yuav tsum paub qhov loj & hom cim xeeb uas koj muaj hauv koj tus qauv. Qhov ntawd yog lub ntsiab lus peb yuav daws nrog ob peb feeb…

Siv esptool.py txhawm rau rub lub firmware:

  • Espressif pom zoo kom siv lawv tus kheej software, tab sis nws nyob ntawm Windows
  • Yog li https://github.com/espressif/esptool yog lwm txoj hauv kev zoo
  1. nab hab sej esptool.py --port/dev/ttyUSB0 --baud 115200 sau_flash 0x00000./at/noboot/eagle.flash.bin
  2. nab hab sej esptool.py --port/dev/ttyUSB0 --baud 115200 sau_flash 0x10000./at/noboot/eagle.irom0text.bin
  3. nab hab sej esptool.py --port/dev/ttyUSB0 --baud 115200 sau_flash 0x7e000./bin/blank.bin
  4. nab hab sej esptool.py --port/dev/ttyUSB0 --baud 115200 sau_flash 0xfc000./bin/esp_init_data_default.bin

Lus ceeb toom tseem ceeb:

Koj tsis tuaj yeem ua cov no yog tias koj tsis paub tias koj muaj lub cim xeeb zoo li cas hauv koj tus qauv.

Kuv muab tswv yim rau koj:

nab hab sej esptool.py --port /dev /ttyUSB0 --baud 115200 flash_id

Tom qab ntawv txheeb xyuas qhov combo ntawm

chaw tsim khoom c8 yog GigaDevice thiab ntaus ntawv 4013 yog GD25Q40, uas yog 4Mbit = 512KByte ntaus ntawv

chaw tsim khoom ef yog Winbond (ex Nexcom) thiab ntaus ntawv 4016 yog W25Q32, uas yog 32Mbit = 4MByte ntaus ntawv

Kauj Ruam 3: Siv ARDUINO IDE

Siv ARDUINO IDE
Siv ARDUINO IDE

Hauv qhov kev nyiam, ntxiv qhov URL no rau "Tus Thawj Saib Xyuas Ntxiv URLs":

arduino.esp8266.com/stable/package_esp8266c…

Rov pib dua ARDUINO tom qab ntawd. Tom qab ntawd hauv "TOOL-> BOARD" koj yuav tuaj yeem xaiv Cov Qauv ESP8266 Cov Qauv.

Hauv Cov Ntaub Ntawv-> Piv txwv koj yuav pom cov piv txwv ntawm kev kos duab los pab pib ua haujlwm nrog ARDUINO.

Sau ntawv:

  • Thaum koj rub tawm koj qhov program tsis txhob hnov qab nkag mus rau hauv hom kev ua haujlwm (GPIO0 = 0V thiab RESET).
  • Thaum koj tau rub tawm qhov program arduino ntawm ESP, AT firmware tsis muaj ntxiv lawm, yog li AT cov lus txib tsis ua.
  • Siv qhov kev xaiv: kos duab + teeb tsa wifi

Kauj Ruam 4: Node MCU

NUJ MCU
NUJ MCU

Yog tias koj yuav cov qauv no, nws yooj yim heev:

  • ESP-12 sab hauv
  • Koj muaj lub nyem + pib dua khawm kom nkag tau yooj yim hauv hom phiaj
  • Pins
  • Ib qho chaw sib txuas USB…

Tab sis yog tias koj xav muab nws tso rau hauv ib qhov haujlwm, nws yuav tsis yog qhov zoo tshaj plaws. Peb yuav pom qhov "ntshiab" ESP12 thaum kawg ntawm cov lus qhia no.

Kauj Ruam 5: DeepSleep lossis Hwjchim Koj Cov Qauv Nrog Roj Teeb

Nws yog qhov txias kom muaj WiFi tab sis nws siv lub zog. Yog tias koj tso tus qauv ON tsis paub tseeb tias koj tuaj yeem teeb nws tau ntev rau hauv cov phiaj xwm roj teeb.

Hmoov zoo ESP tuaj yeem nkag mus rau hauv hom pw tsaug zog. Tom qab ntawd nws siv ob peb lub micro-amps.

Nws tuaj yeem ua qhov ntawd nrog AT cov lus txib.

Tab sis kuv yuav qhia nws los ntawm arduino programming.

Ua ntej, xaim WakeUpPin = GPIO16 mus rau RESET ntawm ESP. Vim tias thaum ESP nkag mus rau hauv hom pw tsaug zog, nws sawv los ntawm rov pib dua nws tus kheej los ntawm GPIO16 tus pin.

Txhawm rau nkag mus rau hauv DeepSleep hom, siv tus lej: ESP.deepSleep (, WAKE_RF_DEFAULT);

yog hauv micro-vib nas this. ESP yuav tsaug zog thaum uS ua ntej rov pib dua.

Kauj Ruam 6: Ntshiab ESP12 - Txuas Nws Rau Koj Lub Khoos Phis Tawj thiab Npaj Rau Kev Ua Haujlwm Ntxiv

Ntshiab ESP12 - Txuas Nws Rau Koj Lub Khoos Phis Tawj thiab Npaj Rau Kev Ua Haujlwm Ntxiv
Ntshiab ESP12 - Txuas Nws Rau Koj Lub Khoos Phis Tawj thiab Npaj Rau Kev Ua Haujlwm Ntxiv
Ntshiab ESP12 - Txuas Nws Rau Koj Lub Khoos Phis Tawj thiab Npaj Rau Kev Ua Haujlwm Ntxiv
Ntshiab ESP12 - Txuas Nws Rau Koj Lub Khoos Phis Tawj thiab Npaj Rau Kev Ua Haujlwm Ntxiv

Tsis txhob ntshai yuav tus ESP12 tus qauv dawb. Nws yog pheej yig, lub teeb thiab me me.

Txuas nws tib yam li ESP-01 module, nrog Serial-USB adapter.

Tsis txhob hnov qab tias CH_PD yuav tsum yog ntawm Vcc.

Tom qab ntawd koj tuaj yeem tsim cov phiaj xwm teeb tsa, ntawm roj teeb, nrog WiFi thiab lub zog tswj hwm lub zog loj !!

Pom zoo: