Cov txheej txheem:

Raspberry Pi: Phab Ntsa Mounted Calendar thiab Chaw Qhia Ntawv: 5 Kauj Ruam (nrog Duab)
Raspberry Pi: Phab Ntsa Mounted Calendar thiab Chaw Qhia Ntawv: 5 Kauj Ruam (nrog Duab)

Video: Raspberry Pi: Phab Ntsa Mounted Calendar thiab Chaw Qhia Ntawv: 5 Kauj Ruam (nrog Duab)

Video: Raspberry Pi: Phab Ntsa Mounted Calendar thiab Chaw Qhia Ntawv: 5 Kauj Ruam (nrog Duab)
Video: Saib Mis paub Poj niam (hluas nkauj) tus yam ntxwv lub siab 2024, Hlis ntuj nqeg
Anonim
Raspberry Pi: Phab Ntsa Mounted Calendar thiab Chaw Ceeb Toom
Raspberry Pi: Phab Ntsa Mounted Calendar thiab Chaw Ceeb Toom

Ua ntej "hnub nyoog digital" ntau tsev neeg tau siv daim ntawv qhia hnub ntsa los qhia qhov pom txhua hli ntawm cov xwm txheej yuav los tom ntej. Cov ntawv niaj hnub no ntawm phab ntsa teeb daim ntawv qhia hnub suav nrog cov haujlwm yooj yim ib yam:

  • Cov txheej txheem txhua hli
  • Sync ntawm tsev neeg cov dej num
  • Xauj yooj yim ntawm lub hlis

Dhau ntawm cov haujlwm yooj yim no lub cuab yeej tseem yuav ua haujlwm:

  • Ib qho kwv yees
  • Cov xwm txheej yuav los tom ntej hauv ib puag ncig
  • Cov ntaub ntawv qhia txog kev thauj mus los rau pej xeem
  • Thiab ntau dua…

