라즈베리파이로 CCTV 만들기

in #kr5 years ago

아기가 잘 자고 있는지 확인하기 위해
집에서 놀고 있는 라즈베리파이 + 라즈베리파이 카메라 모듈로
CCTV 기능을 환경을 구성했어요

크게 3단계로 나누면
구성할 때 환경을 갖추고,
필요한 프로그램을 설치하고,
외부에서도 접근 가능하게 공유기 설정을 하였습니다.

환경 구성 - 라즈베리파이 설치

카메라 구동 (raspbian GUI)

  • 카메라 설치
    시작메뉴 > 설정 > Raspberry Pi Configuration > Interface 탭에서 > Camera > Enable
    스크린샷 2019-03-31 오후 11.37.16.png
  • mjpg 설치 실행
    # 라즈베리 파이에 깃 설치
    sudo apt-get install git
    git clone https://github.com/jacksonliam/mjpg-streamer.git
    # 구동에 필요한 프로그램 설치
    sudo apt-get install cmake python-imaging libjpeg-dev build-essential
    # 빌드
    cd mjpg-streamer/mjpg-streamer-experimental/
    make CMAKE_BUILD_TYPE=Debug
    sudo make install
    # mjpg streamer실행
    mjpg_streamer -i "input_raspicam.so -vf -hf" -o "output_http.so -p 8090 -w /usr/local/share/mjpg-streamer/www/"
    localhost:8090으로 접속하면 mjpg-streamer admin화면이 나옵니다
    스크린샷 2019-03-31 오후 11.57.07.png

공유기 환경 설정

로컬에선 잘 동작하는데 외부에서 접근이 필요했습니다.
인터넷은 sk브로드밴드를 사용하고 있고 iptime을 추가 설치해서
ddns로 외부에서 접근을 하려고 했는데.. 실패했습니다.
집으로 들어오는 선 > 공유기1 > 공유기2(iptv)
이렇게 인터넷 공유기 구성이 되어있는 걸 확인하였고,
인터넷을 검색해보니 공유기1에 iptime을 연결하고
네트워크 > WAN의 서비스 모드를 NAT에서 브릿지로 바꿔주는 답을 찾았습니다.
DDNS, SKB 설정은 블로그를 참고하시는게 빠를 것 같아서.. 아래를 참고하세요!
멋진 블로그 작성자님들 감사합니다!!
https://comterman.tistory.com/1408 (skb)
https://trip98.tistory.com/139 (ddns)

설치하고 잘 연결된 컷입니다! 휴..
스크린샷 2019-04-01 오전 12.05.27.png

아직 부족한점이 많아 좀 더 다듬을 예정입니다~ 긴글 읽어주셔서 감사합니다~

Sort:  

아기가 잘 자고 있어요~ ㅎㅎ
저도 집에 굴러다니는 스마트폰으로 CCTV 하나 만들어 보고싶네요. ㅋ

대박이네요. 스마트폰에 설치만 하면 바로 CCTV로 쓸수 있네요. 알려주셔서 감사합니다.😀

능력자시니 한번 도전해 보세요 ~

Congratulations @babysloth! You have completed the following achievement on the Steem blockchain and have been rewarded with new badge(s) :

You made more than 4000 upvotes. Your next target is to reach 5000 upvotes.

You can view your badges on your Steem Board and compare to others on the Steem Ranking
If you no longer want to receive notifications, reply to this comment with the word STOP

Vote for @Steemitboard as a witness to get one more award and increased upvotes!

Congratulations @babysloth! You received a personal award!

Happy Birthday! - You are on the Steem blockchain for 2 years!

You can view your badges on your Steem Board and compare to others on the Steem Ranking

Vote for @Steemitboard as a witness to get one more award and increased upvotes!

Coin Marketplace

STEEM 0.29
TRX 0.12
JST 0.032
BTC 63156.26
ETH 3071.73
USDT 1.00
SBD 3.86