Cov txheej txheem:
- Kauj Ruam 1: Nruab Raspbian thiab teeb tsa IP Chaw Nyob
- Kauj ruam 2: Nruab thiab teeb tsa tsab ntawv tsa suab
- Kauj Ruam 3: Nruab Apache thiab Teeb Web Tswj Nplooj Ntawv
- Kauj Ruam 4: Teeb thiab Xeem Txoj Cai
- Kauj ruam 5: Sib dhos
- Kauj Ruam 6: Pib Python Code ntawm Boot / Finishing Up
Video: Browser Tswj Roomba Neeg Hlau Nrog Raspberry Pi Qauv 3 A+: 6 Cov Kauj Ruam (nrog Duab)
2024 Tus sau: John Day | [email protected]. Kawg hloov kho: 2024-01-30 09:27
Txheej txheem cej luam
Cov Lus Qhia no yuav tsom mus rau yuav ua li cas muab Roomba tuag lub hlwb tshiab (Raspberry Pi), qhov muag (Webcam), thiab txoj hauv kev los tswj txhua yam los ntawm lub vev xaib.
Muaj ntau ntawm Roomba hacks uas tso cai tswj hwm los ntawm cov lej sib txuas. Kuv tsis tau muaj hmoo txaus los hla Roomba uas muaj lub khoos phis tawj tam sim no lossis ua haujlwm niam txiv. Ob lub Roomba qub dhau los lossis Roomba tuag lawm. Kuv pom Roomba Kuv tau siv rau txoj haujlwm no hauv khw muag khoom hauv nroog pheej yig nqi rau $ 5. Nws tseem muaj lub roj teeb uas tsim nyog, tab sis motherboard tuag. (Kuv kuj pom lub vev xaib ntawm tib lub khw khaws cia rau ib ncig $ 5). Txhua yam kuv siv los ntawm Roomba qub yog lub cav, lub cev, thiab roj teeb. Koj tsis tas yuav siv Roomba rau txoj haujlwm no. Koj tuaj yeem siv cov cav sib txawv, lub log, thiab cov chassis yog tias koj nyiam. Kuv tsuas yog xav tau tig ib daim ntawm cov khoom pov tseg rau hauv qee yam siv tau.
Txog qhov kev tsim no kuv siv Raspberry Pi Model 3 A+ thiab Riorand lub cev muaj zog tswj. Kuv tab tom siv cov cai los ntawm Dexter Industries Browser Tswj Tus Neeg Hlau uas kuv hloov kho. Dexter Industries version teeb tsa Pi ua lub websocket server uas tso cai rau koj los tswj lawv cov neeg hlau (cib pi platform) los ntawm cov neeg siv khoom html ua haujlwm lwm lub khoos phis tawj.
Kuv tau hloov pauv txoj cai siv tus lej GPIO thiab ntxiv ib txoj hauv kev rau Pi kaw thaum lub pob nyem / thaum tus yuam sij khiav tawm raug nias hauv qhov browser. Kuv kuj tau hloov qee qhov kev tswj hwm lub vev xaib kom tso cai saib cov lus tsa suab los ntawm iframe, thaum tswj cov neeg hlau nyob hauv ib nplooj ntawv nkaus xwb. Kuv teeb Pi nrog IP zoo li qub los tuav cov ntaub ntawv cov neeg siv khoom yog li kuv tuaj yeem txuas siv ib lub khoos phis tawj lossis khoom siv ntawm kuv lub network.
Kuv tab tom sau cov txheej txheem ntawm no hauv kev cia siab ntawm kev qhia yuav ua li cas los tsim cov neeg hlau yooj yim, pheej yig.
Qhov Siv
Raspberry Pi 3 A+ (Adafruit Link) $ 30
Riorand Dual Motor Driver Controller H-Bridge (Amazon Txuas) $ 22
Roj teeb 12V rau Cov Tsav Tsheb (Amazon Txuas) $ 19
5V Roj Teeb rau Raspberry Pi (Amazon Txuas) $ 10
8GB Micro SD Card (Amazon Txuas) $ 5
Jumper Wires (Amazon Txuas) $ 7
Roomba 500 series
. Txhua yam ua ke qis dua $ 100.
Kauj Ruam 1: Nruab Raspbian thiab teeb tsa IP Chaw Nyob
Kuv siv Raspbian Stretch Lite. Kuv tsis pom qhov xav tau rau lub desktop, tab sis koj tuaj yeem nruab lub desktop version yog tias koj xav tau.
Kuv yuav xav tias koj twb paub yuav ua li cas rau nruab Raspbian. Yog tias koj xav tau kev pab, koj tuaj yeem nrhiav Raspberry Pi Foundation cov lus qhia ntawm no.
Thaum koj muaj Raspbian nce thiab khiav, nkag mus thiab khiav qhov program raspi-teeb tsa.
pi@raspberrypi: ~ $ sudo raspi-teeb tsa
Teeb koj li WiFi txuas hauv raspi-teeb tsa
Xaiv
2 Kev Xaiv Network
Xaiv
N2 Wi-nkaus
Xaiv Lub Tebchaws, nkag mus rau koj tus lej SSID, thiab nkag mus rau koj tus lej nkag
Teeb SSH hauv raspi-teeb tsa
Thaum kuv tau teeb tsa thawj zaug, Kuv siv SSH los teeb tsa txhua yam tsis muaj hau. (Koj tuaj yeem hla qhov no yog tias koj siv lub monitor. Nws tau yooj yim dua rau kuv los hloov pauv cov cai yam tsis tas yuav tsum nres tus neeg hlau thiab ntsaws rau hauv lub monitor.)
Rov qab ntawm raspi-teeb tsa cov ntawv qhia zaub mov tseem ceeb
Xaiv
5 Kev xaiv cuam tshuam
Xaiv
P2 TSO
Xaiv
Yog lawm
Rov qab ntawm raspi-teeb tsa cov ntawv qhia zaub mov tseem ceeb xaiv
Txheeb xyuas tias koj tau txuas nrog koj lub network
pi@raspberrypi: ~ $ ifconfig
Koj yuav tsum tau txais cov txiaj ntsig zoo ib yam li qhov no. (Nco ntsoov tus IP chaw nyob; koj yuav xav tau nws tom qab. Piv txwv li 192.168.1.18)
wlan0: chij = 4163 mtu 1500
inet 192.168.1.18 netmask 255.255.255.0 tshaj tawm 192.168.1.255 inet6 fe80:: c74f: 42ec: 8cd3: 2fda prefixlen 64 scopeid 0x20 ether b8: 27: eb: 6a: a4: 95 txqueuelen 1000 (Ethernet) RX pob ntawv 44396 bytes 5847726 (5.5 MiB) RX yuam kev 0 poob 0 hla dhau 0 thav duab 0 TX pob ntawv 30530 bytes 39740576 (37.8 MiB) TX tsis raug 0 poob 0 hla dhau 0 tus neeg nqa khoom 0 sib tsoo 0
Txheeb xyuas tias koj tuaj yeem ncav cuag internet.
pi@raspberrypi: ~ $ ping google.com
Koj yuav tsum tau txais cov txiaj ntsig zoo ib yam li qhov no.
PING google.com (216.58.194.110) 56 (84) bytes ntawm cov ntaub ntawv.
64 bytes los ntawm dfw06s48-in-f14.1e100.net (216.58.194.110): icmp_seq = 1 ttl = 54 lub sijhawm = 18.2 ms 64 bytes los ntawm dfw06s48-in-f14.1e100.net (216.58.194.110): icmp_seq = 2 ttl = 54 lub sijhawm = 19.4 ms 64 bytes los ntawm dfw06s48-in-f14.1e100.net (216.58.194.110): icmp_seq = 3 ttl = 54 lub sijhawm = 23.6 ms 64 bytes los ntawm dfw06s48-in-f14.1e100.net (216.58.194.110): icmp_seq = 4 ttl = 54 lub sijhawm = 30.2 ms ^C --- google.com ping txheeb cais --- 4 pob ntawv xa, 4 tau txais, 0% pob ntawv poob, sijhawm 3004ms rtt min/avg/max/mdev = 18.209/ 22.901/30.267/4.715 ms
Teeb IP Static IP
Yuav kom muaj peev xwm txuas txuas mus tas li rau koj tus neeg siv tib lub chaw nyob ntawm koj lub network, koj yuav xav teeb tsa tus IP zoo li qub.
Tau txais koj qhov chaw nyob tam sim no piv txwv li 192.168.1.18
Kuv tab tom siv qhov chaw nyob uas tau txais los ntawm DHCP thaum Pi txuas nrog kuv lub network. Koj tuaj yeem hloov qhov no mus rau txhua yam uas koj nyiam tsuav nws sib phim nrog koj lub network thiab tsis cuam tshuam nrog lwm qhov chaw nyob.
Qhib dhcp.conf hauv kab ntawv sau. (Kuv siv nano)
pi@raspberrypi: ~ $ sudo nano /etc/dhcpcd.conf
Txav mus rau #Piv txwv IP zoo li qub teeb tsa thiab hloov cov kab hauv qab no.
#kev sib tham eth0
#static ip_address = 192.168.11.13 #static routers = 192.168.11.1 #static domain_name_servers = 192.168.11.1 8.8.8.8
Hloov kom phim koj lub network thiab tshem tawm # thaum pib ntawm txhua kab.
Piv txwv:
wb wl0
zoo li qub ip_address = 192.168.1.18 zoo li qub routers = 192.168.1.1 zoo li qub domain_name_servers = 192.168.1.1 8.8.8.8
Txuag thiab tawm.
Rov pib dua thiab txuas rau Pi ntawm SSH
pi@raspberrypi: ~ $ sudo rov pib dua
Txuas los ntawm lwm lub computer siv SSH. Cov neeg siv Windows tuaj yeem siv PuTTY lossis Windows Subsystem rau Linux (Windows10).
ian@computer: ~ $ ssh [email protected]
Sau koj tus password (lub neej ntawd yog raspberry).
[email protected] tus password:
Tam sim no koj yuav tsum nyob ntawm koj tus Pi qhov hais kom ua sai.
pi@raspberrypi: ~ $
Kauj ruam 2: Nruab thiab teeb tsa tsab ntawv tsa suab
Tsab ntawv tsa suab yog ib txoj haujlwm siv hauv ntau lub koob yees duab kev nyab xeeb / webcam cov haujlwm. Tsab ntawv tsa suab muaj ntau yam ntxwv. Txawm li cas los xij, peb tau teeb tsa nws kom yooj yim kwj video los ntawm lub vev xaib mus rau chaw nres nkoj 8081.
Kuaj Koj Lub Vev Xaib
Txuas koj lub vev xaib thiab sau cov khoom siv txuas nrog usb (Koj yuav xav tau rov pib dua tom qab txuas).
pi@raspberrypi: ~ $ lsusb
Koj yuav tsum tau txais cov txiaj ntsig zoo ib yam li qhov no. Nco tseg Logitech C210.
Tsheb npav 001 Ntaus 002: ID 046d: 0819 Logitech, Inc. Webcam C210
Tsheb npav 001 Ntaus 001: ID 1d6b: 0002 Linux Foundation 2.0 lub hauv paus hub
Yog tias koj lub koob yees duab tsis tshwm, nws yuav tsis sib xws lossis koj yuav xav tau teeb tsa cov tsav tsheb ntxiv.
Nruab Tsab ntawv tsa suab
Hloov pob.
pi@raspberrypi: ~ $ sudo apt-tau hloov tshiab
Nruab Tsab ntawv tsa suab.
pi@raspberrypi: ~ $ sudo apt -tau nruab tsab ntawv -y
Thaum Motion tau teeb tsa hloov kho cov ntawv teeb tsa.
pi@raspberrypi: ~ $ sudo nano /etc/motion/motion.conf
Hloov cov kab hauv qab no kom phim hauv qab no.
daemon yog
dav 640 qhov siab 480 framerate 100 output_pictures tawm ffmpeg_output_movies tawm text_right stream_port 8081 stream_quality 100 stream_localhost tawm webcontrol_localhost tawm
Pib Motion Daemon ntawm Boot
Qhib/etc/default/tsab ntawv tsa suab.
pi@raspberrypi: ~ $ sudo nano/etc/default/motion
Hloov mus rau
start_motion_daemon = yog
Txuag cov ntawv thiab tawm mus
Rov pib dua
pi@raspberrypi: ~ $ sudo rov pib dua
Tom qab Pi tau rov pib dua qhib qhov browser thiab txheeb xyuas tias koj muaj cov vis dis aus tso rau hauv qhov browser ntawm chaw nres nkoj 8081
Piv txwv:
192.168.1.18:8081
Troubleshooting Motion Daemon
Kuv tau ntsib teeb meem kom tau txais cov lus tsa suab daemon pib ntawm khau raj thaum kuv tau sim tawm cov kev xaiv sib txawv hauv cov ntawv tsa suab.conf.
Yog tias koj pib txav ua ntej cov lus daemon hauv Raspian Stretch, tej zaum koj yuav ntsib teeb meem kom nws pib ntawm khau raj tom qab. Khiav "sudo tsab ntawv tsa suab" yam tsis tau teeb tsa lub daemon ua nws xub tsim cov npe/var/log/tsab ntawv tsa suab yam tsis tau tso cai sau ntawv rau tus neeg siv.
Kauj Ruam 3: Nruab Apache thiab Teeb Web Tswj Nplooj Ntawv
Apache yog lub web server rau tus neeg hlau tswj lub vev xaib. Peb tab tom yuav hloov lub Apache index.html cov ntaub ntawv qub nrog cov ntawv rub tawm los ntawm github. Koj tseem yuav hloov ob peb kab ntawm cov cai los tso saib cov vis dis aus tso tawm thiab muab qhov chaw xa cov lus txib los tswj cov neeg hlau.
Nruab Apache thiab Git
pi@raspberrypi: ~ $ sudo apt -tau nruab apache2 git -y
Thaum apache thiab git raug teeb tsa rub tawm cov ntawv.
pi@raspberrypi: ~ $ git clone
Qhib phau ntawv teev npe roombarobot.
pi@raspberrypi: ~ $ cd roombarobot
Hloov cov ntaub ntawv index.html hauv/var/www/html nplaub tshev nrog cov ntawv index.html hauv/home/pi/roombarobot
pi@raspberrypi: ~/roombarobot $ sudo cp index.html/var/www/html
Kho cov ntaub ntawv index.html
Qhib cov ntawv index.html nrog cov ntawv sau.
pi@raspberrypi: ~/roombarobot $ sudo nano /var/www/html/index.html
Nrhiav ob kab no
var host = "ws: // YOURIPADDRESS: 9093/ws";
Hloov "YOURIPADDRESS" mus rau IP chaw nyob zoo li koj teeb tsa hauv Kauj Ruam 1 thiab khaws cov ntawv.
Piv txwv:
var host = "ws: //192.168.1.18: 9093/ws";
Ntawm lwm lub khoos phis tawj, qhib qhov browser thiab sau koj tus IP chaw nyob. Koj yuav tsum pom lub vev xaib tswj hwm nrog lub npov nyob sab laug, tshaj tawm cov vis dis aus los ntawm koj lub vev xaib, thiab lub vev xaib tswj cov nyees khawm ntawm sab xis.
Kauj Ruam 4: Teeb thiab Xeem Txoj Cai
Cov cai no tau sau ua nab nab thiab xav tau lub tsev qiv ntawv cua daj cua dub. Txoj cai siv lub tsev qiv ntawv los teeb tsa tus neeg rau zaub mov kom mloog cov lus txib los ntawm kev tswj hwm nplooj ntawv websockets ntawm chaw nres nkoj 9093.
Nruab PIP thiab Tornado Library
Nruab pip
pi@raspberrypi: ~ $ sudo apt-tau nruab sej-pip
Nruab lub tsev qiv ntawv cua daj cua dub
pi@raspberrypi: ~ $ sudo pip nruab cua daj cua dub
Pib Txoj Haujlwm Roombabot thiab Xeem Kev Sib Txuas
Pib qhov program roombabot.py
pi@raspberrypi: ~ $ sudo python /home/pi/roombarobot/roombabot.py
Thaum khiav, koj yuav tsum pom "Npaj" hauv lub davhlau ya nyob twg. Qhib tus tswj lub vev xaib hauv qhov browser thiab nyem txuas. Tom qab ntawd nyem rau ib qho ntawm cov lus taw qhia khawm ntawm nplooj ntawv. Koj tseem tuaj yeem siv cov xub tuav ntawm koj cov keyboard ib yam.
Koj yuav tsum pom qhov tso tawm hauv lub davhlau ya nyob twg zoo ib yam li qhov no.
Npaj txhij
qhib kev sib txuas… qhib kev sib txuas… tau txais: u 8 Khiav mus txuas rau txuas txuas tau txais… tau txais: l 6 Tig sab laug txuas tau qhib… tau txais: d 2 Khiav rov qab txuas tau qhib… tau txais: r 4 Tig Txoj Cai
Nias ctrl+c kom nres qhov program.
Thaum koj ua tiav ntsuas lub zog tawm ntawm Pi.
pi@raspberrypi: ~ $ sudo poweroff
Kab
Kuv tau pom muaj teeb meem nrog khawm kaw ntawm tus tswj lub vev xaib. Qee zaum khawm kaw tsis ua dab tsi thaum nws tau nyem lossis kais. Kuv tsis tuaj yeem txiav txim siab dab tsi yog qhov ua rau qhov no, tab sis muaj kev daws teeb meem. Yog tias koj xav kom lub zog tawm ntawm tus neeg hlau thiab khawm kaw tsis ua haujlwm, rov ua nplooj ntawv dua, nyem / coj mus rhaub khawm txuas thiab tom qab ntawd nyem / coj mus rhaub khawm kaw. Nws yuav tsum tau tua hluav taws.
Kauj ruam 5: Sib dhos
Raws li tau hais ua ntej, koj tsis tas yuav siv Roomba rau txoj haujlwm no. Txhua yam nrog ob lub cav, ob lub log thiab tus ncej yuav ua haujlwm. Kuv coj Roomba sib nrug thiab tshem tawm txhua yam tsuas yog lub log log thiab roj teeb.
Log Modules
Roomba lub log thiab lub cav tau nyob ua ke hauv ib qho qauv uas tshem tau. Txhua tus qauv muaj lub tsev nyob sab nrauv uas muaj lub cev muaj zog, lub iav, lub log, lub caij nplooj ntoo hlav, thiab lub rooj sib tham.
Pawg Thawj Tswj Hwm
Txhua lub rooj sib tham sib tham muaj rau xaim xov txuas rau nws. Muaj ob txoj xov hlau (Liab [+], Dub [-]) uas tig lub cev muaj zog, ib cov ntaub ntawv xov hlau rau lub ntsej muag ntsuas lub ntsej muag, ib lub xaim rau lub log poob hloov, ib qho 5V xaim, thiab ib lub xov tooj GND los ua lub zog ntsuas. Koj yuav tsum coj tus qauv sib nrug kom nkag mus rau lub rooj sib tham. Kuv tshem txhua yam rov qab mus rau lub cev muaj zog thiab muag tshiab [+] thiab [-] xov hlau rau lub tshuab (saib cov duab). Nws nyob ntawm koj seb koj puas xav khaws cov sensors lossis tsis yog.
Kev ncua caij nplooj ntoos hlav
Thaum koj tshem lub tshuab nqus tsev, Roomba qhov hnyav tau pov tseg. Yog tias koj tsis tshem cov dej tawm hauv chav Roomba yuav zaum ntawm lub kaum sab xis. Kuv xub tshem tawm cov no, tab sis tom qab ntawd ntxiv lawv rov qab thaum kuv pom tias nws nyuaj rau yob hla cov ntaub pua plag. Muab lub caij nplooj ntoo hlav rov qab kho qhov teeb meem.
Txuas lub cav mus rau Tus Tsav Tsheb
Cov motors tau tig los ntawm ib leeg. Qhov ntawd txhais tau tias txhawm rau tsav Roomba mus rau hauv ntej, ib lub cav yuav tau tig rau pem hauv ntej thaum lwm tus tig rov qab. Kuv tsis tau xav ntau txog qhov no txog thaum tom qab kuv txuas txhua yam. Kuv tsuas yog sau cov cai nyob ib puag ncig li cas kuv pib xaim lub cav. Qhov no yog qhov xwm txheej zoo siab vim tias thaum twg Raspberry Pi lub zog qhib/tawm, muaj qhov hluav taws xob tso tawm rau GPIO pins. Txoj kev uas kuv muaj cov khoom siv txuas, Roomba tig mus txog thaum Raspberry Pi tau khau raj (li peb caug vib nas this) thiab tig thaum kaw kom txog thaum lub zog raug tshem tawm. Yog tias sib txuas sib txawv, nws yuav muaj peev xwm txav tau rau pem hauv ntej / rov qab uas yuav ua rau khaus. Kuv npaj yuav kho qhov no nrog qhov hloov pauv yooj yim rau lub cav tswj.
Txuas cov Motors thiab Roj Teeb rau Tus Tsav Tsheb
Hwj chim ---
Lub cev muaj zog 2 - - - - - - - - - - - - - - - - - - - - - - - - - - - - Lub Cev Muaj Zog [-] Lub Cev Muaj Zog 2 - - - - - - - - - - - - - - - Liab - - - - - - - - - - - - - - --Left Motor [+] Motor 1- - - - - - - - - - - - - - - - - - - - - - - - - - -Right Motor [-] Motor 1- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ขวา Motor [+] GND - - - - - - - - - - - - - - - - - 12V [-] - - - - - - - - - - - --Roomba Roj teeb [-]
Txuas tus tsav lub cev rau Raspberry Pi
Tsav Tsheb Tus Kheej Pins Hlau Xim (saib duab) Raspberry Pi Pins
GND - - - - - - - - - - - - - - - - - - - - - - - - - - - GND PWM 2 - - - - - - - - - - - - - - - Xiav - - - - - - - - - - - - - GPIO 18 DIR 2 - - - - - - - - - - - Ntsuab - - - - - - - - - - - - -GPIO 23 PWM 1 - - - - - - - - - - - - - - Daj - - - - - - - - - - - GPIO 24 DIR 1 - - - - - - - - - - - - - - - Txiv kab ntxwv - - - - - - - - - - - - - GPIO 25 5V - - - - - - - - - - - - - - - - - - - - - - - - - - - - 5V
Mounting Electronics
Tsis muaj ntau qhov uas mus rau hauv muab txhua yam ua ke. Kuv hle lub roomba hauv nws lub chassis. Nrog lub hau tshem tawm, koj tuaj yeem yooj yim tshem tawm cov yas uas twb muaj lawm thiab laum qhov txhawm rau txhim kho cov khoom siv hluav taws xob. Muaj cov chaw nres nkoj uas twb muaj lawm los khiav cov kab hluav taws xob los ntawm lub cav. Yog tias koj tab tom siv cov roj teeb hauv Roomba, twb muaj kev txiav tawm rau kev nkag mus rau lub roj teeb kawg.
Roj teeb
Kuv siv cov roj teeb cais rau Raspberry Pi thiab lub cav tswj. Pi lub roj teeb tsuas yog 5V roj teeb pob siv los txhawb lub xov tooj ntawm tes. Txog tus tswj lub cev kuv siv lub roj teeb Roomba qub uas tuaj nrog nws. Cov roj teeb tsis tau sau npe, yog li nws yog qhov zoo tshaj los tshuaj xyuas qhov hluav taws xob nrog lub voltmeter ua ntej koj xaim nws mus rau lub cav tswj. Txhawm rau txuas cov xov hlau mus rau Roomba roj teeb, kuv tau siv plaub lub hlau nplaum neodymium (saib cov duab). Kuv soldered ob ntawm cov hlau nplaum rau cov xov hlau thiab ob qho ntxiv kuv txuas rau lub roj teeb txuas. Soldering demagnetizes cov hlau nplaum. Txawm li cas los xij, txheej txheej sab nrauv tseem tuaj yeem txuas rau cov hlau nplaum ntawm lub dav hlau thiab ua hluav taws xob. Qhov no ua rau txuas thiab txuas lub roj teeb ib qho ntawm cov ncuav.
Kev Xeem
Thaum koj muaj txhua yam ua ke, txheeb xyuas tias koj muaj txhua yam ua haujlwm txuas tau zoo, txhawb nqa koj lub neeg hlau rau qee yam (yog li nws tsis yob tawm), thiab siv nws.
ID nkag mus thiab pib qhov program program roombabot.py
pi@raspberrypi: ~ $ sudo python /home/pi/roombarobot/roombabot.py
Mus rau nplooj ntawv tswj hwm lub vev xaib thiab sim nws. Yog tias txhua yam tau txuas nrog kom raug, lub log yuav tsum tig rau hauv qhov kev coj ua thaum cov nyees khawm tau nyem / cov xub tuav tau nyem (tsis txhob hnov qab nyem txuas).
Kauj Ruam 6: Pib Python Code ntawm Boot / Finishing Up
Qhov kawg uas peb yuav tsum tau ua yog qhia Raspbian kom pib ua haujlwm nab hab sej ntawm khau raj. Txhawm rau ua qhov no peb yuav ua tsab ntawv thiab teem sijhawm nws kom rov pib dua siv crontab.
Tsim Tsab Ntawv
Tsim cov ntawv sau tshiab hu ua startrobot.sh hauv pi cov npe siv
pi@raspberrypi: ~ $ sudo nano startrobot.sh
Luam cov kab hauv qab no rau hauv cov ntawv
#!/bin/sh
#startrobot.sh cd /cd /home /pi /roombarobot sudo nab hab sej roombabot.py cd /
Txuag cov ntawv thiab tawm mus
Ua kom cov ntaub ntawv startrobot.sh ua tiav
pi@raspberrypi: ~ $ sudo chmod 755 startrobot.sh
Kuaj nws tawm (Nias ctrl + c kom nres)
pi@raspberrypi: ~ $ sh startrobot.sh
Kho cov ntaub ntawv crontab
pi@raspberrypi: ~ $ sudo crontab -e
Ntxiv kab hauv qab no rau hauv qab cov ntawv
# m h dom mon dow hais kom ua
@reboot sh /home/pi/startrobot.sh
Txuag thiab tawm
Qhov program roombabot.py yuav tsum tam sim no pib thaum Pi rov pib dua lossis lub zog hloov pauv.
Tiav tiav
Txij ntawm no mus koj yuav tsum muaj lub tshuab ua haujlwm uas koj tuaj yeem tswj tau siv lub browser los ntawm ib qho khoom siv hauv koj lub network. Kuv tau coj qhov no me ntsis ntxiv txij li qhov tsim thawj thiab teeb tsa VPN kom tuaj yeem nkag mus rau tus neeg hlau thaum kuv nyob deb ntawm tsev. Kuv npaj siab yuav hloov qee qhov kev hloov pauv yav tom ntej. Kuv npaj yuav ua kom nws muaj kev ywj pheej thiab muaj peev xwm ua raws kev txav mus thaum tseem muaj peev xwm ua tus tswj thaum kuv xav tau.
Pom zoo:
Ntsuas Neeg Hlau / 3 Log Neeg Hlau / STEM Neeg Hlau: 8 Kauj Ruam
Ntsuas Cov Neeg Hlau / 3 Log Neeg Hlau / STEM Neeg Hlau: Peb tau tsim ua ke sib npaug thiab 3 lub log neeg hlau rau kev kawm siv hauv tsev kawm ntawv thiab tom qab kawm ntawv cov haujlwm. Tus neeg hlau yog ua raws Arduino Uno, tus tiv thaiv kev tiv thaiv (txhua qhov kev tsim kho cov ntsiab lus muab), Li -Ion roj teeb pob (txhua qhov tsim tawm
Neeg Hlau-Ncej Neeg Hlau Los Ntawm Lub Cev 3D Cuam Tshuam: 12 Cov Kauj Ruam (nrog Duab)
Rope-climbing Robot From a Broken 3D Pen: 3D cwjmem yog cov cuab yeej zoo los txhim kho kev muaj tswv yim ntawm koj cov menyuam. Tab sis, koj tuaj yeem ua dab tsi thaum koj 3D Doodler Pib pib ua haujlwm thiab kho tsis tau? Tsis txhob pov koj tus cwj mem 3D rau hauv lub thoob khib nyiab! Vim tias hauv cov lus qhia no kuv yuav qhia koj yuav hloov pauv li cas
[Arduino Robot] Yuav Ua Li Cas Ua Lub Suab Ntaus Neeg Hlau - Thumbs Neeg Hlau - Servo Tsav - Source Code: 26 Cov Kauj Ruam (nrog Duab)
[Arduino Robot] Yuav Ua Li Cas Ua Lub Suab Ntaus Neeg Hlau | Thumbs Neeg Hlau | Servo Tsav | Source Code: Thumbs Neeg Hlau. Siv lub hwj chim ntawm MG90S servo motor. Nws lom zem heev thiab yooj yim! Cov cai yog yooj yim heev. Nws tsuas yog nyob ib ncig ntawm 30 kab. Nws zoo li lub suab ntes.Please tawm ib lo lus nug lossis lus teb! [Qhia] Source Code https: //github.c
Begging Neeg Hlau Nrog Saib Xyuas Lub Ntsej Muag thiab Tswj los ntawm Xbox Tus Tswj - Arduino: 9 Cov Kauj Ruam (nrog Duab)
Begging Robot Nrog Lub ntsej muag taug qab thiab Tswj los ntawm Xbox Controller - Arduino: Peb tab tom yuav ua tus thov neeg hlau. Tus neeg hlau no yuav sim ua rau khaus lossis ua rau pom kev dhau ntawm tib neeg. Nws yuav ntes lawv lub ntsej muag thiab sim tua lasers ntawm lawv. Yog tias koj muab tus neeg hlau ib npib, nws yuav hu nkauj thiab seev cev. Tus neeg hlau yuav xav tau
DIY Prototypes (neeg hlau lossis tsim qauv kos duab), Nrog Cov Khoom Hauv Tsev (Qhia Rov Ua dua) Ntu Ib: 4 Cov Kauj Ruam
DIY Prototypes (neeg hlau lossis tsim qauv kos duab), Nrog Cov Khoom Hauv Hauv Tsev (rov ua dua Phau Ntawv Qhia) Ntu Ib: Cov lus qhia no tsis piav qhia yuav tsim qee cov neeg hlau lossis kos duab tsim, tsis piav qhia yuav tsim lawv li cas, txawm li cas los xij nws yog phau ntawv qhia yuav ua li cas thiaj nrhiav tau cov ntaub ntawv tsim nyog rau kev tsim kho (kws kho tsheb) ntawm cov neeg hlau qauv (feem ntau ntawm cov no