Koj xav tau dab tsi:

  • Raspberry Pi 2
  • USB Wifi Dongle. (Zoo li Edimax 150Mbps Wireless nano)
  • LCD lub vijtsam laptop (nqa ib qho los ntawm lub laptop tawg
  • Daim npav tswj hwm rau lub vijtsam laptop (tshawb nrhiav Ebay rau LCD Tus Thawj Tswj Tsav Tsheb thiab tus lej ntawm koj lub laptop screen)
  • Qee Qhov Khawm Hloov Hloov (Zoo li
  • Webserver khiav lub vev xaib raug cai
  • Ntoo ntoo. Qhov siab yuav tsum ntau dua 30 hli, yog li cov khoom siv hluav taws xob tuaj yeem haum sab hauv. Qhov dav thiab qhov siab nyob ntawm qhov loj ntawm koj lub laptop screen.
  • Ntawv ntawm cork. (Zoo li qhov no
  • Luv HDMI cable
  • Muaj zog ntxiv rau tswj hwm pawg tswj hwm thiab Raspberry Pi.
  • Foamcore
  • Kua nplaum
  • Ntsia ntsia hlau.

(Kev tshoov siab los ntawm kev qhia los ntawm Piney

Kauj ruam 1: Kho vajtse

Kho vajtse
Kho vajtse
Kho vajtse
Kho vajtse
Kho vajtse
Kho vajtse

Nov yog teeb tsa kho vajtse.

  1. Nrhiav lub laptop LCD screen. Hais kom lub rooj tswj hwm ntawm Ebay. Tshawb nrhiav LCD Tus Thawj Tswj Tsav Tsheb thiab tus lej ntawm koj lub laptop screen. Ntau ntxiv:
  2. Craft ib daim ntoo. Qhov siab yuav tsum ntau dua 30 hli, yog li cov khoom siv hluav taws xob tuaj yeem haum sab hauv. Qhov dav thiab qhov siab nyob ntawm qhov loj ntawm koj lub laptop screen, muaj cov npoo rau ntxiv 10 hli ntawm txhua sab. Txiav tawm thiab ua chaw rau cov khoom siv hluav taws xob nyob tom qab. Laum qhov rau cov nyees khawm thiab cov xov hlau.
  3. Kaw lub laptop screen. Kuv siv lub thav duab qub ntawm lub khoos phis tawj.
  4. Txiav tawm foamcore nrog tuab tuab raws li qhov screen. thiab muab lo rau ntawm daim ntoo.
  5. Npog txhua sab nrog cork. Txiav nrog "rab riam txiav tawm" thiab lo nrog "kua nplaum".
  6. Nias lub Push Button. Siv lub laum loj, thiab ua tib zoo siv tes.
  7. Txuas cov khoom siv hluav taws xob. Txuas peb ntawm Push Button rau GPIO-pins 19/20/21 thiab hauv av. https://ms-iot.github.io/content/images/PinMappin… Nrhiav tus pin rau On/Off khawm rau lub rooj tswj hwm, thiab txuas nws nrog khawm Plaub Plaub. (Koj yuav pom nws los ntawm kev sim txuas hauv av rau txhua tus pin, tam sim ntawd lub LCD yuav taws teeb). Thaum kawg, txuas HDMI cable ntawm Raspberry thiab lub rooj tswj hwm, thiab txuas lub vijtsam mus rau lub rooj tswj hwm.

Kauj ruam 2: Software

Kev teeb tsa yog ua cas tig Raspberry Pi rau hauv kiosk. OS yuav pib lub vev xaib nyob rau hauv hom puv npo, thiab Push Button tau siv los tswj cov ntaub ntawv ntawm lub vev xaib. Kev teeb tsa yog:

  1. Nruab Raspbain ntawm Raspberry Pi (https://www.raspberrypi.org/documentation/installation/noobs.md)
  2. Sau npe rau Google Calender. (https://calendar.google.com). Ntxiv koj qhov kev tshwm sim tuaj. Nug kom nkag mus rau koj tsev neeg daim ntawv qhia hnub, lossis tsim kom muaj qhov tshwj xeeb "tsev neeg daim ntawv qhia hnub nyoog" thiab muab cov neeg hauv tsev neeg so rau nws. Ua kom koj daim ntawv qhia hnub muaj zog dua los ntawm kev ntxiv daim qhia hnub hli sab nraud. Cov xwm txheej hauv Facebook, hnub so rau pej xeem, thiab tus lej rau lub lim tiam tau ua haujlwm rau kuv. Ntau qhov kev tshoov siab ntawm no:
  3. Teeb tsa lub vev xaib thiab lub vev xaib
  4. Nruab ib lub web browser thiab hloov kho daim ntawv qhia hnub
  5. Teeb tsa cov nyees khawm

Nyeem ntxiv kom paub meej txog 3-5.

Kauj Ruam 3: Tsim Webpage thiab Webserver

Lub vev xaib yog daim ntaub thaiv uas Raspberry Pi yuav tso tawm. Cov canvas tuaj yeem sau nrog cov ntaub ntawv. Kuv yuav qhia koj yuav ua li cas kuv thiaj li teeb tsa google callender. Txoj cai embeed yog tsim los ntawm googles tus kheej thov. Cov youtube no qhia yuav ua li cas kom nws ua haujlwm:

Google Calendar tau tsim hauv cov keyboard luv. Nias N thiab lub hlis tom ntej yuav tshwm sim, nias P thiab lub hli dhau los tau qhia. Qhov no yuav ua haujlwm tsuas yog thaum tus tsom mus rau. Kuv tau tsim JavaScript uas ua kom ntseeg tau tias ua kom raug.

Ib qho piv txwv ntawm cov ntaub ntawv html tau txuas (hloov lub npe los ntawm index.html.txt rau index.html). Txog kev ceev ntiag tug, Kuv tau hloov qee qhov ntawm cov cai nrog "*_ REPLACED _*". Hloov chaw, siv embeed code tsim los ntawm google.

Xwb muab cov ntawv index.html ntawm koj tus kheej lub vev xaib, lossis tig koj li Raspberry Pi rau hauv lub vev xaib thiab tuav nws hauv zos. Yog tias koj twb muaj lub vev xaib txuas ntxiv mus rau kauj ruam tom ntej. Nruab ib lub vev xaib los ntawm kev ua raws li phau ntawv qhia no:

sudo cp index.html /var/www/html/index.html

Kauj Ruam 4: Txhim Kho Lub Vev Xaib thiab Kho Tus Kheej Tsim

Muaj ntau lub web browser tawm muaj. Tab sis kuv tsuas pom ib qho uas tuaj yeem ua raws peb qhov kev xav tau no; 1) tuaj yeem ua tus txheej txheem niaj hnub ntawm google daim ntawv qhia hnub, 2) muaj hom puv npo, 3) tuaj yeem ua haujlwm hauv zos CSS. CSS hauv zos tau siv los hloov qhov tshwm sim ntawm google daim ntawv qhia hnub. Kev rov kho dua tsis tuaj yeem ua tiav ntawm lub vev xaib, vim tias CSS tau kos los ntawm lwm lub server (google-server).

Nruab Iceweasel (Firefox rau Linux)

Nruab qhov txuas ntxiv no rau Iceweasel:

Qhib "Stylish" txuas ntxiv tab hauv Iceweasel thiab hloov kho CSS kom ua rau google callander zoo dua. Se txuas cov ntaub ntawv kuv piv txwv.

Tam sim no, cia ua Iceweasel rau autostart thiab qhib koj lub vev xaib ntawm tus ID nkag mus. Ntaus qhov no hauv Linux davhlau ya nyob twg:

cd /home/pi//.config/autostart

nano cal.desktop

Sau cov hauv qab no rau hauv cov ntawv. Hloov "localhost" mus rau qhov chaw nyob qhov twg koj cov canvas-webpage tau khaws cia. Txuag thiab tawm.

[Desktop nkag]

Hom = Daim Ntawv Thov Npe = hemsida Exec = iceweasel localhost StartupNotify = cuav

Kauj Ruam 5: Teeb Tus Khawm Push

Cov Khawm Push yog siv los xaub rau pem hauv ntej thiab thim rov qab hauv daim ntawv qhia hli hli. Los ntawm lub neej ntawd qhov no ua tiav los ntawm nias "p" thiab "n" ntawm cov keyboard. Yog li cov nyees khawm yuav ua raws li ob lub keyboards cov lus txib.

Ua ntej tshaj, tsim ib tsab ntawv nab nab los ua kom lub pob nyem ua haujlwm:

Rub tawm thiab teeb tsa nab hab sej-uinput, tus nab nab API los tsim cov twj siv virtual: https://tjjr.fi/sw/python-uinput/ Raspbian tuaj nrog ob qho Python 2 thiab Python 3. Nco ntsoov tias koj nruab uinput nrog cov version koj siv.

Muab uinput-API thiab cov ntawv khawm ua ke. Tus nab nab nab zaum kawg yog txuas.

Pib-pib cov ntawv nab nab thaum pib: https://www.instructables.com/id/Raspberry-Pi-Laun… Peb lub launcher.sh yuav zoo li nqes hav. Hloov "/home/pi/py_switch" rau txoj hauv kev uas koj tau khaws cov ntawv nab nab.

cd / cov

cd /tsev /pi /py_switch sudo modprobe uinput sudo python switch.py cd /

Yog tag nrho!

Hloov tshiab:

Tus lej ntawm cov lus txib tuaj yeem txuas ntxiv nrog qee qhov yog-lwm-nqe lus hauv cov nab npawb sej. Kuv tau txuas qhov hloov pauv hloov pauv.py-file hauv cov kauj ruam no. Qhov tshiab yog tsab ntawv muaj cov lus txib hauv qab no.

  • Nias lub pob 1 -> Qhov tseem ceeb nias “P” -> Xauj lub hli dhau los
  • Nias lub pob 2 -> Ntsiab lus nias “N” -> Xauj lub hlis tom ntej
  • Nias lub pob 3 -> Qhov tseem ceeb nias "M" lossis "A" -> hloov pauv ntawm lub hli -saib lossis txheej txheem -saib
  • Nyem rau khawm ntev 3. -> Nyem rau "F5" -> Rov qab qhib lub vev xaib
  • Nyem ib txhij khawm 1, 2, 3 -> ua lub plhaub hais kom ua "sudo reboot" -> Rov pib dua ntawm raspberry pi.

Pom zoo: