Cov txheej txheem:

Sonoff Basic Wifi Extender - MQTT Qhuav Hu Sib Txuas - 5v DC Tsawg Voltage: 6 Kauj Ruam
Sonoff Basic Wifi Extender - MQTT Qhuav Hu Sib Txuas - 5v DC Tsawg Voltage: 6 Kauj Ruam

Video: Sonoff Basic Wifi Extender - MQTT Qhuav Hu Sib Txuas - 5v DC Tsawg Voltage: 6 Kauj Ruam

Video: Sonoff Basic Wifi Extender - MQTT Qhuav Hu Sib Txuas - 5v DC Tsawg Voltage: 6 Kauj Ruam
Video: Make your own Sonoff | DIY Sonoff | Sonoff wifi switch using ESP8266 and MQTT | IoT Projects 2024, Kaum ib hlis
Anonim
Sonoff Basic Wifi Extender - MQTT Qhuav Hu Sib Txuas - 5v DC Tsawg Voltage
Sonoff Basic Wifi Extender - MQTT Qhuav Hu Sib Txuas - 5v DC Tsawg Voltage

Ok Kuv muaj qee tus thawj tiam Sonoff cov cuab yeej siv yooj yim thiab kuv tsis xav siv lawv nrog 220v vim tias lawv tseem tsis tau nyab xeeb tiag hauv qhov kev tso tawm ntawd. Lawv tau pw ib puag ncig ib pliag tos ua ib yam dab tsi nrog lawv.

Yog li kuv dawm hla txoj haujlwm martin-ger ntawm GitHub (https://github.com/martin-ger/esp_wifi_repeater) thiab nyiag Sonoff.

Ua ntej kuv yoog Sonoff los ua haujlwm ntawm 5vDC thiab xiam oob khab qhov seem ntawm lub Circuit Court.

Khoom siv

Sonoff Basic R1

5v DC fais fab mov

Kauj Ruam 1: Sonoff ntawm 5v DC

Sonoff ntawm 5v DC
Sonoff ntawm 5v DC
Sonoff ntawm 5v DC
Sonoff ntawm 5v DC
Sonoff ntawm 5v DC
Sonoff ntawm 5v DC

Yog li qhov no yog qhov yooj yim zoo nkauj.

Koj yuav pom hauv thawj daim duab uas Sonoff siv AMS1117 tus tswj hwm los ntawm 5v txog 3.3v. Cov pins ntawm tus tswj hwm yog los ntawm sab laug mus rau sab xis: IN (GND), Tawm, IN (+). Los ntawm kev xaim cov xaim me me rau theIN (GND) thiab IN (+) koj tuaj yeem txuas koj li 5v DC lub zog siv hluav taws xob los ua lub zog ntawm pawg thawj coj saib. Raws li nws tuaj yeem tau txais me ntsis fiddly muaj kuv siv 2 lwm cov ntsiab lus sib txuas. Qhov khoob khoob khoob rau sab xis ntawm AMS117 (square pcb marker) yog GND. Tsuas yog rau sab laug muaj qhov txuas +. Ua tibzoo saib daim duab kaw.

Ok thaum qhov no ua tiav koj tuaj yeem sim ua ntej ua lwm yam kev hloov pauv.

Kauj ruam 2: Txhim Kho Firmware Tshiab

Txhim kho Firmware tshiab
Txhim kho Firmware tshiab
Txhim kho Firmware tshiab
Txhim kho Firmware tshiab

Ntawm Github https://github.com/martin-ger/esp_wifi_repeater hauv daim nplaub tshev firmware koj yuav pom cov.bin cov ntaub ntawv:

  • 0x000000 ib
  • 0x02000 ib

Koj yuav tsum rub tawm cov no.

Tom qab ntawd koj mus rau ESP Expressif lub vev xaib thiab rub tawm ESP cov cuab yeej rub tawm (PC nkaus xwb):

www.espressif.com/en/support/download/othe…

Pib nws thiab koj yuav xub tau txais lub qhov rai xaiv - xaiv DEVELOPER thiab tom qab ntawd ESP8266. Lub vijtsam yuav tsum zoo li lub screenshot saum toj no.

Tom qab ntawv nyem rau ntawm sab xis "…" txhawm rau xauj thiab xaiv 0x00000 cov ntaub ntawv ua ntej. Ntxiv qhov chaw nco hauv lub npov tom ntej no: 0x00000.

Ua tib yam rau cov ntawv thib ob thiab teeb tsa qhov chaw nco rau: 0x02000.

Thaum qhov ua tiav ua qhov koj nyiam USB-TTL thiab txuas Sonoff li (xyuas kom koj tsis muaj lwm lub zog txuas nrog rau Sonoff board). Kuj xyuas ob zaug USB-TTL tau teeb tsa rau 3.3v!

Nias lub pob ntawm Sonoff thaum tso lub USB-TTL hauv koj lub computer kom qhib hom nyem.

Xaiv qhov chaw nres nkoj COM hauv ESP cov cuab yeej rub tawm thiab teeb tsa qhov nrawm rau 1152000. Nyem Pib.

Nws yuav tsum tsuas yog siv 3 lossis 4 vib nas this. Qee lub sij hawm kuv lub rooj tsav xwm tsis mus rau hauv hom nyem kom raug-tsuas yog siv USB-TTL tawm, nias lub pob thiab rov ntxig.

OK - nrog qhov ua tiav peb muaj lub khoos phis tawj tshiab ntawm Sonoff ESP8266.

Txuas koj lub USB-TTL thiab txuas koj 5v DC lub zog los rau Sonoff.

Kauj ruam 3: Kho koj li Wifi

Peb yuav siv Telnet los teeb tsa lub cuab yeej. Kuv siv Putty.

Tom qab txuas lub zog rau Sonoff, koj yuav tsum pom lub Wifi SSID tshiab tshwm: MyAP.

Txuas rau nws nrog koj lub khoos phis tawj - thaum xub thawj tsis muaj tus password.

Thaum txuas nrog qhib Putty thiab teeb nws rau: 192.168.4.1 PORT 7777

Thaum qhov kev sib txuas ua tiav koj yuav pom: CMD>

Los ntawm kev siv cov lus txib yooj yim koj yuav tau teeb tsa lub cuab yeej Wifi. Bold yog cov lus txib - cov ntawv qaij tom qab nws yog koj qhov chaw. Thawj lo lus txib nrog kuv ib txwm muab qhov 'Invalid command' - yog li tsuas yog rov hais dua.

CMD> Cov

teeb ssid koj_home_router's_SSID

teeb tus password koj_home_router's_password

teeb ap_ssid the_ESP's_new_ssid

teeb tsa ap_password ESP's_password

qhia // (txhawm rau txheeb xyuas qhov ntsuas)

teeb tsa status_led 13 // (LED nyob ntawm GPIO 13 ntawm lub rooj tsavxwm)

txuag // (!!! tsis txhob hnov qab)

pib dua // (= reboot)

Ok tam sim no koj muaj lub hauv paus sub-network koj tuaj yeem siv txuas IoT cov cuab yeej sib cais los ntawm koj lub Wifi tseem ceeb.

Lossis koj tuaj yeem siv qhov no rau cov qhua, cov neeg zov menyuam, menyuam yaus nkag mus rau hauv internet nrog lub sijhawm, ….

Tom ntej no - Ntxiv MQTT, Qhuav hu sib cuag thiab ntxuav.

Kauj Ruam 4: Ntxuav, Txhim Kho Nrog MQTT thiab Kev Sib Txuas Qhuav

Kev tu, Txhim Kho Nrog MQTT thiab Kev Sib Txuas Qhuav
Kev tu, Txhim Kho Nrog MQTT thiab Kev Sib Txuas Qhuav
Kev tu, Txhim Kho Nrog MQTT thiab Kev Sib Txuas Qhuav
Kev tu, Txhim Kho Nrog MQTT thiab Kev Sib Txuas Qhuav

HLOOV

Ua ntej kuv tau ntxuav lub rooj tsavxwm thiab npaj nws rau tus cwj pwm sib txuas lus qhuav.

Qhov no txhais tau tias:

  1. txuas 5v DC rau lub dav hlau ntsuab
  2. txiav txoj kev qub ntawm PCB (txiav saum toj thiab hauv qab ntawm lub rooj tsavxwm) yog li lub davhlau ya nyob twg tau raug cais thiab txuas ncaj qha rau 2 cov ntsiab lus peb tau siv ua ntej ntawm lub pcb. Nyob rau sab saum toj koj tuaj yeem txiav nws qhov twg cov kab liab yog - koj yuav pom kuv txiav lawv me ntsis ntxiv thaum xub thawj. Kuv siv rab riam Stanley thiab tom qab ntawd rab riam ntse heev. Hloov chaw feem ntau yog cov ntsia hlau ncaj tiaj me me kuj tseem OK txhawm rau txhuam tooj liab ntawm PCB.
  3. txiav PCB nyob ze ntawm qhov txuas (kab laug sab) thiab teeb tsa tus choj raws li koj pom hauv daim duab. Yeej yog sab laug 2 kev sib txuas rau kev xa xov tseem tseem siv tau los ntawm 3.3v. Txoj cai 2 kev sib cuag tam sim no yuav tsim lub voj kaw nrog lub dav hlau ntsuab nyob rau sab saum toj ntawm pawg thawj coj saib. Yog li tsim kom muaj kev sib cuag qhuav qhuav.

MQTT

Thaum qhov no ua tiav Kuv txuas 5v DC lub hauv paus rau lub davhlau ya nyob twg ntsuab kom lub rooj tsavxwm muaj zog. Koj yuav tsum pom lub ntsuab LED ntsais thaum Wifi ua haujlwm.

Txog MQTT Kuv siv lub teeb liab teeb ntawm Raspberry Pi 3A+ nrog Aedes MQTT. Qhia rau kuv paub yog leej twg txaus siab nthuav qhov qhia no yuav ua li cas teeb tsa qhov no. Tab sis nws tseem yuav ua haujlwm nrog lwm tus MQTT broker.

Txuas nrog Putty rau Sonoff. Koj tuaj yeem siv sab hauv (192.168.4.1) lossis IP sab nraud (IP uas nws tau txais los ntawm koj li Wifi router).

CMD> Cov

teeb tsa mqtt_host IP_from_your_MQTT_server // (Kuv tau tso tseg qhov ua tsis tiav - MQTT yuav tsum nyob ntawm lub network loj tab sis - yog li ntawm koj lub Wifi tseem ceeb sab hauv lossis hauv internet pej xeem)

gpio 12 hom tawm // (relay yog ntawm GPIO 12)

cawm

pib dua

Nco ntsoov txuag thiab rov pib dua. MQTT teeb tsa tsuas yog hloov pauv thaum rov pib dua.

Thaum ua tiav qhov no koj tuaj yeem siv MQTT cov cuab yeej siv los tshuaj xyuas cov lus. Kuv siv MQTT Explorer.

Kauj Ruam 5: Xeem MQTT

Xeem MQTT
Xeem MQTT
Xeem MQTT
Xeem MQTT

Tom qab 15 vib nas this koj yuav tsum pom ESP thawb cov lus.

Txhawm rau sim qhov txuas ntxiv koj tshaj tawm cov lus:

ntsiab lus:/WiFi/ESPRouter_xxxxxx/hais kom ua // (xxxxxx yog koj lub cuab yeej HEX tus nqi)

lus: gpio 12 teeb tsa siab rau 4 // (teeb tsa gpio 12, txuas mus, kom siab li 4 vib nas this)

Koj yuav tsum hnov lub suab sib txuas thiab ESP yuav xa cov lus tawm tswv yim rau lub ncauj lus ("teb").

Txij tam sim no koj tuaj yeem siv telnet lossis MQTT los teeb tsa thiab hloov chaw. Ib qho lus txib uas siv tau tuaj yeem luam tawm los ntawm MQTT.

Qhov ntawd yog nws. Tam sim no koj yuav tsum muaj qhov hluav taws xob tsawg Sonoff, ntiag tug Wifi SSID, nrog MQTT thiab txuas ntxiv qhuav uas tuaj yeem tswj tau.

Cia kuv tam sim no hauv cov lus yog tias koj pom qhov no muaj txiaj ntsig, ib qho yuam kev kuv ua, yuam kev koj pom lossis txhim kho!

Ua tsaug.

Kauj Ruam 6: Kev txhim kho…?

Qhov ntau yog li-thiaj li.

Kuv muaj qee tus 2.4Ghz mini antenna los ntawm tus qub router.

Kuv yuav sim nruab qhov ntawd ntawm Sonoff thiab pom tias nws txhim kho qhov ntau me ntsis.

Nkag mus rau AP/ST - xauv nkag mus rau nplooj ntawv web

los ntawm lub neej ntawd lub vev xaib yog 'qhib'. Yog li qhov xwm txheej thaum txhua yam ua haujlwm tau zoo rau koj, qhib Putty thiab xa cov lus 'xauv' thiab khaws nws. Los ntawm lub neej ntawd nws yuav siv koj tus lej ST txhawm rau tiv thaiv lub vev xaib.

Pom zoo: