Cov txheej txheem:

Extension Sensors Nodemcu ESP8266 rau Weewx: 8 Kauj Ruam (nrog Duab)
Extension Sensors Nodemcu ESP8266 rau Weewx: 8 Kauj Ruam (nrog Duab)

Video: Extension Sensors Nodemcu ESP8266 rau Weewx: 8 Kauj Ruam (nrog Duab)

Video: Extension Sensors Nodemcu ESP8266 rau Weewx: 8 Kauj Ruam (nrog Duab)
Video: NodeMCU ESP8266 Expansion Base Board 2024, Kaum ib hlis
Anonim
Extension Sensors Nodemcu ESP8266 rau Weewx
Extension Sensors Nodemcu ESP8266 rau Weewx

Nov yog qhov qhia paub ntxiv Sensors rau lub chaw nres tsheb huab cua weewx.

Yog tias koj tsis tau weewx, koj tuaj yeem kawm qee yam hauv phau ntawv qhia no.

koj xav tau qee qhov kev paub pib ntawm Arduino code thiab yuav ua li cas rub tawm ntawm lub cuab yeej.

Koj pom cov ntaub ntawv weewx ntawm no:

Yam koj tsim yog 2 Devices:

1 Cov cuab yeej xa Kub thiab Vaum mus rau weewx software.

1 Cov cuab yeej xa Cov Kub Kub ntawm qhov sib txawv hauv av mus rau hauv weewx software.

Peb thawj lub cuab yeej yog BME 280 sensor.

Peb lub cuab yeej thib ob yog cov saw ntawm 3 DS18B20 Kub ntsuas qhov ntsuas. (Koj tuaj yeem ntxiv ntxiv yog tias koj nyiam).

Cia pib:

Kauj Ruam 1: Yam Koj Xav Tau…

Yam Koj Xav Tau …
Yam Koj Xav Tau …
Yam Koj Xav Tau …
Yam Koj Xav Tau …
Yam Koj Xav Tau …
Yam Koj Xav Tau …

Weewx nce thiab khiav + nkag mus rau weewx server. (piv txwv li raspberry PI 3).

2 Nodemcu ESP8266 cov qauv

3 lossis ntau dua DS18B20 Sensors

1 BME 280 combo Sensor

1 Aluminium yeeb nkab lossis zoo ib yam nrog txoj kab uas hla ntawm 10mm thiab 1mm phab ntsa tuab thiab ca. 1 Meter ntev

1 Cov ntaub ntawv tsis muaj dej nrog lub caj pas txuas thiab xauv txiv ntoo.

1 5V Lub Hwj Huam Lub Hwj Huam (piv txwv li thauj khoom txawb).

Qee cov xov hlau thiab cov khoom siv txuas.

Koj pom BME280 sensor thiab Nodemcu modules ntawm ebay.

Txog Aluminium yeeb nkab kuv xaiv lub khw muag khoom kho vajtse hauv ib cheeb tsam

Rau DS18B20 thiab cov ntaub ntawv tsis muaj dej kuv siv www.reichelt.de

www.reichelt.de/DS-18B20/3/index.html?ACTI…

www.reichelt.de/EL-FK-110/3/index.html?ACT…

thiab pab pawg ntawm cov kab txuas txuas nrog xauv txiv ntoo

www.reichelt.de/Kabelverschraubungen-Bopla…

Rau bme280 koj tuaj yeem xaiv siv cov ceg ntoo tuaj yeem ua tau

www.reichelt.de/Installationsmaterial/EL-D…

Kauj Ruam 2: Pib Nrog BME 280 Sensor Hardware Setup

Pib Nrog BME 280 Sensor Kho Vajtse Teeb
Pib Nrog BME 280 Sensor Kho Vajtse Teeb

Muab cov hlua khi tso rau hauv BME280.

Tom qab ntawv txuas lub BME rau Nodemcu:

BME VIN to 3.3V

BME to GND

SC4 to LWD

SDA to CSY

Yog tias koj nyiam koj tuaj yeem tso Cov Khoom Siv hauv lub tsev, tab sis nco ntsoov, tias qee qhov nyob hauv tsev, yog li cov av noo thiab qhov ntsuas kub raug.

Kauj Ruam 3: BME 280 Nodemcu ESP8266 Code

BME 280 Nodemcu ESP8266 Code
BME 280 Nodemcu ESP8266 Code
BME 280 Nodemcu ESP8266 Code
BME 280 Nodemcu ESP8266 Code
BME 280 Nodemcu ESP8266 Code
BME 280 Nodemcu ESP8266 Code

Txog cov cai koj tuaj yeem siv kuv qhov chaw khaws cia github:

github.com/Landixus/BME280_TO_SERVER_WEEWX

Cov ntaub ntawv ino xav tau qee qhov ntxig los ntawm koj:

IP Chaw Nyob ntawm koj tus neeg rau zaub mov weewx lossis URL

thiab txoj hauv kev uas koj muaj cov ntaub ntawv php, xyuas kom thaj tsam sau tau.

kuv xaiv cov public_html dir vim nws yog tus neeg rau zaub mov hauv tsev.

Yog tias koj xav clone lub git repositories, thiab muaj git teeb tsa ntawm koj lub server, koj tuaj yeem clone nrog cov lus txib:

"git clone" https://github.com/Landixus/BME280_TO_SERVER_WEEWX"

Tam sim no peb yuav tsum tau ua qee yam ntawm peb cov weewx server.

Koj yuav tsum ua txoj hauv kev rau koj qhov chaw!

nyob rau hauv

/tsev/weewx/public_html

tsim cov ntaub ntawv tais ceev tseg

hauv cov ntaub ntawv tais ceev tseg tsim bme.txt piv txwv nrog:

nco bme.txt

cov ntaub ntawv yuav tsum khoob.

ua kom nws sau nrog:

chmod -R 777 bme.txt

(koj yeej tsis ua qhov no ntawm tus neeg rau zaub mov uas siv internet tau!)

hauv daim nplaub tshev

/tsev/weewx/public_html

koj muab bme.php ntawm kuv github repo.

Qhov ua kom yuam kev yog INO cov ntaub ntawv xa qhov tseem ceeb rau bme.php thiab bme.php sau cov ntaub ntawv hauv bme.txt

Tom ntej no peb yuav tsum tau ntxiv cov kev pabcuam hauv weewx

muab bme.py tso rau hauv daim nplaub tshev

/home/weewx/bin/neeg siv

qhib koj lub weewx.conf hauv daim nplaub tshev

/home/weewx

nws ib txwm zoo kom muaj thaub qab ua ntej kho cov ntawv no!

nqes mus rau Kab Cav thiab ua kab zoo li kuv li:

[Cav]

# Ntu no qhia meej txog cov kev pabcuam uas yuav tsum tau ua. Lawv yog

# grouped los ntawm hom, thiab kev txiav txim ntawm cov kev pabcuam hauv txhua pab pawg

# txiav txim siab qhov kev txiav txim uas cov kev pabcuam yuav ua haujlwm.

data_services = user.pond. PondService, user.bme.bme

rov pib dua weewx nrog:

sudo /etc/init.d/weewx nres

sudo /etc/init.d/weewx pib

nrog cov lus txib

tw -f/var/log/syslog

koj tuaj yeem saib hauv logfile rau qhov ua yuam kev lossis ua tiav, saib rau qhov tso tawm bme: pom tus nqi ntawm …

Muab koj cov server rau qee feeb los tsim, hauv "kuv" weewx.conf txhua 5 feeb los rau qhov tso tawm.

Yog tias koj muaj lus yuam kev txheeb xyuas koj txoj hauv kev.

Yog tias koj muaj txiaj ntsig, koj tuaj yeem mus qhia nws ntawm lub vev xaib:

qhib skin.conf hauv

/tsev/weewx/tawv/Standard

mus rau:

# Qhov no yog qhov tshwj xeeb rau kuv qhov chaw nres tsheb! Ntxiv

extraTemp3 = BME1 Kub ExtraHumid1 = BME1 Vaum

txuag cov ntawv thiab qhib hauv tib lub nplaub tshev

index.html.tmpl

nrhiav kab:

#if $ day.extraTemp..

#ib if

tom qab thawj #end yog tias koj pom, tso koj li BME Sensor nrog:

^^ thov txim tab sis tsis tuaj yeem sau qhov no ua cov ntawv:(txuag cov ntaub ntawv thiab tawm mus.

tsis tas yuav rov pib dua weewx.

Tam sim no koj yuav tsum tau noj NODEMCU ESP8266 nrog cov ntaub ntawv Arduino.

Tsis txhob hnov qab teeb tsa koj li wifi thiab chaw nyob hauv cov ntawv.

Tom qab thauj khoom txheeb xyuas cov ntawv tso tawm kom pom qhov tsis raug.

Tom qab lub sijhawm luv luv koj yuav tsum pom qhov txiaj ntsig ntawm koj lub vev xaib weewx.

Kauj Ruam 4: Ua tiav BME280 Sensor Device + Troubleshooting

Ua tiav BME280 Sensor Ntaus Ntawv + Troubleshooting
Ua tiav BME280 Sensor Ntaus Ntawv + Troubleshooting
Ua tiav BME280 Sensor Ntaus Ntawv + Troubleshooting
Ua tiav BME280 Sensor Ntaus Ntawv + Troubleshooting

Qee cov lus qhia rau koj:

Qhib ntau dua 1 consoles ntawm putty

ntawm 1 console ua rau koj hloov pauv, thiab ntawm lwm lub console nyeem koj syslog nyob nrog:

tw -f/var/log/syslog

Yog tias koj muaj qhov ua yuam kev, saib mus rau koj lub logfile ua ntej.

Koj cov zis yuav tsum zoo ib yam li kuv li:

Kauj ruam 5: Soilsensor Kho Vajtse Teeb

Soilsensor Kho Vajtse Teeb
Soilsensor Kho Vajtse Teeb
Soilsensor Kho Vajtse Teeb
Soilsensor Kho Vajtse Teeb
Soilsensor Kho Vajtse Teeb
Soilsensor Kho Vajtse Teeb

Txog DS18B20 Sensor peb yuav tsum ua kom lub npav npav nrog qee cov xov hlau thiab cov laug siv.

Txheeb xyuas koj li DS18B20

DATA, GND, VCC

Ntawm VCC thiab DATA koj xav tau 4.7K Resistor. Nws txaus yog tias koj muaj tus tiv thaiv ntawm thawj DS18B20

Lwm qhov DS18B20 yog qhov sib thooj rau ib leeg.

Ntsuas qhov ntev rau koj qhov xav tau. Solder cov saw ua ke, kuv tau ruaj ntseg cov pins nrog cov raj nqaim.

Txog qhov TEST koj txuas DATA rau D3 thiab VCC rau VCC (3.3V) thiab GND rau GND.

Rau qhov kev xaiv pw tsaug zog tob tob koj yuav tsum txuas tus choj ntawm RST thiab D0 (GPIO16)

Koj yuav tsum tsis txhob muab cov saw hlau tso rau hauv Aluminium tube tam sim no, ua koj qhov kev sim ua ntej!

Kauj Ruam 6: DS18B20 Nodemcu ESP8266 Code

DS18B20 Nodemcu ESP8266 Code
DS18B20 Nodemcu ESP8266 Code

Txog tus lej koj tuaj yeem siv kuv GITHUB chaw cia khoom:

github.com/Landixus/multipleDS18B20WeeWX

Tsis tas li cov ntaub ntawv ino xav tau qee qhov kev nkag los ntawm koj: IP Chaw nyob ntawm koj tus neeg rau zaub mov weewx lossis URL thiab txoj hauv kev uas koj tau tso cov ntawv php, xyuas kom thaj tsam tuaj yeem sau tau kuv xaiv cov public_html dir vim tias nws yog lub server hauv tsev.

Yog tias koj xav clone qhov chaw cia khoom git thiab tau teeb tsa git ntawm koj lub server koj tuaj yeem clone nrog cov lus txib git clone

Tam sim no peb yuav tsum ua qee yam khoom uas txhua yam tau ua haujlwm ntawm peb cov weewx server.

Koj yuav tsum ua txoj hauv kev rau koj qhov chaw nyob hauv

/tsev/weewx/public_html

tsim cov ntawv "cov ntaub ntawv" hauv cov ntawv tais ceev tseg tsim ds18b20.txt piv txwv nano ds18b20.txt cov txt yuav tsum yog emtpy. ua kom nws sau tau nrog chmod -R 777 ds18b20.txt (koj tsis tau ua qhov no ntawm tus neeg rau zaub mov uas siv internet tau!) hauv daim nplaub tshev/tsev/weewx/public_html koj tso hauv av.php ntawm kuv github rep. Qhov ua kom yuam kev yog INO cov ntaub ntawv xa qhov tseem ceeb rau hauv av.php thiab hauv av.php sau cov ntaub ntawv hauv ds18b20.txt tom ntej no peb xav tau ntxiv cov kev pabcuam hauv weewx muab ds18b20.py hauv nplaub tshev/tsev/weewx/bin/ tus neeg siv

qhib koj lub weewx.conf hauv nplaub tshev /tsev /weewx

nws ib txwm zoo kom muaj thaub qab ua ntej kho cov ntawv no!

mus rau kab:

[Cav]

# grouped los ntawm hom, thiab kev txiav txim ntawm cov kev pabcuam hauv txhua pab pawg

# txiav txim siab qhov kev txiav txim uas cov kev pabcuam yuav ua haujlwm.

prep_services = weewx.engine. StdTimeSynch, data_services = user.pond. PondService, user.bme.bme, user.ds18b20.ds18b20 ntxiv cov kab hauv qab tom qab tus lej

"user.ds18b20.ds18b20" yuav tsum zoo li kab ntawv sab saud ^^

rov pib dua weewx nrog:

sudo /etc/init.d/weewx nres

sudo /etc/init.d/weewx pib

nrog cov lus txib tw -f/var/log/syslog koj tuaj yeem saib hauv logfile rau qhov ua yuam kev lossis ua tiav saib rau qhov tso tawm ds18b20: pom tus nqi ntawm Muab koj lub server qee feeb los tsim, hauv kuv weewx.conf txhua 5 feeb los muab. Yog tias koj muaj lus yuam kev txheeb xyuas koj txoj hauv kev. Yog tias koj muaj qhov tshwj xeeb koj tuaj yeem mus qhia nws ntawm nplooj ntawv: qhib

skin.conf hauv/tsev/weewx/tawv/Txheem mus rau:

# Nov yog qhov tshwj xeeb rau kuv qhov chaw nres tsheb!

ntxiv

avTemp1 = DS18B201

avTemp2 = DS18B202

avTemp3 = DS18B203

tseg cov ntaub ntawv thiab qhib hauv tib daim nplaub tshev index.html.tmpl nrhiav kab:

#if $ day.extraTemp ……

#ib if

tom qab thawj #end yog tias koj pom tso koj GroundSensor Sensor nrog:

^^ thov txim tab sis tsis tuaj yeem sau qhov no ua cov ntawv: (khaws cov ntawv thiab tawm.

Tsis txhob hnov qab teeb tsa koj li wifi thiab chaw nyob hauv cov ntawv. Tom qab thauj khoom txheeb xyuas cov ntawv tso tawm kom pom qhov tsis raug.

Tom qab lub sijhawm luv luv koj yuav tsum pom qhov txiaj ntsig ntawm koj lub vev xaib weewx.

Kauj Ruam 7: Ua tiav Soilsensor thiab teeb meem

Kev So Soensensor Zoo thiab Teeb Meem
Kev So Soensensor Zoo thiab Teeb Meem

Yog tias koj txhua tus ua haujlwm thiab pom qhov muaj txiaj ntsig, tom qab ntawd tawm mus sab nrauv thiab muab Aluminium yeeb nkab tso rau hauv av.

Ib txoj hauv kev zoo yog muab cov kua nplaum kub tso rau hauv 1 sab ntawm cov yeeb nkab thiab tom qab ntawd nias lub raj ua ke, tom qab ntawd koj muaj lub ntsej muag zoo kom coj tau yooj yim hauv av.

Muab koj cov yeeb nkab tso rau hauv av ua ntej, koj tuaj yeem hammer nrog cov ntoo ntoo.

Yog tias cov yeeb nkab sib sib zog txaus koj tuaj yeem tso koj lub ds18b20 saw nyob rau hauv thiab cov xov hluav taws xob nyob hauv lub thawv tsis muaj dej.

Nco ntsoov tias koj lub wifi ua haujlwm ntawm qhov chaw no!

Yog tias koj tsis paub dab tsi sensor tob npaum li cas, muaj 2 txoj hauv kev.

Kuv sim theem tso 1 ds18b20 ntawm koj tus ntiv tes, qhov kub nce mus rau qhov no.

Thaum cov yeeb nkab twb tau ua hauv av lawm, feem ntau yog tus nqi siab tshaj qhov tob tshaj plaws.

Kauj ruam 8: Ua tiav

Tiav
Tiav

Xwb kawg

Tshaj tawm koj cov lus nug thiab qhia koj lub sijhawm hauv av hauv cov lus!

Yog xav paub ntau ntxiv koom nrog weewx google Pawg ntawm:

groups.google.com/forum/#!forum/weewx-user

Pom zoo: