Cov txheej txheem:

Huab Cua Tswm Ciab - Huab Cua thiab Kub Ib Leeg: 8 Kauj Ruam
Huab Cua Tswm Ciab - Huab Cua thiab Kub Ib Leeg: 8 Kauj Ruam

Video: Huab Cua Tswm Ciab - Huab Cua thiab Kub Ib Leeg: 8 Kauj Ruam

Video: Huab Cua Tswm Ciab - Huab Cua thiab Kub Ib Leeg: 8 Kauj Ruam
Video: yeej tseeb & yuv yum 2024, Kaum ib hlis
Anonim
Huab Cua Tswmciab - Huab cua thiab Kub Ib Leeg
Huab Cua Tswmciab - Huab cua thiab Kub Ib Leeg

Siv lub tswm ciab khawv koob no, koj tuaj yeem qhia qhov kub thiab txias tam sim no sab nraud tam sim ntawd

Kauj Ruam 1: Xim Ntau Yam 0 txog 100*F

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

Kauj Ruam 2: 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

user: pib

dhau: raspberry

Hloov koj tus lej password rau kev nyab xeeb

sudo passwd pib

Pab kom RaspberriPi

Advanced Xaiv

sudo raspi-teeb tsa

Xaiv: 1 Nthuav Cov Ntaub Ntawv System

9 Advanced Options

A2 Hostname hloov nws mus rau "WeatherJar"

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"}

Reboot 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 memcached vim git python-smbus i2c-tools python-imaging python-smbus build-essential python-dev rpi.gpio python3 python3-pip python-memcache

** Hloov kho cov sijhawm hauv cheeb tsam hauv zos

$ 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

Nruab i2c Python Tsav Tsheb

Nruab NeoPixel Driver raws li hauv qab no

sudo apt-tau nruab tsim-qhov tseem ceeb nab hab sej-dev git scons swig

sudo pip3 nruab -hloov kho setuptools

sudo pip3 nruab rpi_ws281x

cd rpi_ws281x

saib xyuas

cd python

sudo python setup.py nruab

cd piv txwv/

sudo nab hab sej strandtest.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

RaspberryPi Zero

USB WIFI (yog tias tsis yog PiZero W)

NeoPixel Nplhaib

Frosted Teeb Duab

Kauj Ruam 4: Tsim Huab Cua

Tsim lub WeatherJar
Tsim lub WeatherJar

Solder tus coj los txuas NeoPixel Ring rau Pi, xav tau 5V, GND thiab GPIO tus pin 18 txuas nrog

*Nco tseg: txij li peb tsuas yog siv ib lub nplhaib uas tsis tau pom dua tag nrho qhov ci / ci xim dawb, peb tuaj yeem tso siab rau lub zog ntawm RPi nws tus kheej. Feem ntau lawv pom zoo 5050 RGB pixesl xws li cov no kom muaj lawv tus kheej lub zog siv.

Txuas lub NeoPixel mus rau 5v thiab GND ntawm RPi, txuas tus "hauv" tus pin ntawm NeoPixel ntiv nplhaib rau GPIO Pin #18

Luam tawm Cov Ntaub Ntawv Hauv 3D-Luam/ nplaub tshev ntawm txoj haujlwm no, luam tawm lub hau thiab lub hauv paus ntawm tswm ciab kom muaj lub cuab yeej.

Kauj Ruam 5: Tsim Tswmciab

Tsim Tswmciab
Tsim Tswmciab
Tsim Tswmciab
Tsim Tswmciab
Tsim Tswmciab
Tsim Tswmciab
Tsim Tswmciab
Tsim Tswmciab

Siv rab phom kub kub, lo lub pi xoom rau hauv qab ntawm lub tswm ciab

Laum qhov kom tso cai rau lub hwj chim USB cable nkag los.

Kuv tau siv qee daim kab xev yooj yim los tuav lub NeoPixel Ring rau lub khawm ntawm tswm ciab, ntsaws cov xov hlau kom deb kom ntseeg tau tias lub teeb raug thaiv los ntawm ib qho kev coj txawv txawv sab hauv.

Kauj Ruam 6: Tsim Qhov Kub API

Tsim kom muaj Kub API
Tsim kom muaj Kub API

Python Flash API rau tso tawm qhov kub thiab txias raws li xim gradient teeb tsa cov lus qhia

InstallationClone txoj haujlwm webserver nplaub tshev hauv zos ntawm koj lub vev xaib los ntawm txoj haujlwm no [/var/www]

Tsim Apache teeb tsa los taw tes rau txoj haujlwm no (Python Flask API)

Yuav tsum tau pob khoom rau Python Flash ntawm Apache

$> sudo apt-tau nruab libapache2-mod-wsgi python-dev python-pip python-pil

$> sudo a2enmod wsgi

$> sudo kev pabcuam apache2 rov pib dua

$> pip nruab lub raj mis

mytempuratureapi.com/neopixel?temperature=7…

Kauj Ruam 7: Teeb RPi Cronjob rau Tswmciab rau Kev Ua Haujlwm

Teeb tus neeg siv crontab

Nkag mus rau kab hauv qab no rau ib feeb dhau ib feeb crontab

$ crontab -e

*/1 * * * * nab hab sej /home/pi/WeatherJar/weather.py

Teeb tus neeg siv hauv paus crontab (lub tsev qiv ntawv no xav tau kev nkag mus rau hauv paus) Teeb "ntawm reboot" kom khiav lub tswm ciab nab nab ntawv ib txhis

$ sudo ua

$ crontab -e

@reboot sej /home/pi/WeatherJar/candle.py

Kauj ruam 8: Ua tiav

Tiav lawm!
Tiav lawm!

Nco ntsoov tso qhov URL tshiab no uas koj tau tsim hauv koj qhov chaw teeb tsa kom koj tam sim no tuaj yeem muaj huab cua lub thawv teb rau koj qhov ntsuas kub sab nraum zoov tam sim no.

Pom zoo: