Cov txheej txheem:

Noog Feeder Monitor V2.0: 12 Cov Kauj Ruam (nrog Duab)
Noog Feeder Monitor V2.0: 12 Cov Kauj Ruam (nrog Duab)

Video: Noog Feeder Monitor V2.0: 12 Cov Kauj Ruam (nrog Duab)

Video: Noog Feeder Monitor V2.0: 12 Cov Kauj Ruam (nrog Duab)
Video: Another coyote gone off this cattle farm. #coyote #predator #fun #conservation 2024, Hlis ntuj nqeg
Anonim
Image
Image
Noog Feeder Saib V2.0
Noog Feeder Saib V2.0

Nov yog txoj haujlwm los tshuaj xyuas, thaij duab thiab sau tus naj npawb thiab sijhawm siv los ntawm cov noog tuaj xyuas peb cov noog noj. Ntau Raspberry Pi's (RPi) tau siv rau txoj haujlwm no. Ib qho tau siv ua lub peev xwm kov lub ntsej muag, Adafruit CAP1188, txhawm rau txheeb xyuas, kaw thiab ua rau cov duab ntawm cov noog noj. Lwm RPi tau teeb tsa los tswj kev ua haujlwm ntawm qhov kev tshuaj xyuas no, nrog rau khaws thiab khaws cov ntaub ntawv rau kev tshuaj xyuas thiab tshuaj xyuas. Qhov RPi kawg tau teeb tsa ua Lub Koob Yees Duab kom thaij duab txhua tus noog mus ntsib tus pub mis.

Khoom siv

  1. 1 ea - Raspberry Pi W.
  2. 1 ea - Raspberry Pi 3 - Qauv B+ - rau MQTT Server
  3. 1 ea - Raspberry Pi nrog Lub Koob Yees Duab - Yeem tau
  4. 2 ea - Cov xwm txheej tsis muaj huab cua rau RPi thiab CAP1188 Sensor
  5. 1 ea - Copper Foil Xev nrog Cov Ntawv Cuam Tshuam
  6. Hlau - 18-22 AWG
  7. Soldering Iron thiab Solder
  8. Soldering Flux rau Electronics
  9. Silicone Khaub Ncaws*
  10. 8 ea - M3 x 25 Tshuab Ntsia Hlau*
  11. 8 ea - M3 Ceev*
  12. 1 ea - Proto Board rau kev teeb tsa CAP1188
  13. 1 ea - 1x8 Poj Niam Dupont Connector
  14. 1 ea - 1x6 Txiv neej Dupont Connector
  15. 1 ea - CAP1188 - 8 -Key Capacitive Touch Sensor
  16. 2 ea - PG7 Waterproof IP68 Nylon Cable Gland Joint Adjustable Locknut rau 3mm -6.5mm Dia Cable Hlau
  17. 1 teeb - 2 Txoj Kev Pin Tsheb Tsheb Hluav Taws Xob Hluav Taws Xob Hluav Taws Xob Txuas nrog Hlau AWG Tub Rog Pob ntawm 10
  18. 3 ea - 5VDC Cov Khoom Siv Hluav Taws Xob - ib qho rau txhua RPi
  19. 1 ea - Bird Feeder (CedarWorks Yas Hopper Bird Feeder), lossis ib qho noog Feeder nrog yas lossis ntoo ntoo

*rau 3D Luam Cov Ntaub Ntawv Huab Cua

Kauj ruam 1: Txheej txheem cej luam ntawm Noog Feeder Monitoring System

Txheej txheem cej luam ntawm Bird Feeder Monitoring System
Txheej txheem cej luam ntawm Bird Feeder Monitoring System

Nov yog qhov kev tshuaj xyuas tsim los suav, sijhawm, kaw thiab thaij duab noog noj ntawm peb tus noog noj. Cov ntawv dhau los ntawm kuv Tus Noog Feeder Saib tau siv Arduino Yun, thiab khaws cov ntaub ntawv hauv daim ntawv nthuav tawm ntawm kuv Google Drive. Cov ntawv no siv ntau yam Raspberry Pi's, MQTT kev sib txuas lus thiab khaws cia hauv zos cov ntaub ntawv thiab duab.

Tus Noog Feeder tau nruab nrog Raspberry Pi Zero W thiab Capacitive Touch Sensor (CAP1188). Txhua tus noog teeb pom kev zoo ntawm lub perches qhib lub kov sensor uas pib lub sijhawm los txiav txim siab lub sijhawm ntawm txhua qhov xwm txheej kawg. Sai li qhov kov tau qhib, "saib/pub/duab" MQTT cov lus tau tshaj tawm los ntawm Bird Feeder Monitor. Cov lus no ceeb toom rau Raspberry Pi Lub Koob Yees Duab kom thaij duab. Yog tias MQTT Server tshaj tawm "saib/pub khoom noj/tau txais cov lus", Noog Feeder Monitor yuav teb nrog "saib/pub/suav" MQTT cov lus uas tus neeg rau zaub mov yuav khaws.

MQTT Server ua ntau txoj haujlwm. Nws thov thiab khaws cov ntaub ntawv los ntawm Bird Feeder Monitor, thiab nws tswj kev ua haujlwm ntawm tus saib. Nws qhib lub monitor ntawm Kaj ntug thiab kaw nws thaum tsaus ntuj. Nws tseem tswj hwm lub sijhawm luv rau thov cov ntaub ntawv, thiab nws tseem saib xyuas cov huab cua tam sim no ntawm DarkSky. Cov xwm txheej huab cua raug saib xyuas rau ob peb yam. Ua ntej tshaj plaws, cov dej nag yuav cuam tshuam rau cov ntsuas. Yog tias qhov no tshwm sim, cov ntsuas tau rov ntsuas dua ib txwm ua thaum nag los. Qhov laj thawj thib ob, yog los saib xyuas thiab sau cov huab cua rau kev sib raug zoo nrog cov noog suav cov ntaub ntawv.

Lub koob yees duab Raspberry Pi yog RPi + Raspberry Pi Lub koob yees duab module. Lub koob yees duab software siv rau txoj haujlwm no tsis ua haujlwm nrog USB Webcam. Lub RPi Lub Koob Yees Duab tau nruab nrog WIFI thiab ua haujlwm MQTT Client software. Nws tso npe rau "saib xyuas/pub khoom noj/duab" MQTT cov lus, thiab thaij duab txhua lub sijhawm tau txais cov lus no. Cov duab tau khaws cia ntawm RPi Lub Koob Yees Duab, thiab tswj tau nyob deb.

Kauj Ruam 2: Txhim Kho Raspbian ntawm Bird Feeder Monitor

Txhim kho Raspbian ntawm Bird Feeder Monitor
Txhim kho Raspbian ntawm Bird Feeder Monitor

Txhim kho qhov tseeb version ntawm Raspbian Lite ntawm Raspberry Pi Zero W. Kuv pom zoo ua raws cov lus qhia ib qib zuj zus uas tuaj yeem pom ntawm Adafruit's Raspberry Pi Zero Headless Quick Start.

Cov theem hauv qab no suav nrog cov lus qhia saum toj no, tab sis tsim nyog rov hais dua:

Txuas rau RPi ntawm ssh thiab khiav cov lus txib hauv qab no:

sudo apt-tau hloov tshiabudo apt-tau hloov tshiab

Cov lus txib saum toj no yuav siv sijhawm me ntsis los ua kom tiav, tab sis kev ua cov lus txib no yuav ua pov thawj tias koj tau hloov kho tshiab nrog cov pob tshiab kawg.

Tom ntej no, khiav cov lus txib hauv qab no los teeb tsa RPi Software:

sudo raspi-teeb tsa

Hloov koj tus password, pab kom SPI thiab I2C, thiab Nthuav Tawm Cov Ntaub Ntawv. Thaum cov no ua tiav, tom qab ntawd tawm raspi-teeb tsa.

Kauj Ruam 3: Txuas RPi thiab CAP1188

Kev thaiv ntawm RPi thiab CAP1188
Kev thaiv ntawm RPi thiab CAP1188

Raspberry Pi W (RPi) thiab CAP1188 txuas nrog I2C. Muaj lwm lub peev xwm kov lub ntsej muag muaj nrog ib qho, tsib lossis yim lub cim. Kuv xaiv yim vim kuv tus noog noj muaj rau sab.

Thaiv:

  • CAP1188 SDA == RPi Pin 3
  • CAP1188 SCK == RPi Pin 5
  • CAP1188 VIN == RPi Pin 1 (+3.3VDC)
  • CAP1188 GND == RPi Pin 9 (GND)
  • CAP1188 C1-C8 == Txuas mus rau xov hlau ntawm txhua lub perch ntawm 1x8 Poj Niam Dupont Connector
  • CAP1188 3Vo == CAP1188 AD - Hardwire I2C Chaw Nyob rau 0x28
  • RPi Pin 2 == +5VDC
  • RPi Pin 14 == GND

Lub zog rau RPi tau muab sab nraud, los ntawm kev xaim hluav taws xob hauv av los ntawm kuv lub nkas -las, thiab nce los ntawm cov yeeb nkab siv los ua tus noog pub zaub rau sawv ntsug. Ib tus 2-Pin Weatherproof Connector tau txuas rau qhov kawg ntawm xaim txhawm rau txuas RPi Bird Feeder Monitor. Lwm qhov kawg ntawm cov xaim tau txuas nrog lub fuse 5-VDC fais fab mov hauv chav nres tsheb. Txoj haujlwm no yuav tsum ua haujlwm nrog roj teeb, tab sis kuv tsis xav kom hloov pauv cov roj teeb ib txwm ua.

Kuv tsim lub 16 cable ntev los txuas Lub Thawv Tiv Thaiv Huab Cua uas muaj RPi mus rau Lub Thawv Tiv Thaiv Huab Cua uas muaj CAP1188.

RPi Zero thiab CAP1188 tuaj yeem tau ntim rau hauv ib lub thawv tsis muaj huab cua, tab sis kuv nyiam ntim lawv cais.

Kauj Ruam 4: Kho Kho Tus Noog Feeder Monitor

Kho lub Noog Feeder Monitor
Kho lub Noog Feeder Monitor
Kho lub Noog Feeder Monitor
Kho lub Noog Feeder Monitor

Nkag mus rau hauv Raspberry Pi Zero W thiab ua cov theem hauv qab no.

Nruab pip:

sudo apt-tau nruab python3-pip

Nruab Adafruit CircuitPython:

sudo pip3 nruab -hloov kho setuptools

Txheeb xyuas I2C thiab SPI cov cuab yeej:

ls /dev /i2c* /dev /spi*

Koj yuav tsum pom cov lus teb hauv qab no:

/dev/i2c-1 /dev/spidev0.0 /dev/spidev0.1

Tom ntej teeb tsa GPIO thiab Adafruit blinka pob:

pip3 nruab RPI. GPIOpip3 nruab adafruit-blinka

Nruab Adafruit's CAP1188 module:

pip3 nruab adafruit-circuitpython-cap1188

Nruab I2C cov cuab yeej:

sudo apt-tau nruab python-smbussudo apt-tau nruab i2c-cuab yeej

Txheeb xyuas I2C chaw nyob nrog cov cuab yeej saum toj no:

i2cdetect -y 1

Yog CAP1188 txuas nrog, koj yuav pom cov lus teb zoo ib yam li pom hauv daim duab saum toj no, uas qhia tias lub ntsuas cua nyob ntawm I2C chaw nyob 0x28 (lossis 0x29 nyob ntawm koj xaiv I2C chaw nyob).

Txhim kho mosquitto, mosquitto-cov neeg siv khoom thiab paho-mqtt:

sudo apt-tau nruab mosquitto mosquitto-cov neeg siv sej-mosquitto

sudo pip3 nruab paho-mqtt

Kuv pom zoo siv Adafruit's Configuring MQTT ntawm Raspberry Pi los teeb tsa thiab teeb tsa MQTT ntawm RPi no.

Txhim kho Bird Feeder Monitor software:

cd ~ ib

sudo apt-tau nruab git git clone "https://github.com/sbkirby/RPi_bird_feeder_monitor.git"

Tsim cov ntawv teev npe:

cd ~ ib

mkdir cav

Hlau CAP1188 sensor mus rau RPi thiab ua cov hauv qab no los ntsuas qhov system tom qab MQTT server ua haujlwm:

cd RPi_bird_feeder_monitor

sudo nano teeb tsa.json

Hloov qhov tseem ceeb rau "OIP_HOST", "MQTT_USER", "MQTT_PW" thiab "MQTT_PORT" kom haum koj cov teeb tsa hauv zos. Tawm thiab txuag koj cov kev hloov pauv.

Khiav ntawm Startup

Thaum tseem nyob hauv/tsev/pi/RPi_bird_feeder_monitor directory.

nano launcher.sh

Suav nrog cov ntawv hauv qab no hauv launcher.sh

#!/bin/sh

# launcher.sh # mus rau phau ntawv teev npe hauv tsev, tom qab ntawd mus rau cov npe no, tom qab ntawv sau sej tsab ntawv, tom qab ntawd rov qab mus tsev cd /cd tsev /pi /RPi_bird_feeder_monitor sudo python3 feeder_mqtt_client.py cd /

Tawm thiab txuag lub launcher.sh

Peb yuav tsum ua kom tsab ntawv ua tiav.

chmod 755 launcher.sh

Xeem tsab ntawv.

sh launcher.sh

Tom ntej no, peb yuav tsum hloov kho crontab (tus thawj tswj haujlwm ua haujlwm linux) kom qhib tsab ntawv thaum pib. Nco tseg: peb twb tau tsim cov npe /cav yav dhau los.

sudo crontab -e

Qhov no yuav coj lub qhov rai crontab zoo li pom saum toj no. Nkag mus rau qhov kawg ntawm cov ntawv thiab nkag mus rau kab hauv qab no.

@reboot sh /home/pi/RPi_bird_feeder_monitor/launcher.sh>/tsev/pi/cav/cronlog 2> & 1

Tawm thiab khaws cov ntaub ntawv, thiab rov pib dua RPi. Tsab ntawv yuav tsum pib feeder_mqtt_client.py tsab ntawv tom qab RPi reboots. Cov xwm txheej ntawm tsab ntawv tuaj yeem tshawb xyuas hauv cov ntaub ntawv cav nyob hauv /cav cav.

Kauj Ruam 5: 3D Luam Qhov Chaw

3D Luam Tshooj
3D Luam Tshooj
3D Luam Tshooj
3D Luam Tshooj
3D Luam Tshooj
3D Luam Tshooj

Cov ntaub ntawv STL no yog rau ntu 3D Luam Kuv tau tsim rau txoj haujlwm no, thiab txhua ntu no yog nyob ntawm yeem. Cov xwm txheej tsis muaj huab cua tuaj yeem tsim lossis yuav hauv ib cheeb tsam. Qhov "Mounting Wedge" rau CedarWorks Bird Feeder kuj tseem xaiv tau. Qhov no yog qhov tsim nyog los teeb tsa CAP1188 cov ntaub ntawv ntsuas.

Kauj Ruam 6: Noog Feeder Monitor Assembly

Bird Feeder Monitor Assembly
Bird Feeder Monitor Assembly

Tom qab txhim kho Raspbian, teeb tsa thiab ntsuas RPi thiab CAP1188 Sensor raws li tau hais yav tas los, tam sim no nws yog lub sijhawm los teeb tsa cov cuab yeej no hauv lawv cov xwm txheej huab cua.

Kuv siv ob qhov xwm txheej huab cua uas kuv tau luam tawm los txhawm rau txhawm rau RPi thiab CAP1188 Sensor. Ua ntej tshaj plaws, Kuv tau hlais 1/2 qhov ntawm ib kawg ntawm txhua rooj plaub. Laum lub qhov ntawm RPi rooj plaub sab nraud nrog SD Card. Mount Nylon Cable Gland Joint nrog Adjustable Locknut hauv txhua qhov. Khiav plaub Txhim kho thiab txuas lub 2 Pin Tsheb Waterproof Hluav Taws Xob Hluav Taws Xob Txuas Hluav Taws Xob rau RPi raws li qhia hauv daim duab saum toj no.. Saib daim kab xev rau lwm qhov kev sib txuas uas siv hauv RPi.

Khiav lwm qhov kawg ntawm plaub tus neeg xyuas hlau xaim hla Gland Joint ntawm CAP1188 rooj plaub, thiab txuas cov xov hlau raws li qhia hauv kab duab kab. Txhua 8 ntawm CAP1188 lub peev xwm kov lub ntsej muag tau muab muag rau 8 Tus Poj Niam Dupont txuas. Qhov txuas txuas no tau muab tso rau hauv ib sab ntawm rooj plaub kom tso cai rau kaw dej nruj thaum siv rau sab saum toj. Nco tseg: Sab saum toj ntawm ob rooj plaub no tej zaum yuav xav tau kev hloov kho kom tso cai rau cov txiv ntoo ntawm Gland Cov Txuas Txuas.

Ua ntej kaw, Kuv siv cov kua nplaum silicone rau ntawm txhua qhov ntawm rooj plaub, thiab nyob ib ncig ntawm cov xov hlau ntawm Gland Cov Kab Sib Txuas los kaw qhov rooj plaub. Kuv kuj ntxiv silicone rau sab nraum qab ntawm Dupont txuas kom muab nws los ntawm cov ntsiab lus.

Kauj Ruam 7: Txuas lub Bird Feeder

Txuas Tus Noog Feeder
Txuas Tus Noog Feeder
Txuas Tus Noog Feeder
Txuas Tus Noog Feeder
Txuas Tus Noog Feeder
Txuas Tus Noog Feeder

Txhua qhov txuas ntawm tus pub mis tau npog nrog 1/4 dav tus kheej nplaum tooj liab ntawv ci daim kab xev. Lub qhov me tau raug drilled los ntawm daim kab xev thiab perch, thiab xaim tau xau rau daim kab xev kab xev thiab hla hauv qab tus pub mis. cov xov hlau txuas nrog tus txiv neej 6-pin Dupont txuas.

Nco tseg: Nrog tus noog pub rau pom saum toj no, Kuv pom zoo qhov sib txawv nruab nrab ntawm qhov kawg ntawm txhua daim ntawv ci ntawm 1 1/4 " - 1 1/2". Kuv pom tias cov noog loj dua, xws li cov nyom thiab nquab, muaj peev xwm kov tau ob daim ntawv ci tib lub sijhawm yog tias lawv muab tso rau ze ua ke.

"Mounting Wedge" uas tau hais yav dhau los tau luam tawm thiab lo rau hauv qab ntawm tus neeg pub khoom noj kom muab thaj tsam ib qib los txhawm rau Lub Thawv Tiv Thaiv Huab Cua uas muaj CAP1188. Velcro daim kab xev tau thov rau Lub Thawv nrog rau cov ntoo thaiv kom muab txoj hauv kev txuas. Qhov no tuaj yeem pom hauv daim duab saum toj no ntawm kev sib dhos ua tiav. Lub pluaj velcro tau siv los qhwv ib puag ncig cov yeeb nkab thiab RPi lub thawv kom ruaj ntseg rau lawv hauv qab tus pub mis.

Tus noog noj tau rov ua dua nrog lub ntsuas cua thiab RPi txuas rau tus pub, thiab thaum nws tseem nyob ntawm cov yeeb nkab sawv ntsug. Luckily, Kuv yog 6'2 siab thiab ncav cuag lub thawv yam tsis siv zog ntau.

Kauj Ruam 8: MQTT Server

MQTT neeg rau zaub mov
MQTT neeg rau zaub mov
MQTT neeg rau zaub mov
MQTT neeg rau zaub mov
MQTT neeg rau zaub mov
MQTT neeg rau zaub mov

Yog tias koj twb tau ua dab tsi hauv ntiaj teb IOT, koj yuav twb muaj MQTT Server nce thiab khiav ntawm koj lub network. Yog tias koj tsis ua, Kuv pom zoo siv Raspberry Pi 3 rau MQTT Server, thiab cov lus qhia thiab IMG cov duab pom ntawm Andreas Spiess lub vev xaib "Node-Red, InfuxDB & Grafana Installation". Andreas tseem muaj cov vis dis aus qhia txog qhov no #255 Node-Red, InfluxDB, thiab Grafana Tutorial ntawm Raspberry Pi.

Thaum Node-Red Server tau ua haujlwm, koj tuaj yeem ntshuam Bird Feeder Monitor ntws los ntawm kev luam cov ntaub ntawv hauv ~/RPi_bird_feeder_monitor/json/Bird_Feeder_Monitor_Flow.json, thiab siv Ntshuam> Clipboard los muab cov ntawv los tso rau hauv qhov tshiab.

Qhov Flow no yuav xav tau cov hauv qab no:

  • node-red-node-darksky-DarkSky API account yuav tsum tau siv qhov no.
  • node-red-contrib-bigtimer-Timer loj los ntawm Scargill Tech
  • node-red-contrib-influxdb-InfluxDB Database

Cov ntaub ntawv huab cua rau koj qhov chaw nyob yog muab los ntawm DarkSky. Thiab tam sim no kuv tau saib xyuas thiab sau "nag lossis daus", "kub", "av noo", "cua hlob", "cua hlob", "cua hlob" thiab "cloudCover". "PrecipIntensity" yog qhov tseem ceeb vim tias nws tau siv los txiav txim siab yog tias cov ntsuas yuav tsum tau rov ntsuas dua vim yog los nag.

Lub Sijhawm Loj Loj yog cov tub rog swiss riam ntawm timers. Nws tau siv los Pib thiab Nres kaw cov ntaub ntawv ntawm Kaj ntug thiab tsaus ntuj txhua hnub.

InfluxDB yog lub teeb yuag yooj yim siv sijhawm teev cov ntaub ntawv. Cov ntaub ntawv khaws cia tau ntxiv lub sijhawm cim txhua lub sijhawm peb tso cov ntaub ntawv. Tsis zoo li SQLite, cov teb tsis tas yuav tau txhais. Lawv tau ntxiv ncaj qha thaum cov ntaub ntawv tso rau hauv lub database.

Node-Liab Configuration

JSON cov ntaub ntawv hais los saum no yuav thauj Flow uas xav tau ob peb tweaks kom haum rau koj cov kev xav tau.

  1. Txuas "MQTT Publish" thiab "monitor/feeder/#" rau koj li MQTT Server.
  2. Teeb Nruab Nrab thiab Ntev mus rau koj qhov chaw nyob hauv "Dawn & Dusk Timer (teeb tsa)" Timer loj.
  3. Kho qhov "saib/pub/astronomy (teeb tsa)" ntawm. Lub koob yees duab tuaj yeem qhib/xiam rau txhua qhov chaw. Piv txwv li, ob qho ntawm kuv lub perches nyob sab nraub qaum, thiab lub koob yees duab tau xiam rau cov perches no.
  4. Teem lub "Counter Timer (teeb tsa)" ntawm lub sijhawm xav tau luv. Default = 5 feeb
  5. Teeb Nruab Nrab thiab Ntev mus rau koj qhov chaw nyob hauv "DarkSky (teeb tsa)" ntawm. Qhov thib ob, nkag mus rau koj qhov DarkSky API Key hauv qhov tsaus ntuj-pov thawj qhov chaw.
  6. Teem caij nag lossis daus hauv "saib/pub/rov ua dua tshiab (teeb tsa)" Ua haujlwm ntawm. Default = 0.001 nyob rau hauv/teev
  7. Kho kom raug "Cov ncauj lus lim rau MQTT Tus Neeg Txais Debug Node (teeb tsa)" Lub luag haujlwm ntawm kev lim MQTT cov lus tawm uas koj tsis xav pom.
  8. Tsis teb los tau: Yog tias koj xav khaws cov ntaub ntawv hauv Spreadsheet ntawm koj Google Drive, koj yuav tsum hloov kho "Tsim Google Docs Payload (teeb tsa)" Ua haujlwm ntawm node nrog Form Field ID's.
  9. Tsis teb los tau: Ntxiv koj daim ntawv tshwj xeeb URL rau URL teb ntawm "Google Docs GET (teeb tsa)" HTTP Thov rau.

Node-Red UI Desktop

Bird_Feeder_Monitor_Flow suav nrog Tus Neeg Siv Khoom Siv (UI) txhawm rau nkag mus rau MQTT Server ntawm lub xov tooj ntawm tes. Tus saib tuaj yeem tig tawm lossis ON, Rov ua dua lub ntsej muag lossis coj cov duab los ntawm tus kheej. Ib qho tag nrho ntawm lub ntsuas "kov" kuj tau qhia, uas yuav muab rau koj lub tswv yim ntxhib ntawm tus naj npawb ntawm cov noog mus ntsib tus pub mis.

Kauj ruam 9: Grafana

Grafana
Grafana
Grafana
Grafana

"Grafana yog qhov qhib qhov ntsuas ntsuas & pom kev pom. Nws yog qhov feem ntau siv rau kev pom lub sijhawm ua cov ntaub ntawv rau kev tsim vaj tsev thiab kev tshuaj xyuas daim ntawv thov tab sis ntau tus siv nws hauv lwm qhov suav nrog suav nrog cov cuab yeej ntsuas, kev siv tshuab hauv tsev, huab cua, thiab tswj cov txheej txheem." refn: Grafana Cov Ntaub Ntawv.

Cov software no suav nrog ntawm Andreas Spiess cov duab siv los tsim kuv li MQTT Server. Tom qab teeb tsa InfluxDB database ntawm MQTT Server, Grafana tuaj yeem teeb tsa los siv cov ntaub ntawv no raws li pom hauv daim duab saum toj no. Tom ntej no, lub dashboard siv los ntawm txoj haujlwm no tuaj yeem thauj khoom los ntawm JSON cov ntaub ntawv pom hauv ~/RPi_bird_feeder_monitor/json/Bird_Feeder_Monitor_Grafana.json. Cov lus qhia rau teeb tsa Grafana tuaj yeem nrhiav tau ntawm Andreas Spiess lub vev xaib "Node-Red, InfuxDB & Grafana Installation".

Kauj ruam 10: InfluxDB

InfluxDB
InfluxDB
InfluxDB
InfluxDB

Raws li tau hais ua ntej Adreas Spiess muaj cov lus qhia zoo thiab yees duab taug kev koj los ntawm kev teeb tsa ntawm InfluxDB. Nov yog cov kauj ruam kuv coj los teeb tsa kuv lub database.

Ua ntej tshaj plaws, Kuv nkag mus rau hauv kuv tus MQTT Server ntawm SSH thiab tsim USER:

hauv paus@MQTTPi: ~#

hauv paus@MQTTPi: ~# influx Txuas rau "https:// localhost: 8086" version 1.7.6 InfluxDB plhaub version: 1.7.6 Nkag mus rau InfluxQL nug> CREATE USER "pi" WITH PASSWORD 'raspberry' WITH ALL PRIVILEGES> SHOW USERS user admin ---- ----- pi tseeb

Tom ntej no, Kuv tsim lub database:

CREATE DATABASE BIRD_FEEDER_MONITOR>> Qhia DATABASES lub npe: databases name ---- _ sab hauv BIRD_FEEDER_MONITOR>

Tom qab koj tau tsim cov ntaub ntawv saud saum toj no, koj tuaj yeem teeb tsa InfluxDB node hauv Node-Red. Raws li pom hauv daim duab saum toj no, Kuv lub npe Measurement "feeders". Qhov no tuaj yeem pom hauv InfluxDB tom qab cov ntaub ntawv tau pib ua ntej:

Siv BIRD_FEEDER_MONITOR Siv database BIRD_FEEDER_MONITOR

> Qhia TUS MEASUREMENTS lub npe: ntsuas lub npe ---- pub pub>

Ib ntawm ntau qhov tshwj xeeb ntawm InfluxDB yog FIELDS teeb tsa tsis xav tau. FIELDS tau ntxiv thiab teeb tsa tau txais thaum cov ntaub ntawv nkag mus. Nov yog FIELDS thiab FIELDTYPE rau cov ntaub ntawv no:

SHOW FIELD KEYSname: feeders fieldKey fieldType -------- --------- cloudcover float count_1 float count_1 float count_2 float count_4 float count_5 float count_6 float count_6 float humidity float name string precip_Int float temp float time_1 float time_2 ntab sijhawm _3 ntab sij hawm _4 lub sij hawm ntab_5 ntab lub sij hawm_6 ntab winddir ntab windgust ntab windspeed ntab>

Ob peb nkag los ntawm cov ntaub ntawv tuaj yeem pom hauv qab no:

SELECT * FROM feeders LIMIT 10 lub npe: feeders lub sij hawm cloudcover count_1 count_2 count_3 count_4 count_5 count_6 humidity name precip_Int temp time_1 time_2 time_3 time_4 time_5 time_6 winddir windgust windspeed ---- --------------- ------- ----------------------- ------- ------- ----------------------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- --------------- --------- ---- ------ ------ ------ ------ ------ ------ - ------ -------- --------- 1550270591000000000 0 0 0 0 0 0 Feeder1 0 0 0 0 0 0 1550271814000000000 0 0 0 0 0 0 Feeder1 0 0 0 0 0 0 1550272230000000000 0 0 0 0 0 0 Feeder1 0 0 0 0 0 0 1550272530000000000 0 0 0 0 0 0 Feeder1 0 0 0 0 0 0 1550272830000000000 0 0 0 0 0 0 Feeder1 0 0 0 0 0 0 1550273130000000000 0 0 0 0 0 Feeder1 0 0 0 0 0 1550273430000000000 0 0 0 0 0 0 Feeder1 0 0 0 0 0 0 1550273730000000000 0 0 0 0 0 0 Feeder1 0 0 0 0 0 15 15272730000000000 0 0 0 0 0 0 Feeder1 0 0 0 0 0 0 1550274330000000000000 0 0 0 0 0 0 0 Feeder1 0 0 0 0 0 0 0>

Kauj Ruam 11: Raspberry Pi Lub Koob Yees Duab

Raspberry Pi Lub Koob Yees Duab
Raspberry Pi Lub Koob Yees Duab
Raspberry Pi Lub Koob Yees Duab
Raspberry Pi Lub Koob Yees Duab
Raspberry Pi Lub Koob Yees Duab
Raspberry Pi Lub Koob Yees Duab
Raspberry Pi Lub Koob Yees Duab
Raspberry Pi Lub Koob Yees Duab

Kuv pom zoo siv kuv Cov Lus Qhia, Chaw Taws Teeb CNC Nres thiab Saib Xyuas, kom sib sau Raspberry Pi Lub Koob Yees Duab. Ua txhua kauj ruam uas tau hais tseg tshwj tsis yog 6 & 8 los tsim lub koob yees duab. Thov ceeb toom kuv siv tus laus Raspberry Pi rau kuv Lub Koob Yees Duab, tab sis nws tau ua haujlwm zoo heev los ntawm kuv lub Khw qhov rai.

Txhim kho Rasbian:

sudo apt-tau hloov tshiabudo apt-tau hloov tshiab

Nruab PIP:

sudo apt-tau nruab python3-pip

Nruab paho-mqtt:

sudo pip3 nruab paho-mqtt

Nruab git thiab Noog Saib Xyuas Software:

cd ~ ib

sudo apt-tau nruab git git clone "https://github.com/sbkirby/RPi_bird_feeder_monitor.git"

Yog tias koj xav ua cov vis dis aus los ntawm cov duab thaij los ntawm lub koob yees duab, nruab ffmpeg:

git clone "https://git.ffmpeg.org/ffmpeg.git" ffmpeg

cd ffmpeg./configure ua sudo ua nruab

Kev teeb tsa kev tso cai ntawm Bird Feeder Monitoring software:

cd RPi_bird_feeder_monitor

sudo chmod 764 make_movie.sh sudo chmod 764 take_photo.sh sudo chown www-data: www-data make_movie.sh sudo chown www-data: www-data take_photo.sh

Tus kheej, Kuv tsis pom zoo siv lub make_movie.sh ntawm RPi Lub Koob Yees Duab. Nws xav tau rau ntau cov peev txheej los khiav ntawm RPi. Kuv pom zoo xa cov duab mus rau koj lub PC thiab khiav ffmpeg nyob ntawd.

Khiav ntawm Startup

Nkag mus rau hauv RPi thiab hloov mus rau /RPi_bird_feeder_monitor directory.

cd RPi_bird_feeder_monitor

nano launcher.sh

Suav nrog cov ntawv hauv qab no hauv launcher.sh

#!/bin/sh

# launcher.sh # mus rau phau ntawv teev npe hauv tsev, tom qab ntawd mus rau cov npe no, tom qab ntawd ua kab ntawv nab hab sej, tom qab ntawd rov qab mus tsev cd /cd tsev /pi /RPi_bird_feeder_monitor sudo python3 camera_mqtt_client.py cd /

Tawm thiab txuag lub launcher.sh

Peb yuav tsum ua tsab ntawv thiab ua tiav.

chmod 755 launcher.sh

Xeem tsab ntawv.

sh launcher.sh

Tsim ib phau ntawv teev npe:

cd ~ ib

mkdir cav

Tom ntej no, peb yuav tsum hloov kho crontab (tus thawj tswj haujlwm ua haujlwm linux) kom qhib tsab ntawv thaum pib.

sudo crontab -e

Qhov no yuav coj lub qhov rai crontab zoo li pom saum toj no. Nkag mus rau qhov kawg ntawm cov ntawv thiab nkag mus rau kab hauv qab no.

@reboot sh /home/pi/RPi_bird_feeder_monitor/launcher.sh>/tsev/pi/cav/cronlog 2> & 1

Tawm thiab khaws cov ntaub ntawv, thiab rov pib dua RPi. Tsab ntawv yuav tsum pib camera_mqtt_client.py tsab ntawv tom qab RPi rov pib dua. Cov xwm txheej ntawm tsab ntawv tuaj yeem tshawb xyuas hauv cov ntaub ntawv cav nyob hauv /cav cav.

Kauj ruam 12: Txaus siab rau

Txaus siab rau
Txaus siab rau

Peb nyiam saib noog, txawm li cas los xij peb tsis tuaj yeem tso tus pub rau hauv qhov chaw kom txaus siab tshaj plaws. Tib qhov chaw uas peb txhua tus tuaj yeem pom nws yog los ntawm lub rooj noj tshais, thiab tsis yog txhua tus tuaj yeem pom tus pub khoom noj los ntawm qhov ntawd. Yog li ntawd, nrog Bird Feeder Monitor peb tuaj yeem qhuas cov noog ntawm peb qhov yooj yim.

Ib yam uas peb pom nrog tus saib xyuas yog qhov ntau ntawm cov noog tsaws ntawm ib lub perch, ua raws los ntawm kev dhia mus rau lub perch tom ntej kom txog thaum lawv tau ncig ncig tag nrho cov pub. Raws li qhov tshwm sim, suav cov noog yog TXHUA TUS los ntawm cov naj npawb ntawm cov noog uas tuaj xyuas peb tus pub. Ib tus pub mis nrog tsuas yog ib lossis ob qhov nqaim nqaim yuav zoo tshaj rau "suav" noog.

Kev sib tw Sensors
Kev sib tw Sensors
Kev sib tw Sensors
Kev sib tw Sensors

Qhov khoom plig thib ob hauv kev sib tw Sensors

Pom zoo: