Cov txheej txheem:

Tham nrog Santa Blowmold: 5 Kauj Ruam
Tham nrog Santa Blowmold: 5 Kauj Ruam

Video: Tham nrog Santa Blowmold: 5 Kauj Ruam

Video: Tham nrog Santa Blowmold: 5 Kauj Ruam
Video: Sib Hawm Dhau (Time Passed) Music Video by: Deeda/Dib Xwb 2024, Kaum ib hlis
Anonim
Tham nrog Santa Blowmold
Tham nrog Santa Blowmold
Tham nrog Santa Blowmold
Tham nrog Santa Blowmold

Txoj haujlwm no piav qhia yuav ua li cas kho kom zoo nkauj uas ua suab nrov thaum ib tus neeg taug kev los. Qhov no tuaj yeem ua tiav tau yooj yim nrog lub khoos phis tawj uas tuaj yeem ua haujlwm Motion program thiab lub koob yees duab ntawm qee yam. Hauv qhov no kuv tau siv 20 siab Santa Claus lub tshuab cua tshuab. Kuv teeb kuv Raspeberry PI nrog lub koob yees duab nyob hauv kuv lub qhov rais tso tsheb thiab taw qhia nws mus rau Santa blowmold. ntsuas rau kev siv sab nraum zoov los ntawm PI rau tus neeg hais lus no. Kuv teeb tsa Motion program ntawm Pi kom ua si Santa sounding Ho Ho Ho suab cov ntaub ntawv thaum twg nws pom cov lus tsa suab siv lub koob yees duab. Nws yooj yim zoo ua thiab nws lom zem.

Txhawm rau yuav cov khoom tshwj xeeb uas kuv siv ntawm no yuav raug nqi txog $ 100 nrog kev xa khoom. Kuv yuav tsis siv qhov kev ua no yog tias kuv tsis tau muaj tag nrho cov khoom siv dag ib puag ncig tsis siv. Qhov no tuaj yeem ua haujlwm nrog txhua lub khoos phis tawj, lub koob yees duab, thiab txhua tus hais lus yog li nws tuaj yeem ua tiav qhov pheej yig dua yog tias xav tau yuav cov khoom no.

Khoom siv

  • Lub khoos phis tawj nrog Motion program tau teeb tsa

    Kuv siv Raspberry PI (RPI) 3 Qauv B

  • Khoos phis tawj txuas lub Koob Yees Duab lossis Lub Koob Yees Duab Network

    • Txhua lub koob yees duab uas Motion program tuaj yeem siv
    • USB Lub Koob Yees Duab
    • Lub Koob Yees Duab Network
    • Kuv siv Lub Koob Yees Duab Module uas txuas ncaj qha rau RPI
  • Tus hais lus sab nraum zoov

    • Txuas ntawm aux chaw nres nkoj
    • USB
    • Kuv tau siv Sony SRS-XB01 no
  • Kev kho kom zoo nkauj xws li tshuab ntxhua khaub ncaws, txhua yam tiag

    Kuv siv Santa Claus tshuab cua tshuab zoo ib yam li qhov no

Kauj Ruam 1: Teeb Koj Li RPI

Teeb koj li RPI
Teeb koj li RPI

Cov theem no nyob ntawm no feem ntau rau cov pib ua tiav. Cov vis dis aus no piav qhia yuav teeb tsa Raspberry PI (RPI) zoo dua li kuv tuaj yeem ua tau. Kuv kuj tseem yuav pom zoo, zoo li hauv daim vis dis aus, txuas nrog Wireless USB, keyboard + nas, thiab saib sab nraud rau teeb tsa. Thaum teeb tsa kuv khiav kuv lub nkas -las tsis muaj keyboard + nas thiab saib sab nraud, tab sis kuv tawm hauv WIFi dongle yog li kuv tuaj yeem ssh rau hauv nws thiab rov pib dua thiab/lossis hloov pauv.

Kauj Ruam 2: Txuas Lub Koob Yees Duab rau RPI

Txuas lub Koob Yees Duab rau RPI
Txuas lub Koob Yees Duab rau RPI

Ua raws cov lus qhia txhawm rau teeb tsa koj lub koob yees duab rau koj RPI. Kuv siv Lub Koob Yees Duab module los ntawm Adafruit Industries.

  • Plug thiab ruaj ntseg kab xov txuas los ntawm Lub Koob Yees Duab module mus rau hauv lub koob yees duab chaw nres nkoj ntawm Ethernet chaw nres nkoj thiab HDMI chaw nres nkoj nrog cov lus sib tham tig mus rau qhov chaw nres nkoj HDMI thiab kab xev xiav tig mus rau Ethernet chaw nres nkoj.
  • Yog tias koj muaj lub ntsuas saib thiab tab tom ua haujlwm UI (Xserver) khiav Raspberry Pi Configuration tool

    Yog tias SSH nyob deb rau hauv rpi los ntawm lwm lub khoos phis tawj, khiav rasp -teeb tsa hauv koj lub davhlau ya nyob twg - uas yuav pib lub davhlau ya nyob twg UI

  • Hauv Raspberry Config, hauv qab Interfaces tab, qhib lub Koob Yees Duab.
  • Txuag thiab rov pib dua RPI.
  • Thaum rov pib dua khiav cov lus txib hauv qab no hauv lub davhlau ya nyob twg, ob qho pom thiab ua haujlwm yuav tsum rov zoo li = 1

vgencmode get_camera

Koj lub koob yees duab PI yuav tsum ua haujlwm tam sim no

Cov Lus Qhia Hauv Online

Kauj Ruam 3: Teeb thiab Xeem Suab

Teeb thiab Xeem Suab
Teeb thiab Xeem Suab

Thaum pib rau txoj haujlwm no kuv yooj yim siv txoj hlua txuas los ntawm PI mus rau lub roj teeb me me uas hais lus. Qhov ntawd tau tshwm sim kom muaj ntau yam zoo li qub thiab cov roj teeb tau ntws sai. Hloov chaw kuv txuas rau hauv USB lub cuab yeej uas ua rau lub suab nrov dua thiab kuv tau khiav lub xov tooj cua los ntawm qhov chaw nres nkoj aux tso tawm rau nws mus rau lub zog hais lus sab nraum zoov tsis muaj huab cua. Qhov no tshem tawm qhov zoo li qub thiab nrov dua thiab tsis muaj roj teeb rau txhawj txog. Cov cuab yeej USB tau lees paub los ntawm kuv RPI yam tsis muaj tus tsav tsheb teeb tsa xav tau.

PI OS los nrog ib qhov program hu ua aplay, tab sis kuv nyiam Sox software faib cov program ua si, yog li cov lus qhia no teeb tsa Sox thiab siv nws ua si hais kom ua.

Nruab Sox

Hauv lub davhlau ya nyob twg ntawm RPI khiav cov lus hauv qab no teb yog rau ib qho kev tshoov siab

sudo apt-tau nruab sox

Kuaj Suab

Rub tawm cov suab ua tau zoo ntawm qhov me me thiab txuag nws hauv koj lub computer. Kuv siv santaho3.mp3 khaws cia rau hauv kuv phau ntawv teev npe pi. Txhawm rau ntsuas lub suab txuas koj tus neeg hais lus rau RPI thiab khiav cov lus txib no:

ua si santaho3.mp3

  • Yog tias koj hnov lub suab ua si hauv koj tus hais lus, ces koj lub suab ua haujlwm
  • Tej zaum koj yuav tau hloov sab hauv lub suab los ntawm HDMI mus rau Analog.

    Cov lus qhia ntawm no

  • Yog tias siv lub suab USB, tsim cov ntawv hauv koj phau ntawv npe tsev.asoundrc

    • Muab cov ntsiab lus hauv qab no hauv nws thiab rov pib dua, pib ntsuas suab
    • pwm! default {

      hom hw daim npav 1} ctl.! default {hom hw card 1}

Kauj Ruam 4: Teeb tsa Kev Tshawb Fawb kom Ua Si Cov Ntaub Ntawv

Teeb tsa Kev Tshawb Fawb kom Ua Si Cov Ntaub Ntawv
Teeb tsa Kev Tshawb Fawb kom Ua Si Cov Ntaub Ntawv

Software hu ua Motion tso cai rau ib lossis ntau lub koob yees duab los teeb tsa rau lub hom phiaj ntawm kev ua haujlwm thaum lub suab pom hauv lub koob yees duab saib (s). Nws yooj yim rau teeb thiab ua haujlwm zoo nkauj. Nws kuj tseem tuaj yeem sau cov ntaub ntawv thaum tshawb pom cov lus taw qhia, tso cai teeb tsa lub vev xaib rau txhua lub koob yees duab lossis ib lub vev xaib rau txhua lub koob yees duab, thiab tso cov servers los saib cov kwj ntawm lub koob yees duab. Txoj haujlwm no tsuas xav tau kev txheeb xyuas thiab hais kom ua lub peev xwm, tab sis kuv tau teeb tsa lub server streaming kom tuaj yeem saib cov kwj tawm ib yam nkaus.

Nruab Tsab ntawv tsa suab

Hauv lub davhlau ya nyob twg ntawm RPI, khiav cov lus txib hauv qab no teb yog rau ib qho lus qhia, tos kom nws ua tiav

sudo apt-tau nruab tsab ntawv tsa suab

Siv sijhawm tam sim no txhawm rau ntxiv cov neeg siv suab tshiab ntxiv rau pab pawg suab kom nws muaj kev tso cai ua suab los ntawm kev nkag mus rau cov lus txib hauv qab no

usermod -a -G suab suab

Configure Tsab ntawv tsa suab kom paub

Peb yuav hloov kho cov ntawv teeb tsa suab los ua cov ntaub ntawv suab peb rub tawm hauv Teeb Suab theem thaum nws pom cov lus tsa suab ntawm lub koob yees duab thiab pib tsa suab ua qhov kev pabcuam yog li nws txuas ntxiv ua li ntawd thaum rov pib dua RPI.

Hauv lub davhlau ya nyob twg hloov kho /etc/motion/motion.conf cov ntaub ntawv raws li tus neeg siv super

sudo nano/etc/default/tsab ntawv tsa suab

Hauv lub davhlau ya nyob twg hloov kho /etc/motion/motion.conf cov ntaub ntawv raws li tus neeg siv super

sudo nano /etc/motion/motion.conf

Ua thiab txuag cov kev hloov kho hauv qab no. Ntau ntawm cov no yog qhov tsis raug. Kuv tsis xav tias hauv kuv cov ntaub ntawv mmal_xxx nkag tau muaj txiaj ntsig, tab sis kuv tso lawv tseg yog tias ib tus neeg xav tau lawv - lawv kuj tsis ua mob. Qhov kev teeb tsa no pom lub suab ntawm lub koob yees duab hauv 40 ntu thib ob, tsis kaw cov duab lossis video, thiab teeb tsa lub web server thiab streaming server rau lub koob yees duab tiv thaiv nrog kev lees paub yooj yim siv lub npe siv thiab tus lej nkag.

daemon yog

process_id_file /var/run/motion/motion.pid

setup_mode tawm logfile /var/log/motion/motion.log log_level 6 log_type txhua daim vis dis aus/dev/video0 v4l2_palette 17 input -1 norm 0 zaus 0 power_line_frequency -1 tig 0 flip_axis tsis muaj qhov dav 320 siab 240 framerate 2 yam tsawg kawg_frame_time 0 netcam_keepalive offcheck rtsp_uses_tcp ntawm mmalcam_name vc.ril.camera auto_brightness tawm qhov ci 0 qhov sib txawv 0 saturation 0 hue 0 roundrobin_frames 1 roundrobin_skip 1 switchfilter off threshold 500 threshold_tune off noise_level 22 noise_tune on despeckle_filter 0ed_mat_make_make_make output_pictures off output_debug_pictures off quality 75 picture_type jpeg ffmpeg_output_movies off ffmpeg_output_debug_movies off ffmpeg_bps 400000 ffmpeg_variable_bitrate 0 ffmpeg_video_codec timeless timeline_valete apshot_interval 0 locate_motion_mode off locate_motion_style box text_right%Y-%m-%d / n%T-%q text_changes off text_event%Y%m%d%H%M%S text_double off target_dir/var/lib/motion snapshot_filename%v- %Y%m%d%H%M%S-snapshot picture_filename%v-%Y%m%d%H%M%S-%q movie_filename%v-%Y%m%d%H%M%S timelapse_filename % Y% m% d-Timelapse ipv6_enabled tawm stream_port 8481 stream_quality 80 stream_motion tawm stream_maxrate 1 stream_localhost tawm stream_limit 0 stream_auth_method 1 stream_authentication: webcontrol_port 8480 webcontrol_localhost tawm webcontrol_html_output rau webcontrol_authentication: track_type 0 track_auto tawm track_iomojo_id 0 track_step_angle_x 10 track_step_angle_y 10 track_move_wait 10 track_speed 255 track_stepsize 40 ntsiag to on_event_start/usr/bin/play -q --multi -threaded/var/lib/motion/notify`shuf -i 1-5 -n 1`.mp3 2>/dev/null

Luam cov ntaub ntawv audio rau cov ntaub ntawv suab mus rau cov lus qhia hauv tsev thiab hloov kev tso cai ntawm nws yog li tsab ntawv muaj nws tab sis txhua tus tuaj yeem nyeem nws

sudo cp /home/pi/santaho.mp3 /var/lib/motion/mtn_dtct_ntfy.mp3

sudo chown tsab ntawv tsa suab /var/lib/motion/mtn_dtct_ntfy.mp3

sudo chmod a+r /var/lib/motion/mtn_dtct_ntfy.mp3

Reboot lub cuab yeej RPI. Thaum khau raj, khiav

sudo systemctl xwm txheej motion.service

Cov zis yuav tsum suav nrog kab uas hais tias:

Active: nquag (khiav) txij li

Yog tias koj pom cov lus tsa suab no khiav. Yog tias tsis txheeb xyuas/var/log/tsab ntawv tsa suab kom paub meej. Sim khiav:

sudo systemctl pib motion.service

Xeem Tsab Ntawv Pom Kev Pom Zoo thiab Ua Si Suab

Yuav luag tiav. Tsuas yog yuav tsum tau txheeb xyuas yog tias cov lus tsa suab tau pom thiab lub suab ua si thaum nws yog.

Hauv lub davhlau ya nyob twg ua cov hauv qab no los saib cov ntawv txuas ntxiv rau cov ntaub ntawv teev npe

tw -f/var/log/motion

Tam sim no:

  • Yoj ib yam dab tsi pem lub taub hau lub koob yees duab maj mam
  • Cov ntaub ntawv teev cia yuav tsum tso tawm cov lus tsa suab tau pom
  • Vam tias cov ntaub ntawv suab ua los ntawm tus hais lus
  • Yog li tso RIP rau hauv lub qhov rais nrog lub koob yees duab lub ntsej muag tig mus rau qhov twg lub suab kom pom
  • Muab tus neeg hais lus sab nrauv tso rau lossis ze rau qhov kho kom zoo nkauj
  • Thaum tib neeg taug kev los lawv yuav tau txais tos

Teeb meem

Yog tias tej yam tsis ua haujlwm

  • Txheeb ob zaug lub koob yees duab ua haujlwm los ntawm kev ua:

    • raspistill -o test.jpg
    • ls -l test-j.webp" />
  • Txheeb ob zaug lub suab ua haujlwm los ntawm kev ua tiav

    • ua si/var/lib/suab/mtn_dtct_ntfy.mp3
    • yog tias tsis hnov lub suab ntawv

      • txheeb xyuas tias lub cuab yeej tso tawm yog koj lub teeb hais lus (analog lossis USB)
      • xyuas qhov ntim
      • kos qhov kev tso cai ntawm cov ntaub ntawv suab muaj 3 'r's hauv txoj cai tso cai (piv txwv li rw*rw*rw*)
  • Yog tias txhua yam ua tsis tiav ces tej zaum cov lus tsa suab tsis teeb tsa kom raug

    yog tias qhov no yog qee qhov kev tshawb fawb hauv online yuav tsum pab raws li muaj kev pab ntau nyob rau ntawd

Kauj Ruam 5: Cov Lus Qhia Ntxiv

Lus Qhia Ntxiv
Lus Qhia Ntxiv

Ua si Random Suab Cov Ntaub Ntawv

Tau dhuav nrog tib lub suab ua si dhau los, sib xyaw nws!

  • Txuag tau ob peb lub suab sib txawv uas muaj tib lub npe tab sis cov lej txuas ntxiv nrog:

    soundFile1.mp3, soundFile2.mp3, soundFile3.mp3, soundFile4.mp3, soundFile5.mp3,

  • Hloov qhov /etc/motion/motion.conf on_event_start nkag raws li hauv qab no

    on_event_start play -q --multi -threaded soundFile`shuf -i 1-5 -n 1`.mp3 2>/dev/null

  • Tawm thiab txuag cov ntaub ntawv
  • Rov qab qhib qhov kev pabcuam

    sudo systemctl rov pib dua motion.service

  • Qhov 'shuf -i 1-5 -n 1' (cov ntawd yog cov zuam rov qab) ib feem ntxig tus lej ntawm 1 txog 5 ito lub npe cov ntaub ntawv raug ua si
  • Yog li tam sim no thaum cov lus tsa suab pom ib qho ntawm 5 lub suab ntaub ntawv yuav ua si

Hais lus tsis txhob Ua Si

Lwm qhov kev lom zem twist yog teeb tsa Text-to-Speech thiab kom lub khoos phis tawj hais lus kab lus rau cov neeg hla dhau. Kuv nyiam siv MaryTTS ua lub cav. Teeb thiab pib Mary TTS server thiab hloov kab on_event_start tau hais los saum no txhawm rau xa qee yam los hais rau kev sib yuav tts server (piv txwv li marytts/bin/marytts-xa-ntawv "Nyob zoo phooj ywg")

Siv IP Networked Koob Yees Duab (Wireless lossis lwm yam)

Cov phiaj xwm phiaj xwm tuaj yeem yooj yim txhawb nqa IP lub koob yees duab network siv netcam_url thiab lwm yam ntau yam netcam_xxx teeb tsa. Kev tshawb fawb online yooj yim yuav tsum muab yam uas xav tau.

Bluetooth

Yog tias koj RPI muaj Bluetooth ua-hauv lossis koj tau teeb tsa USB Bluetooth ntaus ntawv ces koj tuaj yeem txuas tus hais lus ntawm Bluetooth thiab tshem tawm cov xaim.

Txwv tsis pub txav mus los rau thaj tsam me dua

Ib qho teeb meem uas kuv muaj nrog kev teeb tsa no yog tshuab cov ntoo thiab tsob ntoo nrog rau lub tsheb teeb txhua qhov ua rau cov lus yooj yim heev. Cov phiaj xwm phiaj xwm muaj teeb tsa rau pes tsawg tus thav duab uas yuav tsum tau hloov ua ntej cov lus tsa suab tau tshwm sim thiab suav txog cov suab nrov thiab siv cov kev pab no. Kuv tseem tsis tau sim dua, tab sis kuv xav tias kuv yuav xav tau chaw teeb tsa uas tseem tso cai rau thaj chaw tshwj xeeb ntawm lub koob yees duab saib kom tau txais kev txhais rau lub suab nrhiav. Qhov no yuav tsum tso cai txhawm rau txheeb xyuas thaj chaw ib puag ncig ze ntawm qhov kho kom zoo nkauj txhawm rau ua kom lub suab ua suab nrov.

Pom zoo: