Cov txheej txheem:

Raspberry Pi Reboot Router: 3 Kauj Ruam
Raspberry Pi Reboot Router: 3 Kauj Ruam

Video: Raspberry Pi Reboot Router: 3 Kauj Ruam

Video: Raspberry Pi Reboot Router: 3 Kauj Ruam
Video: How To Make TOR Wi-Fi Router With Raspberry Pi 3 | Turn Your Raspberry Pi into Tor Wi-Fi Router! 2024, Kaum ib hlis
Anonim
Raspberry Pi Reboot Router
Raspberry Pi Reboot Router
Raspberry Pi Reboot Router
Raspberry Pi Reboot Router

Koj puas tau pom tias koj tsis txuas nrog internet lawm?

Puas yog nws ntxhov siab thaum sawv ntxov thiab yuav tsum tau 'rov pib dua' lub router kom tau txais internet rov qab?

Zoo, qhov no tau tshwm sim rau kuv ntau dua li kuv saib xyuas kom nws tshwm sim.

Nyuam qhuav pib lub xyoo no, Kuv tau tawm ntawm lub nroog rau 3 lub lis piam thiab nyob rau thawj hnub kuv tus router tsis txuas hauv internet! Qhov no txhais tau tias kuv tsis muaj kev sib txuas nrog cov khoom hauv kuv lub tsev kuv vam khom rau hauv 'tshawb xyuas' nyob rau qee lub sijhawm - piv txwv li, Nest thermostat, Arlo lub koob yees duab … Txij li thaum kuv tsis nyob hauv tsev, kuv tsis tuaj yeem rov pib dua kuv lub router. Kuv yeej tsis xav thab ib tus neeg nyob ze kom dhau kuv li kev ruaj ntseg thiab tom qab ntawd pom kuv lub router thiab rov pib dua. Kuv kuj xav tias hu xov tooj rau lub tuam txhab fais fab thiab kom lawv txiav lub hwj chim rau kuv lub tsev li 5 feeb - kuv S. O. tsis pom zoo..:(Thaum kuv tau txais rov qab, Kuv pib tshawb nrhiav qhov kev daws teeb meem zoo tab sis tsis tuaj yeem pom ib yam dab tsi txaus rau qhov kuv xav tau. Thaum xub thawj, kuv nyuam qhuav yuav lub sijhawm siv hluav taws xob digital thiab teeb nws kom tig lub router tawm thaum 2:00 teev sawv ntxov txog 5 feeb. Hmoov tsis zoo, ob peb sawv ntxov kuv tsis muaj internet - kev tshuaj xyuas lub router cav rau cov hnub ntawd tau qhia tias internet tau txiav tawm ib ncig 4:00 teev sawv ntxov thiab kuv lub router yuav tsis txuas tshwj tsis yog kuv rov pib dua.

Muaj qhov Raspberry Pi ntxiv nyob ib puag ncig thiab qee qhov txuj ci nab nab, Kuv txiav txim siab los saib seb nws yuav pab tau kuv li cas thiab daws qhov kev daws teeb meem no li cas.

Kuv sim thiab teeb tsa nws thiab kom deb li deb tau zoo!

Yeej, Raspberry Pi tshawb xyuas qhov txuas hauv internet txhua 2 feeb ntawm 'ping' rau 2 lub vev xaib sib txawv. Tsuav muaj tsawg kawg ib ntawm lawv teb, peb txhua tus zoo. Yog tias tsis muaj qhov rov qab los 'pings' Pi kaw lub zog rau sab hauv USB lub hauv paus uas ua rau Iot Power Relay hloov mus rau ntawm lub router. Tom qab 2 feeb, Pi txhawb nqa lub hauv paus USB sab hauv ua rau Iot Power Relay hloov ntawm lub router. Tom qab ntawd nws tos 4 feeb ua ntej rov pib dua 2 feeb tshawb xyuas internet txuas.

Kuv kuj yuav tsum txiav txim siab tias tej zaum muaj qhov hluav taws xob hauv kuv thaj chaw thiab internet yuav poob qis ib ntus - tsawg, tab sis nws tshwm sim (tsawg kawg hauv kuv cheeb tsam …) thiab kuv tsis xav kom lub router rov pib dua txhua 6 txog 8 feeb yog li kuv muab tso rau hauv tus chij uas yuav ncua ncua kev rov pib dua rau 1 teev hauv qhov no.

Khoom siv

Cov Khoom Siv:

  1. Iot Power Relay rau Raspberry Pi (daim duab saum toj no)
  2. USB 2.0 A Screw Terminal Block Connector (yog tias koj yuav ua koj tus kheej USB -> Lub hwj huam kab hluav taws xob, tseem muaj duab saum toj no)
  3. Cable nrog 2 lossis ntau dua cov xov hlau lossis qub / ntxiv USB cable koj tuaj yeem siv. Kuv siv lub qub tso suab phono plug cable thiab txiav cov plugs.
  4. Raspberry Pi Qauv 3+ (koj tuaj yeem siv Tus Qauv 4 thiab tswj tus kheej cov chaw nres nkoj - Kuv tab tom siv Tus Qauv 3)

Kuv yuav khwv tau nyiaj me me rau kuv qhov kev pom zoo, kev pom zoo, ntawv pov thawj, thiab/lossis txuas rau ib yam khoom uas tau teev tseg saum toj no.

Kauj ruam 1: Tsim thiab Txuas Cov Khoos Phis Tawj

Tsim thiab Txuas Cov Khoos Phis Tawj
Tsim thiab Txuas Cov Khoos Phis Tawj

Kuv ua kuv lub xov tooj txuas txuas Pi rau lub zog txuas.

Kuv siv USB ntsia hlau dav hlau thaiv nrog 2 xov txuas nrog rau + thiab gnd qhov qhib. Koj yuav tsum muaj peev xwm pom lawv ntawm tus txuas. Saib daim duab nrog liab (+) thiab dawb (-) xub mus rau qhov qhib.

Kuv txuas lwm qhov kawg rau lub zog txuas. Ib feem ntsuab ntawm sab ntawm lub zog xa tawm tsuas yog rub tawm thiab tom qab ntawd koj tuaj yeem ntxig cov xov hlau rau hauv qhov qhib thiab ntsia hlau tom qab kaw nruj. Saib daim duab nrog liab (+) thiab dawb (-) xub rau cov xov hlau.

Nco tseg: yog tias koj siv USB cable uas twb muaj lawm, feem ntau koj yuav muaj 4 lub xov hlau nyob rau lwm qhov kawg - ib qho liab yog (+5v) thiab ib qho dub yog (-) hauv av. Koj tsuas yog siv cov 2 rau Lub Hwj Chim Relay.

Txog kev sim, Kuv txuas lub teeb rooj rau ib qho ntawm cov chaw cim "ib txwm tawm". Qhov no yog tswj los ntawm lub zog USB lub xeev. Kuv ntsaws Raspberry Pi rau hauv 'ib txwm nyob ntawm' qhov hluav taws xob thiab ntsaws nws thiab tig nws rau qib tom ntej.

Kauj ruam 2: Nruab Software

Teeb tsa Pi:

Muaj ob peb lub vev xaib uas yuav coj koj kev teeb tsa koj li RPi thawj zaug yog xav tau.

Lub neej Hacker

Raspberry Pi Org

Kuv teeb kuv 'taub hau' thiab siv VNC txuas rau nws. Cov kev sib txuas saum toj no qhia yuav ua li cas.

Software teeb tsa:

  1. Nruab uhubctl (saib https://github.com/mvp/uhubctl) uas yuav siv los tig lub usb hub tawm thiab qhib.
  2. Rub tawm thiab teeb tsa software kuv tau sau los ntawm kuv nplooj GitHub: RPi Router Reboot software.
  3. Teeb thiab sau npe hauv internet-monitor.service yog tias koj xav ua qhov no ua haujlwm thaum Raspberry Pi pib.

Kauj Ruam 3: Xeem thiab Ua Haujlwm Cov Lus Qhia

Txoj haujlwm loj nab nab, rpi-internet-monitor.py tuaj yeem ua haujlwm nrog 1 lossis 2 qhov ntsuas rau kev debugging thiab ntsuas lub hom phiaj.

Qhib qhov kev sib tham dav dav hauv daim nplaub tshev koj tso cov cai thiab ua raws cov lus txib hauv qab no:

: ~/Cov ntaub ntawv/RebootRouter $ python3 rpi-internet-monitor.py -debug -test

Nco tseg - qhov no yuav luam tawm cov ntaub ntawv debugging thiab tig lub teeb tawm thiab raws li nws yuav ntsuas tawm tsis txuas nrog internet. Koj tuaj yeem siv -debug thiab pom cov lus. Koj tsis tuaj yeem tsuas yog siv -test, nws yuav tsum yog qhov ntsuas thib ob tom qab -debug.

Koj tuaj yeem hloov CONSTANTS nyob rau sab saum toj ntawm txoj haujlwm rau yam tseem ceeb uas koj nyiam. Thawj qhov teeb tsa nrog -test ntsuas qhov ntsuas, txheej thib ob yog dab tsi uas yuav siv rau hauv txhua qhov xwm txheej.

Kuv teeb tsa qhov kev pabcuam los khiav qhov no ntawm lub sijhawm khau raj yog li nws ib txwm ua haujlwm ntawm kuv Raspberry Pi.

Qhib internet-monitor.service thiab hloov kho ExecStart thiab WorkingDirectory kab nrog koj txoj kev mus rau tus nab npawb nab npawb. Txuag cov ntawv.

Luam cov ntawv rau hauv systemd/system nplaub tshev:

: ~/Cov ntaub ntawv/RebootRouter $ sudo cp internet-monitor.service /etc/systemd/system/internet-monitor.service

Kuaj tias qhov kev pabcuam pib yam tsis muaj qhov yuam kev:

: ~/Cov ntaub ntawv/RebootRouter $ sudo systemctl pib internet-monitor.service

Pab kom cov kev pabcuam pib thaum lub sijhawm khau raj:

: ~/Cov ntaub ntawv/RebootRouter $ sudo systemctl pab internet-monitor.service

Yog tias txhua yam mus tau zoo, tam sim no koj tuaj yeem tso nws tag nrho ua ke thiab tig Iot Power Relay tawm, tshem lub teeb, txuas lub router thiab tig Lub Hwj Huam Relay rov qab. Koj lub router yuav tsum rov pib dua thiab tam sim no tab tom saib xyuas internet.

Kuv tau ua ib qho kev sim ntxiv tom qab kuv muaj txhua yam sib txuas - Kuv tau txuas kuv lub xov tooj hluav taws xob txuas ntawm phab ntsa thiab tos; paub meej tias lub router tau tawm mus thiab tom qab ntawd. Nws nyob ntawm thiab tom qab 10 feeb lossis li ntawd, Kuv rov txuas lub xov tooj ntawm phab ntsa thiab muaj internet - nws tau ua haujlwm zoo txog tam sim no ….:)

Pom zoo: