Cov txheej txheem:
- Khoom siv
- Kauj ruam 1: Nta
- Kauj ruam 2: Kev thaiv kab
- Kauj Ruam 3: Luam Ntawv 3D thiab Tsim Chase
- Kauj Ruam 4: Teeb Kho Raspberry PI
- Kauj ruam 5: Software
- Kauj Ruam 6: IOT Dashboard
- Kauj Ruam 7: Qhia Txog Kev Ua Haujlwm Yooj Yim
Video: Bandwidth Monitor: 7 Cov Kauj Ruam (nrog Duab)
2024 Tus sau: John Day | [email protected]. Kawg hloov kho: 2024-01-30 09:25
Raws li kuv tau nug kuv tus kheej ntau npaum li cas tam sim no tau muab los ntawm kuv ISP (Kuv siv LTE modem rau kev txuas Is Taws Nem), Kuv xav txog qhov ntsuas kab ke bandwidth. Txij li lub kaw lus yuav tsum ua kom me me thiab txuag hluav taws xob, Kuv tau xaiv Raspberry Pi Zero ua lub hauv paus tseem ceeb. Raspberry txuas nrog lub modem ntawm WLAN, yog li WLAN teeb meem tuaj yeem kuaj pom ib yam.
Khoom siv
- Raspberry Pi Zero WH
- Waveshare e-ink zaub (2.9inch-e-paper-module)
- DC-DC hloov pauv (piv txwv li DEBO DCDC 20W)
- RGB LED (tshem tawm los ntawm lub cuab yeej qub)
- Laub-khawm
- Hloov
- Relais module (piv txwv li 2 Way Relay module2 Way Relay module)
- Txiv neej txuas + Poj niam txuas (ob leeg haum qhov loj ntawm koj lub modem fais fab mov ntsaws)
- Cov ntawv luam tawm 3D
Kauj ruam 1: Nta
- Raspberry Pi Zero tau txuas nrog ntawm WLAN, ntsuas kev nce thiab rub tawm nrawm thiab ua qhov ntsuas ping txhua ib nrab teev. Ib kab hais kom ua version ntawm speedtest.net tau siv los ua lub hauv paus rau kev ntsuas.
- Qhov tshwm sim ntawm kev ntsuas bandwidth thiab ping tau qhia ntawm e-ink zaub. Lub sijhawm ntsuas kuj tseem pom.
- Yog tias qhov rub tawm nrawm poob qis dua tus nqi pib txhais, tus xa tawm hloov lub modem tawm thiab nyob rau lub sijhawm luv. Lub modem yog li rov pib dua yam tsis muaj kev hloov kho ntawm lub cuab yeej (tsuas yog lub zog txuas raug cuam tshuam).
- Ib lub pob nyob rau pem hauv ntej ntawm lub cuab yeej muaj los txhawm rau ntsuas qhov ntsuas qhov ntsuas tus kheej.
- Qhov ntsuas ntsuas tau muab tso rau ntawm Ubidots Dashboard (IOT Portal). Hauv cov ntsiab lus koj tseem tuaj yeem pom lub sijhawm keeb kwm ntawm qhov ntsuas ntsuas thiab yog vim li cas rau qhov rov pib dua.
- Hauv IOT Portal koj tseem tuaj yeem pom lub pob kom rov pib dua lub modem.
- Bandwidth saib xyuas siv lub hwj chim ntawm tus qauv. Tsis xav tau khoom ntxiv. Cov kev cuam tshuam cuam tshuam kev xa cov xa hluav taws xob mus rau lub modem - raspberry tseem tau hloov pauv.
Kauj ruam 2: Kev thaiv kab
Hauv thawj daim duab koj tuaj yeem pom tus tsim sab hauv ntawm bandwidth saib:
Cov khoom loj yog:
- Laub khawm
- E-ink Zaub
- Raspberry Pi Zero
- Relay Module
- RGB LED + Resistors (nyob ntawm RGB LED koj siv)
- Hloov
- DC-DC Hloov
- Poj niam txuas
Daim duab thib ob qhia txog cov txheej txheem ntawm cov thaiv. Tus ncej zoo ntawm cov khoom siv hluav taws xob tau pub los ntawm kev hloov mus rau DC-DC qhov hloov hluav taws xob (uas hloov 12V lub zog hluav taws xob ntawm lub router rau 5V rau Raspberry) thiab ntawm kev xa tawm (ntawm tus lej txuas nrog tus pin) rov qab mus rau cov zis txuas. Yog li cov modem tseem tau muab nrog lub zog thaum qhov ntsuas bandwidth raug kaw.
Qhov ntsuas bandwidth tuaj yeem pib ua haujlwm ntawm lub pob. Ib qho RGB LED tau siv los pom txog ntau lub xeev ua haujlwm.
Qhov kev sib txuas ntawm Raspberry Pi thiab e-ink zaub tsis pom hauv daim duab kos. Txuas cov zaub raws li lub rooj thiab tus pin-tawm saum toj no.
Kauj Ruam 3: Luam Ntawv 3D thiab Tsim Chase
Cov hauv qab no xav tau rau rooj plaub (saib daim duab saum toj no):
- qis dua
- sab saud
- pem hauv ntej
- rov qab
- 4x cog
Txhua ntu tuaj yeem luam tawm yam tsis muaj kev txhawb nqa. Koj kuj tseem tuaj yeem nrhiav cov ntaub ntawv thiab qee qhov ntawm kuv lwm tus qauv ntawm Thingiverse:
Cov zaub tuaj yeem txuas rau ntawm lub vaj huam sib luag pem hauv ntej nrog cov mounts thiab daim kab xev ob npaug. Khawm hloov thiab txuas tus poj niam tau ntsaws rau sab nraub qaum thiab tom qab vaj huam sib luag. Kuv siv 3x20mm ntsia hlau los txuas ob lub tsev nyob ib nrab. Qhov ua siab ntev ntawm qhov zawj rau sab pem hauv ntej thiab nraub qaum yog qhov nruj. Yog tias tsim nyog, cov vaj huam sib luag pem hauv ntej thiab tom qab yuav tsum tau xuab zeb ntawm ntug (sab hauv kom tsis txhob puas qhov chaw).
Kauj Ruam 4: Teeb Kho Raspberry PI
Phau ntawv teeb tsa no yog ua raws kev suav sau ntau cov lus qhia teeb tsa los ntawm ntau qhov chaw (e-Ink zaub manufacturers, …). Rau kuv cov lus qhia tau coj mus rau qhov txiaj ntsig xav tau. Txij li thaum kuv tsis yog Linux tus kws tshaj lij, tsis muaj qhov ua tau zoo lossis zoo ib yam tau ua tiav. Kuv paub tias muaj qhov tseeb zoo dua thiab ua haujlwm tau zoo dua.
Cia peb xav tias koj twb muaj Raspbian teeb tsa ntawm koj Pi (muaj ntau yam qhia paub yuav ua li cas rau nruab qhov haujlwm ua haujlwm yooj yim) thiab koj muaj cov zaub (ntawm miniHDMI), nas thiab keyboard txuas nrog. Kev teeb tsa WLAN txuas mus rau lub router lossis Is Taws Nem yog qhov raug. Tshwj tsis yog tau hais tseg, txhua qhov txheej txheem teeb tsa tau ua hauv lub davhlau ya nyob twg.
Nruab Chaw Taws Teeb (kom nkag tau PI los ntawm koj lub computer):
sudo apt-tau hloov tshiab
sudo apt-tau nruab
nruab xrdp
lossis koj tseem tuaj yeem ua haujlwm tsis tau taub hau ntawm ssh (saib piv txwv li
Hloov Password:
www.raspberrypi.org/forums/viewtopic.php?t=193620
Nruab speedtest:
sudo siv
apt-tau nruab sej-pip
sudo pip nruab speedtest-cli
los sim yog tias kev teeb tsa ua tiav khiav Speedtest hauv lub davhlau ya nyob twg:
speedtest-cli
yog tias txhua yam yog qhov raug koj yuav tsum tau txais qee yam zoo li hauv thawj daim duab saum toj no.
Nruab wiringPI
sudo apt-tau nruab git-core
git clone git: //git.drogon.net/wiringPi
cd kab w
./ tsim
(saib ntxiv
Alternativ:
sudo apt-tau nruab wiringpi
(saib
Nruab BCM2835
(saib
Rub tawm bcm2835-1.60.tar.gz (lossis hloov tshiab dua yog tias muaj)
tar zxvf bcm2835-1.60.tar.gz
cd bcm2835-1.60
./configure
ua
sudo ua daim tshev
sudo ua kom nruab
Nruab ib lub tsev qiv ntawv duab Python
sudo apt-tau nruab nruab sej-duab
Alternativ:
sudo apt-tau nruab python-pil
Pab kom I2C muaj nuj nqi.
Khiav cov lus txib hauv qab no los teeb tsa koj li Raspberry Pi board:
sudo raspi-teeb tsa
Xaiv Cov Txheej Txheem Xaiv-> I2C -> yog, los pib I2C tus tsav tsheb tseem ceeb. Tom qab ntawd koj kuj yuav tsum hloov kho cov ntawv teeb tsa. Khiav cov lus txib hauv qab no los qhib cov ntawv teeb tsa:
sudo nano /thiab /modules
Ntxiv ob kab hauv qab no rau cov ntaub ntawv teeb tsa
i2c-bcm2708
i2c-dev
Saib ntxiv
Pab kom SPI muaj nuj nqi
Khiav cov lus txib hauv qab no los teeb tsa koj li Raspberry Pi board:
sudo raspi-teeb tsa
Xaiv Cov Kev Xaiv Interface-> SPI -> yog, los pib SPI tus tsav tsheb tseem ceeb.
Nruab ib lub fonts ntxiv:
sudo apt-tau nruab ttf-mscorefonts-installer
Rub tawm thiab teeb tsa Fonts (Roboto + Droid)
gksudo ua
pcmanfm
Txhawm rau pib filemanager nrog cov cai hauv paus thiab luam cov ntawv truetype rau hauv nplaub tshev/usr/sib qhia/fonts/truetype
Alternativ:
Luam cov fonts mus rau Downloads nplaub tshev nrog WinSCP (ssh yuav tsum tau qhib kom siv WinSCP)
sudo cp -r/home/pi/Downloads/droid/usr/share/fonts/truetype
sudo cp -r/home/pi/Downloads/roboto/usr/share/fonts/truetype
Koj xav tau cov cai tshwj xeeb kom nkag mus rau daim ntawv tais ceev tseg. Tej zaum muaj txoj hauv kev zoo los ua qhov no (raws li tau hais los saum no Kuv tsis yog Linux tus kws tshaj lij) tab sis ob txoj hauv kev ua haujlwm rau kuv.
Nab hab sej cov ntaub ntawv:
Siv tus filemanger los tsim cov ntawv tshiab "bandwidth_monitor"
Luam tag nrho cov ntaub ntawv rau cov npe bandwidth_monitor
Ua cov ntaub ntawv nab hab sej ua haujlwm tau
chmod +x *.py
chmod +x speedtest-cron.sh
Configure crontab
crontab -e
Crontab yog siv los teem sijhawm rau kev ua haujlwm xws li speedtest txhua 30 feeb. Ntxiv cov kab hauv qab no rau koj lub crontab (saib daim duab thib ob):
@reboot/usr/bin/nab hab sej /home/pi/bandwidth_monitor/post_restart_message.py &
@reboot pw 30 &&/usr/bin/python /home/pi/bandwidth_monitor/poll_test_now_button.py */30 * * * * /home/pi/bandwidth_monitor/speedtest-cron.sh */3 * * * */usr/ bin/nab hab sej /home/pi/bandwidth_monitor/poll_killswitch.py 13 03 * * */usr/bin/nab hab sej /home/pi/bandwidth_monitor/refresh_display.py
Kev piav qhia ntawm cov haujlwm uas tau teem tseg:
- thaum rov pib dua cov lus rov pib sau rau IOT dashboard
- ntawm reboot qhov kev ntsuam xyuas kev ntsuam xyuas_now_button tau pib
- txhua 30 feeb qhov ntsuas ntsuas qhov ntsuas tau ua tiav
- txhua txhua 3 feeb qhov xwm txheej ntawm khawm rov pib dua (ntawm IOT dashboard) raug tshuaj xyuas
- ib zaug ib hnub ib qho kev hloov kho tshiab tau pib.
Saib ntu software rau kev piav qhia luv ntawm cov haujlwm.
Kauj ruam 5: Software
Lub software tau faib ua ob peb cov ntaub ntawv / cov haujlwm:
bandwidth_monitor_0_4.py yog qhov haujlwm tseem ceeb uas tau thov los ntawm Crontab txhua txhua ib nrab teev. Nws ua qhov ntsuas bandwidth (ntawm kab lus hais kom ua version ntawm speedtest.net). Thaum kuaj, RGB LED yog xiav. Yog tias qhov bandwidth siab dua qhov xaiv tau pib, tus nqi tau qhia ntawm e-ink zaub (nrog rau lub sijhawm) thiab xa tawm mus rau Ubidots dashboard. Yog tias qhov bandwidth qis dua qhov pib LED tig liab thiab ntsuas rov ua dua tom qab ncua sijhawm luv. Tom qab 3 qhov kev sim tsis zoo qhov kev xa tawm tau qhib thiab yog li lub zog hluav taws xob ntawm lub modem raug cuam tshuam. Pib dua txoj cai (tus nqi = 2) tau sau rau ntu ntu.
poll_killswitch.py nyeem cov xwm txheej ntawm boolean sib txawv ntawm lub dashboard. Yog tias killswitch_state muaj tseeb qhov relais tau qhib lub zog hluav taws xob ntawm lub modem raug cuam tshuam. RGB LED hloov ntsuab thaum lub sij hawm pov npav ntawm tus tua. Tom qab rov pib dua killswitch_state tau teeb tsa cuav thiab nkag mus rau ntu ntu ntawm lub dashboard tau tsim (tus nqi = 1).
poll_test_now_button.py tab tom tos lub pob nyem ntawm lub vaj huam sib luag pem hauv ntej ntawm rooj plaub kom raug nias. Los ntawm kev qhib lub pob, ntsuas ntsuas bandwidth tau ua rau tus kheej. Thaum qhov haujlwm pib (ntawm kev rov pib dua ntawm Raspberry Pi) RGB LED tab tom ntsais liab.
post_restart_message.py sau qhov pib dua tus lej (tus nqi = 3) rau ntu ntu ntawm lub dashboard. Qhov no qhia tias bandwidth saib tau rov pib dua. Thaum lub sijhawm pib ua haujlwm RGB LED teeb ci xiav.
test_LED.py thiab test_relay.py yog cov ntawv yooj yim uas tuaj yeem siv los ntsuas qhov ua haujlwm ntawm RGB LED thiab kev xa tawm.
epdconfig.py thiab epd2in9.py yog cov cuab yeej tsav tsheb rau e-ink zaub muab los ntawm Waveshare.
Txhawm rau tso cai rau cov haujlwm kom nkag mus rau Ubidots dashboard, koj yuav tsum ntxiv koj tus kheej tokens thiab cov cuab yeej lossis cov npe sib txawv (yog tias koj siv cov cim sib txawv). Tshawb nrhiav ntu zoo li qhov pom hauv daim duab saum toj no (hloov XXXXXXXX los ntawm koj tus cim).
Cov ntawv qhia ntxaws ntxaws txog yuav tsim lub dashboard thiab yuav ua li cas sib xyaw lub dashboard rau hauv Python program tuaj yeem pom ncaj qha ntawm Ubidots nplooj ntawv (https://help.ubidots.com/en/) lossis ntawm Google.
Kauj Ruam 6: IOT Dashboard
Lub dashboard tuav los ntawm Ubidots (saib https://ubidots.com) muaj ntau qhov chaw uas tau piav qhia luv luv hauv qab no.
- Sijhawm ntu ntawm nce- thiab rub tawm nrawm. Txhua ib nrab teev tus nqi tshiab raug ntxig rau hauv daim duab.
- Lub sijhawm kawm ntawm lub sijhawm ntsuas ping. Txhua ib nrab teev tus nqi tshiab tau ntxig rau hauv daim duab.
- Lub sijhawm ua ntu zus ntawm qhov nruab nrab rub tawm nrawm. Tus nqi nruab nrab tshaj 24 teev yog xam thiab sau rau daim duab.
- Spreadsheet sawv cev ntawm qhov ntsuas tam sim no suav nrog lub sijhawm thwj cim.
- Cov chaw taws teeb tswj kom rov pib dua lub modem ntawm Is Taws Nem. Kev nug tshwm sim txhua 3 feeb, piv txwv li nws yuav siv qee lub sijhawm kom txog thaum qhov kev ua tiav tiav.
- Nkag ntawm qhov rov pib dua suav nrog qhov laj thawj rau kev rov pib dua (ua rau thaj chaw deb, hloov tawm lossis poob qhov hluav taws xob, poob qis dua qhov tsawg kawg bandwidth)
Cov lus qhia ntxaws ntxaws txog yuav tsim lub dashboard thiab yuav ua li cas sib xyaw lub dashboard rau hauv Python program tuaj yeem pom ncaj qha ntawm Ubidots nplooj ntawv (https://help.ubidots.com/en/) lossis ntawm Google.
Pom zoo:
Hloov-Hloov Cov Khoom Ua Si: Cov Khoom Ua Si Cov Khoom Ua Si Ua Tau Zoo!: 7 Cov Kauj Ruam (nrog Duab)
Hloov-Hloov Cov Khoom Ua Si: Cov Khoom Siv Hluav Taws Xob Ua Tau Zoo!: Qho khoom ua si hloov pauv qhib txoj hauv kev tshiab thiab kev daws teeb meem kom tso cai rau menyuam yaus uas muaj lub cev muaj peev xwm txwv lossis kev xiam oos qhab kev loj hlob los cuam tshuam nrog cov khoom ua si ntawm nws tus kheej. Hauv ntau qhov xwm txheej, cov menyuam yaus uas xav tau cov khoom ua si hloov pauv tsis tuaj yeem nkag mus
Cov Duab Duab Duab thiab Cov Duab 1: 4 Cov Kauj Ruam (nrog Duab)
Cov Duab Duab Cubes thiab Cov Duab 1: Thaum sim nrog qee cov ntoo ntoo thiab cov duab los qhia, kuv pom ob peb txoj hauv kev los ua cov voos thiab lwm yam duab los ntawm cov khoom siv yooj yim. Los ntawm kev muab cov no los ua Cov Ntawv Qhia, Kuv vam tias yuav txhawb nqa kev ua si thiab kev kawm. Kev hloov pauv ntawm qhov kev qhia no
Yuav Ua Li Cas Thiaj Li Tshem Tawm Lub Computer Nrog Cov Kauj Ruam Yooj Yim thiab Duab: 13 Kauj Ruam (nrog Duab)
Yuav Tsum Tshem Tawm Lub Khoos Phis Tawj Li Cas Nrog Cov Kauj Ruam Yooj Yim thiab Duab: Nov yog cov lus qhia txog yuav ua li cas tshem lub PC. Feem ntau ntawm cov khoom siv yooj yim yog hloov pauv thiab tshem tawm tau yooj yim. Txawm li cas los xij nws yog ib qho tseem ceeb uas koj tau koom nrog nws. Qhov no yuav pab tiv thaiv koj kom tsis txhob poob ib feem, thiab tseem ua rau kev rov ua dua tshiab
Cov Duab Duab Duab Duab, WiFi Txuas - Raspberry Pi: 4 Cov Kauj Ruam (nrog Duab)
Cov Duab Duab Duab Duab, WiFi Txuas - Raspberry Pi: Nov yog txoj hauv kev yooj yim heev thiab tus nqi qis mus rau cov duab thav duab digital - nrog qhov zoo ntawm kev ntxiv /tshem cov duab hla WiFi ntawm 'nyem thiab luag' siv (pub dawb) xa cov ntaub ntawv . Nws tuaj yeem siv tau los ntawm qhov me me £ 4.50 Pi Zero. Koj tseem tuaj yeem hloov pauv
Rov Qab Siv Cov Duab Duab Nrog Virtual Asistent: 7 Cov Kauj Ruam (nrog Duab)
Rov Qab Siv Cov Duab Duab Nrog Virtual Asistent: Nyob zoo txhua tus! Cov lus qhia no tau yug los ntawm lub laptop faib ua ib nrab, yuav los ntawm ib tus phooj ywg. Thawj qhov kev sim ntawm txoj haujlwm no yog kuv Lego Digital Photo Frame, txawm li cas los xij, yog ib tus neeg mob siab rau Siri thiab Google Tam sim no, Kuv txiav txim siab coj nws mus rau qhov tshiab