Cov txheej txheem:

Teeb Yooj Yim IR Kev Tswj Chaw Taws Teeb Siv LIRC rau Raspberry PI (RPi) - Lub Xya Hli 2019 [Ntu 1]: 7 Cov Kauj Ruam
Teeb Yooj Yim IR Kev Tswj Chaw Taws Teeb Siv LIRC rau Raspberry PI (RPi) - Lub Xya Hli 2019 [Ntu 1]: 7 Cov Kauj Ruam

Video: Teeb Yooj Yim IR Kev Tswj Chaw Taws Teeb Siv LIRC rau Raspberry PI (RPi) - Lub Xya Hli 2019 [Ntu 1]: 7 Cov Kauj Ruam

Video: Teeb Yooj Yim IR Kev Tswj Chaw Taws Teeb Siv LIRC rau Raspberry PI (RPi) - Lub Xya Hli 2019 [Ntu 1]: 7 Cov Kauj Ruam
Video: Python! Flattening Nested Lists 2024, Hlis ntuj nqeg
Anonim
Teeb Yooj Yim IR Kev Tswj Chaw Taws Teeb Siv LIRC rau Raspberry PI (RPi) - Lub Xya Hli 2019 [Ntu 1]
Teeb Yooj Yim IR Kev Tswj Chaw Taws Teeb Siv LIRC rau Raspberry PI (RPi) - Lub Xya Hli 2019 [Ntu 1]

Tom qab tshawb nrhiav ntau kuv tau xav tsis thoob thiab poob siab txog cov ntaub ntawv tsis sib haum ntawm yuav teeb tsa IR chaw taws teeb tswj rau kuv li haujlwm RPi li cas. Kuv xav tias nws yuav yooj yim tab sis teeb tsa Linux InfraRed Control (LIRC) tau muaj teeb meem ntev tab sis hloov pauv ntau nyob rau lub Rau Hli 2019 nrog kev tso Buster version ntawm Raspbian ua ntau qhov kev qhia tawm tsis muaj nqis. Ntau qhov kev qhia koj tau tsim cov ntaub ntawv kho vajtse.conf tab sis LIRC tsis xav tau lossis tsis xav tau thiab lirc-rpi module tau hloov pauv nrog gpio-ir module.

Cov ntawv qhia xav tias RPi tab tom ua haujlwm raspbian (version Buster Jun 2019). Tsis tas li kev paub ua haujlwm ntawm lub davhlau ya nyob twg, cov lus txib yooj yim los ntawm kev hais kom ua sai sai thiab kho cov ntawv cov ntawv yog xav tau.

NCO TSEG: Kev teeb tsa LIRC yuav ua tsis tiav yog tias ua haujlwm hauv paus thiab ua rau muaj kev ntshai "tsis tuaj yeem ntshuam lub npe RawConnection" yuam kev thaum khiav cov nab npawb nab npawb. Cov ntawv qhia no xav tias koj tau nkag rau hauv tus neeg siv (piv txwv li: PI)

Lub Hom Phiaj: Txhawm rau pab IR tswj chaw taws teeb ntawm RPi cov haujlwm

1) Teeb LIRC ntawm RPi [Ntu 1]

2) Qhia tawm LIRC siv nab hab sej [Ntu 2]

Khoom siv

--- Raspberry Pi (3, 4, xoom)

--- Dupont xaim (poj niam-poj niam)

--- VS 1838b IR tus txais

Kauj Ruam 1: Sib dhos Kho Vajtse

Sib dhos kho vajtse
Sib dhos kho vajtse
Sib dhos kho vajtse
Sib dhos kho vajtse
Sib dhos kho vajtse
Sib dhos kho vajtse

Siv VS1838b IR tus txais tsis tuaj yeem yooj yim dua. Tsuas yog txuas tus ntsuas mus rau RPi ncaj qha nrog Dupont xaim (Poj niam-Poj niam). Koj kuj tseem tuaj yeem siv daim ntawv qhia zaub mov (tsis pom) lossis muab lo rau ntawm daim phiaj thaiv (duab)

Saib ntawm VS1838b IR Tus Tau Txais los ntawm sab xub ntiag (nrog X loj ntsib koj)

---- Sab laug sab tes tawm

---- Center ceg yog hauv av

Txoj cai ceg yog 3.3v

1) Txuas sab laug rau BCM tus pin 17 ntawm RPi (xaim daj)

2) Txuas nruab nrab ceg rau hauv av (xaim dub)

3) Txuas sab xis rau 3.3v (xaim liab)

Kauj ruam 2: Nruab Lirc

Nruab Lirc
Nruab Lirc

1) Qhib lub dav hlau qhov rai thiab teeb tsa LIRC. Yuav tsum ceeb toom tias qhov no yuav ua rau yuam kev "Ua tsis tiav los pib hloov pauv tau yooj yim IR cov chaw taws teeb nkag/tso tawm daim ntawv thov" raws li cov ntaub ntawv teeb tsa tam sim no muaj.dist txuas ntxiv thiab cov ntawv ntxiv yuav tsum raug tshem tawm raws li tau hais hauv qab no. Tsis nyuaj tab sis chim siab.

$ sudo apt-tau hloov tshiab

$ sudo apt-tau nruab lirc

---- Tsis txhob txhawj! raws li qhov no yuav tshwm sim qhov ua yuam kev "Ua tsis tiav pib hloov pauv tau yooj yim IR cov chaw taws teeb nkag/tso tawm daim ntawv thov" raws li.dist cov ntawv txuas ntxiv yuav tsum tau muab tshem tawm ntawm lirc_options.conf. Tsuas yog hloov npe cov ntaub ntawv raws li qhia.

$ sudo mv /etc/lirc/lirc_options.conf.dist /etc/lirc/lirc_options.conf

2) Rov txhim kho lirc tam sim no uas lirc_options.conf cov ntaub ntawv tau raug hloov pauv

$ sudo apt-tau nruab lirc

Kauj Ruam 3: Kho Lirc_options.conf

Kho kom raug Lirc_options.conf
Kho kom raug Lirc_options.conf

Kho kom raug /etc/lirc/lirc_options.conf raws li hauv qab no los ntawm kev hloov ob kab no:

:

:

tsav tsheb = default

ntaus ntawv = /dev /lirc0

:

:

Kauj Ruam 4: Ua kom txav mus rau tshem tawm.dist Suffix From Lircd.conf.dist

Ua kom txav mus rau tshem tawm.dist Cov Ntawv Ntxiv Los Ntawm Lircd.conf.dist
Ua kom txav mus rau tshem tawm.dist Cov Ntawv Ntxiv Los Ntawm Lircd.conf.dist

Tshem cov ntawv txuas ntxiv.dist los ntawm /etc/lirc/lircd.conf.dist

$ sudo mv /etc/lirc/lircd.conf.dist /etc/lirc/lircd.conf

Kauj ruam 5: Kho kom raug Config.txt

Kho kom raug Config.txt
Kho kom raug Config.txt

Kho /boot /config.txt los ntawm kev ntxiv ib kab hauv kab lirc-rpi module raws li hauv qab no. Qhov piv txwv no kwv yees RPi yog 'mloog' ntawm BCM Pin 17 rau IR tus txais tab sis ib qho RPi IO tus pin tuaj yeem siv tau. Kuv tseem tsis tau sim nws tab sis yog tias koj xav xa cov lus txib los ntawm RPi tom qab ntawd ntxiv thiab tsis pom zoo kab 4 pom hauv qab no kom xa IR cov lus txib ntawm BCM tus pin 18

:

:

:

# Tsis pom zoo qhov no txhawm rau ua kom lirc-rpi module

#dtoverlay = lirc-rpi

dtoverlay = gpio-ir, gpio_pin = 17

#dtoverlay = gpio-ir-tx, gpio_pin = 18

:

:

:

Kauj Ruam 6: Txheeb Cov xwm txheej thiab rov pib dua

Txheeb xyuas xwm txheej thiab rov pib dua
Txheeb xyuas xwm txheej thiab rov pib dua

1) Nres, pib thiab txheeb xyuas qhov xwm txheej ntawm lub lircd kom ntseeg tau tias tsis muaj qhov yuam kev!

$ sudo systemctl nres lircd.service

$ sudo systemctl pib lircd.service

$ sudo systemctl xwm txheej lircd.service

2) Rov pib dua

$ sudo rov pib dua

Kauj Ruam 7: Xeem Chaw Taws Teeb

Xeem Chaw Taws Teeb
Xeem Chaw Taws Teeb

Cov kauj ruam no xav tias koj muaj IR tus txais xov tooj txuas rau koj RPi ntawm tus pin tshwj xeeb hauv config.txt.

1) nres LIRCD cov kev pabcuam thiab sim cov chaw taws teeb siv hom 2 hais kom ua

$ sudo systemctl nres lircd.service

$ sudo mode2 -d /dev /lirc0

3) Taw tes rau cov chaw taws teeb ntawm tus txais thiab nias qee lub khawm. Koj yuav tsum pom qee yam LIKE qhov no:

:

:

qhov chaw

mem tes

:

:

4) Nias Ctrl-C kom tawm mus

5) Koj tus neeg txais IR tau teeb tsa thiab npaj txhij mus rau ntu 2 thiab nkag mus rau hauv nab hab sej.

Pom zoo: