Cov txheej txheem:

Raspberry Pi USB Duab Duab: 5 Kauj Ruam
Raspberry Pi USB Duab Duab: 5 Kauj Ruam

Video: Raspberry Pi USB Duab Duab: 5 Kauj Ruam

Video: Raspberry Pi USB Duab Duab: 5 Kauj Ruam
Video: 10 самых АТМОСФЕРНЫХ мест Дагестана. БОЛЬШОЙ ВЫПУСК #Дагестан #ПутешествиеПоДагестану 2024, Kaum ib hlis
Anonim
Raspberry Pi USB Duab Duab
Raspberry Pi USB Duab Duab

Raspberry Pi USB duab thav duab

Raspberry Pi ua cov duab txiav los ntawm kev tso USB flash drive thiab raug kaw los ntawm nias lub pob tso rau hauv lub cuab yeej.

feh yog siv los tso saib cov duab los ntawm USB thiab cov ntawv nab nab los kaw lub cuab yeej.

Hauv cov lus qhia no kuv tsis piav qhia yuav ua li cas ntxiv khawm ntawm raspberry pi ntawm tus pin 9 thiab 11.

Kauj Ruam 1: Npaj Raspberry Pi

Txhim kho pob rasbian txheem los ntawm www.raspberrypi.org los ntawm kev ua raws daim duab qhia kev teeb tsa. NOOBS lossis Raspian yuav ua tau zoo ib yam nkaus.

Teeb Raspberry Pi raws li koj nyiam. Tsuas yog ib qho kom ntseeg tau tias Raspberry pib ntawm GUI. Cov lus qhia tuaj yeem nrhiav tau los ntawm www.raspberrypi.org. Koj xav tau keyboard ntawm thawj zaug pib. Koj tuaj yeem siv ob lub console ncaj qha los ntawm Raspberry Pi lossis raws li kuv nyiam SSH txuas rau lub cuab yeej. Yog tias koj siv Rasbian kawg thiab xav kom ssh rau thawj zaug pib koj yuav tsum ntxiv cov ntaub ntawv npe ssh ntawm / khau raj / phau ntawv teev npe ntawm SD daim npav.

Nruab feh

Hloov kho rasbian thiab nruab feh. Kev sib txuas hauv network xav tau.

sudo apt-tau hloov tshiab

sudo apt-tau hloov tshiab sudo apt-tau nruab feh

Tsim mount point

Mount point xav tau kom ntseeg tau tias txhua lub USB flash drive tau kho tib yam. Yog tias USB tsis tau teeb tsa nws yuav tshwm nyob rau hauv kev tshaj xov xwm raws li txoj kev nyem flash npe. Piv txwv tias KINGSTON yuav yog '/media/KINGSTON' thiab tsis tuaj yeem kuaj pom los ntawm feh yog tias qhov flash drive sib txawv tau siv yav tas los

sudo mkdir /media /usb

Kauj ruam 2: Kaw khawm

Kaw khawm
Kaw khawm

Cov theem no tuaj yeem hla yog tias khawm tsis siv los kaw Raspberry Pi. Kuv pom zoo siv qhov no txij li kaw Raspberry Pi yooj yim los ntawm kev tshem lub cuab yeej tuaj yeem ua rau SD lossis USB flash drive tsis zoo.

Kev txuas GPIO 17 mus rau hauv av yuav ua rau muaj kev kaw haujlwm. Koj tuaj yeem siv lwm tus pin tab sis cov cai yuav tsum tau hloov raws li.

Tsim shutdown.py

nano shutdown py

Thiab muab tshuaj txhuam cov cai hauv qab no

ntshuam RPi. GPIO ua GPIO

ntshuam lub sij hawm ntshuam os # GPIO 17 = tus pin 11 # GND = tus pin 9 GPIO.setmode (GPIO. BCM) GPIO.setup (17, GPIO. IN, rub_up_down = GPIO. PUD_UP) thaum muaj tseeb: luam GPIO.input (17) yog (GPIO.input (17) == Tsis tseeb): os.system ("sudo kaw -h tam sim no") so time.sleep (1)

Ctrl-x thiab Yog thiab Nkag mus kaw tus editor thiab txuag kev hloov pauv

Kauj ruam 3: Pib Pib

Hloov tshiab rc.local

Hloov kho rc-zos kom USB tau txais kev txhawb nqa ncaj qha thiab shutdown.py tau thauj khoom thaum pib

sudo nano /etc/rc.local

Rau hauv rc.local ua ntej 'tawm 0' ntxiv cov kab hauv qab no los teeb tsa USB flash drive thiab pib kaw.py ntawm cov txheej txheem keeb kwm yav dhau

sudo mount /dev /sda1 /media /usb

sudo nab hab sej /home/pi/shutdown.py &

Ctrl-x thiab Yog thiab Nkag mus kaw tus editor thiab txuag kev hloov pauv

Hloov kho LXDE autostart

Hloov kho LXDE yog li ntawd feh tau pib txiav thaum pib

sudo nano ~/.config/lxsession/LXDE-pi/autostart

Qhia cov kab hauv qab no thaum kawg ntawm autostart

@xset tawm

@xset -dpms @xset s noblank @feh --quiet --fullscreen --borderless --hide-pointer --slideshow-ncua 30/media/usb/

Ctrl-x thiab Yog thiab Nkag mus kaw tus editor thiab txuag kev hloov pauv

Kauj ruam 4: Xeem

Kev Xeem
Kev Xeem

Ntxiv qee cov duab ntawm USB tsav.

Mount USB los ntawm kev khiav

sudo mount /dev /sda1 /media /usb

Thiab saib yog tias koj tuaj yeem pom cov ntsiab lus ntawm USB tsav

ls /media /usb

Kuaj feh los ntawm kev ua raws hauv qab kab hais kom ua. Koj puas xav tau cov duab ntawm USB?

feh --quiet --fullscreen --borderless --hide-pointer --slideshow-ncua 1/media/usb/

Kuaj kaw los ntawm kev khiav

sudo python shutdown.py

thiab nias lub pob kaw (txuas cov pins kom raug).

Kauj Ruam 5: Cov Lus Qhia Ntxiv

Kev daws teeb meem uas yuav tig TV qhib thiab siv CEC

Ua tsaug rau RichardW58 rau qhov kev daws teeb meem no.

Nruab cec-utils:

sudo apt-tau nruab cec-utils

ntxiv cov kab hauv qab no hauv crontab -e

# Qhib TV

0 8 * * 1-5 ncha "ntawm 0" | cec-client -s # Tua TV tawm 0 16 * * 1-5 echo "standby 0" | cov -client -s

Qhov no ua haujlwm zoo nrog TV

Ntau

Kuv thawj kab lus tuaj yeem pom ntawm no.

phau ntawv qhia thiab phau ntawv.

Pom zoo: