Cov txheej txheem:

AtticTemp - Kub / Huab Cua Logger: 10 Kauj Ruam (nrog Duab)
AtticTemp - Kub / Huab Cua Logger: 10 Kauj Ruam (nrog Duab)

Video: AtticTemp - Kub / Huab Cua Logger: 10 Kauj Ruam (nrog Duab)

Video: AtticTemp - Kub / Huab Cua Logger: 10 Kauj Ruam (nrog Duab)
Video: Musicians talk about Buckethead 2024, Hlis ntuj nqeg
Anonim
AtticTemp - Kub / Huab Cua Logger
AtticTemp - Kub / Huab Cua Logger

Siab siab ntsuas kub thiab ntsuas huab cua rau koj lub nthab lossis lwm yam txheej txheem sab nraum zoov

Kauj Ruam 1: Flashing RaspberriPi Hard Disk / Install Required Software (Siv Ubuntu Linux)

Download "RASPBIAN JESSIE LITE"

Tsim koj lub hard disk tshiab rau DashboardPI

Ntxig lub microSD rau koj lub khoos phis tawj ntawm USB adapter thiab tsim cov duab disk siv cov lus txib dd

Nrhiav koj daim npav microSD tso ntawm df -h hais kom ua, unmount nws thiab tsim cov duab disk nrog daim disk theej daim ntawv dd

$ df -h/dev/sdb1 7.4G 32K 7.4G 1%/media/XXX/1234-5678

$ umount /dev /sdb1

Ceev faj: nco ntsoov tias cov lus txib yog qhov tseeb, koj tuaj yeem ua rau lwm lub disks puas tsuaj nrog cov lus txib no

yog = qhov chaw ntawm RASPBIAN JESSIE LITE duab cov ntaub ntawv ntawm = qhov chaw ntawm koj daim npav microSD

$ sudo dd bs = 4M yog =/path/to/raspbian-jessie-lite.img ntawm =/dev/sdb (ceeb toom: qhov no, nws yog/dev/sdb,/dev/sdb1 yog lub koomhaum uas twb muaj lawm muab faib rau ntawm microSD)

Teeb koj li RaspberriPi

Ntxig koj daim npav microSD tshiab rau raspberrypi thiab siv nws nrog lub ntsuas saib txuas nrog rau HDMI chaw nres nkoj

ID nkag mus

neeg siv: pi pass: raspberry

Hloov koj tus lej password rau kev nyab xeeb

sudo passwd pib

Pab kom RaspberriPi Advanced Options

sudo raspi-teeb tsa

Xaiv: 1 Nthuav Cov Ntaub Ntawv System

9 Advanced Options

A2 Hostname hloov nws mus rau "AtticTemp"

A4 SSH Pab kom SSH Server

A7 I2C Pab kom i2c interface

Pab kom Askiv/Asmeskas Keyboard

sudo nano/etc/default/keyboard

Hloov cov kab hauv qab no: XKBLAYOUT = "peb"

Rov pib dua PI rau Keyboard hloov pauv / cov txheej txheem txheej txheem hloov pauv kom muaj txiaj ntsig

$ sudo kaw -r tam sim no

Auto-Txuas rau koj li WiFi

sudo nano /etc/wpa_supplicant/wpa_supplicant.conf

Ntxiv cov kab hauv qab no kom muaj koj cov raspberrypi txuas nrog koj lub WiFi hauv tsev (yog tias koj lub wireless network npe "linksys" piv txwv, piv txwv li hauv qab no)

network = {ssid = "linksys" psk = "WIRELESS PASSWORD HERE"} Rov pib PI txuas rau WiFi network

$ sudo kaw -r tam sim no

Tam sim no tias koj tus PI yog qhov kawg ntawm lub network hauv zej zog, koj tuaj yeem nkag mus rau nws deb ntawm SSH. Tab sis ua ntej koj yuav tsum tau txais tus IP chaw nws tam sim no muaj.

$ ifconfig Saib rau "inet addr: 192.168. XXX. XXX" hauv cov lus txib hauv qab no tso tawm rau koj tus PI IP Chaw Nyob

Mus rau lwm lub tshuab thiab nkag mus rau koj li raspberrypi ntawm ssh

$ ssh [email protected]. XXX. XXX

Pib Txhim Kho cov pob khoom xav tau

$ sudo apt-tau hloov tshiab

$ sudo apt-tau hloov tshiab

$ sudo apt-tau nruab vim git nab-thov python-smbus i2c-tools python-imaging python-smbus build-essential python-dev rpi.gpio python3 python3-pip libi2c-dev

Hloov kho thaj chaw sijhawm hauv cheeb tsam

$ sudo dpkg-reconfigure tzdata

xaiv koj lub sijhawm siv lub interface

Teeb cov npe yooj yim l hais kom ua [xaiv tau]

$ vi ~/.bashrc

ntxiv cov kab hauv qab no:

$ alias l = 'ls -lh'

$ qhov chaw ~/.bashrc

Txhim kho VIM default syntax highlighting [yeem]

$ sudo vi/etc/vim/vimrc

tsis pom zoo cov kab hauv qab no:

syntax yog

Kauj ruam 2: Clone Project / Install Software Drivers

Clone Project qhov chaw cia khoom

$ cd ~ ib

$ git clone

DHT22 Nruab

$ cd ~ ib

$ git clone

$ cd Adafruit_Python_DHT/

$ sudo python setup.py nruab

$ sudo nab hab sej ez_setup.py

$ cd piv txwv/

$ vi simpletest.py

Hloov cov kab hauv qab no:

sensor = Adafruit_DHT. DHT22

Tawm tswv yim kab tawm

pin = 'P8_11'

Tsis suav nrog kab thiab hloov tus lej tus lej rau 16

pin = 18

Khiav qhov kev xeem

nab hab sej simpletest.py

Koj yuav tsum pom qhov ntsuas ntsuas ntawm Temp thiab Vaum pom ntawm kab hais kom ua.

SSD1306 Nruab

Tshem cov tsav tsheb/SSD1306.zip rau qhov project nplaub tshev

Nruab tus tsav tsheb

$ cd ssd1306/ $ sudo nab hab sej setup.py nruab

Paub meej tias koj lub cuab yeej sau npe, feem ntau nws yog / 0x3c ntawm lub tsheb npav i2c

$ sudo i2cdetect -y 1

0 1 2 3 4 5 6 7 8 9 abcdef 00: - - - - - - - - - - - - - - 10 - - - - - - - - - - - - - - - - - 20: - - - - - - - - - - - - - - - - - 30: - - - - - - - - - - - - 3c - - - 40: - - - - - - - - - - - - - - - - 50: - - - - - - - - - - - - -----60:------------------70- ----- Khiav qhov demo kom paub tseeb tias koj cov zaub yog ua haujlwm

$ cd piv txwv/ $ python demo.py

Kauj Ruam 3: Cov Khoom Xav Tau

Cov Khoom Siv Xav Tau
Cov Khoom Siv Xav Tau
Cov Khoom Siv Xav Tau
Cov Khoom Siv Xav Tau
Cov Khoom Siv Xav Tau
Cov Khoom Siv Xav Tau
Cov Khoom Siv Xav Tau
Cov Khoom Siv Xav Tau

RaspberriPi Xoom

DHT22 ntsuas kub thiab av noo

0.96 I2C IIC SPI Serial 12864 OLED LCD LED Dawb Zaub Module

2.4 400x240 16: 9 Serial: UART/I2C/SPI TFT Touchscreen Display

Kauj Ruam 4: Txuas Tus Ntaus

Hlau Device
Hlau Device
Hlau Device
Hlau Device

SSD1306 Zaub

GND -> GND

DATA -> SDA

CLK -> SCL

VCC -> 3V

Digole Zaub

GND -> GND

DATA -> SDA

CLK -> SCL

VCC -> 3V

DHT22 Humidistat

VCC -> 5V

GND -> GND

DATA -> GPIO 18 / PIN 12

Kauj ruam 5: Tsim Tus Ntaus Ntawv

Tsim Tus Ntaus
Tsim Tus Ntaus
Tsim Tus Ntaus
Tsim Tus Ntaus

Txiav Plexiglass kom haum rau pem hauv ntej ntawm lub cuab yeej hauv qab 3D luam tawm thav duab

Mount lub iav nrog cov ntsia hlau los ntawm daim duab 3D luam tawm

Kauj Ruam 6: Tsim Tus Ntaus (txuas …)

Tsim Tus Ntaus (txuas…)
Tsim Tus Ntaus (txuas…)
Tsim Tus Ntaus (txuas…)
Tsim Tus Ntaus (txuas…)
Tsim Tus Ntaus (txuas…)
Tsim Tus Ntaus (txuas…)

Cov Tshuaj Txhuam Hniav Kub tiv thaiv lub hauv ntej vaj huam sib luag

Hlau Chav nyob sab hauv

Mount lub nraub qaum thiab nws yuav tsum tau npaj mus

Kauj Ruam 7: Txheeb Cov Ntawv Thov kom Ua Kom raug hauv Settings.py Config File

Nrhiav cov ntaub ntawv settings.py thiab kho kom haum rau koj qhov chaw tam sim no

# forecast.io API qhov tseem ceeb rau cov ntaub ntawv huab cua hauv zos

weatherAPIURL = 'https://api.forecast.io/forecast/'

weatherAPIKey = 'Koj li API KEY FOR FORASAST. IO'

# yeem rau kev khiav lub ntsuas cua/cov av nyob deb deb

deviceLoggerAPI = 'mydevicelogger.com'

# tshawb google kom tau txais Latitude/Longitude rau koj qhov chaw nyob

latitude = 41.4552578

ntev = -72.1665444

Kauj Ruam 8: Teeb Sijhawm Scripts

$ crontab -e

Ntxiv cov kab hauv qab no: */7 * * * * nab hab sej /home/pi/AtticTemp/displays.py

YOOJ YIM: Temp Logger rau API tsab ntawv txhua 10 feeb

$ crontab -e

Ntxiv cov kab hauv qab no: */10 * * * * nab hab sej /home/pi/EnvironmentClock/temp-check.py

Kauj Ruam 9: XAV TAU: Tsim Koj Tus Kheej Cov Duab Huab Cua kom muab rau ntawm Zaub

Upload koj tus kheej 128x128 cov ntaub ntawv rau hauv qab no URL:

www.digole.com/tools/PicturetoC_Hex_converter.php

Xaiv koj cov ntaub ntawv duab rau upload, ntxiv qhov loj me koj xav kom nws nyob ntawm qhov screen (Dav/Qhov siab)

Xaiv "256 Xim rau Xim OLED/LCD (1 byte/pixel)" hauv "Siv rau" qhov poob qis

Tau txais cov txiaj ntsig hex

Ntxiv cov hex cov zis rau cov zaub/ tsim/ header (.h) cov ntaub ntawv, siv lwm tus los ua cov lus qhia rau cov lus sib xyaw.

Suav nrog cov ntawv tshiab hauv cov ntaub ntawv digole.c #include myimage.h

Suav nrog kab lus hais kom ua tshiab txuas rau koj cov ntaub ntawv duab hauv. Nco tseg: cov lus txib hauv qab no yog hais kos koj cov duab ntawm txoj haujlwm 10 pixels tshaj 10 pixels nqis. Koj tuaj yeem hloov nws mus rau X sib txawv, Y tswj hwm, koj tseem tuaj yeem hloov qhov muaj nuj nqis 128, 128 rau qhov loj me me uas koj cov duab tshiab yog.

} lwm yog (strcmp (digoleCommand, "myimage") == 0) {drawBitmap256 (10, 10, 128, 128, & myimageVariableHere, 0); // myimageVariableQhov no yog txhais hauv koj (.h) cov ntaub ntawv}

Tam sim no rov tsim dua (tsis quav ntsej qhov ua tsis raug) hauv qab no kom muaj koj cov duab tshiab ua nrog cov lus txib hauv qab no.

$./digole myimage

Rov Tsim Kho [suav nrog] Digole Display Driver rau koj qhov kev hloov pauv tau

$ cd tso saib/tsim

$ gcc digole.c

$ mv a.out../../digole

$ chmod +x../../digole

Pom zoo: