Skip to content

Latest commit

 

History

History
100 lines (100 loc) · 9.39 KB

README.md

File metadata and controls

100 lines (100 loc) · 9.39 KB

IVC KOLPAK - smart CCTV system powered with Telegram

WARNING! REPOSITORY IS UNDER CONSTRUTION

This is template article. More information about the system and source codes to build from the scratch will be soon. For any questions please ask in Telegram group @ivckolpak

Overview

IVC KOLPAK is DIY smart CCTV system that alerts to Telegram if motion is detected in the camera area. This gives feature to reduce human attention for CCTV system and provides Internet traffic economy. It comprises the principles of simplicity and convenience, and low cost of ownership. It's best for far objects with rare motion events where only available 3G/4G Internet connection.

Features

  • CCTV with motion detection and alerts to Telegram
  • Filtered content from CCTV. No need to revise recordings and archive - all information in the smartphone or PC
  • Text, photo and video (animations) with motion object into Telegram chat, group or channel available 24/7
  • WiFi hotspot service (used internal 3G/4G modem for Internet access)
  • Automatic enable/disable CCTV when trusted device connected to WiFi hospot
  • Periodical system reports about uptime, system life parameters, connected devices and other
  • 2 week (or more) archive on SD card for archive purposes
Technical features
  • Using motion 4.2+ feature movie_passtrough allows to convert from mpeg to h264 videos direct from camera's stream. In case of use h264-camera no recompression needed.
  • Ramdisk improves SD-card lifecycle
  • Photos can be send as originals or as media groups.
  • estgb can process escape sequences to insert emoji in the text.
  • telebot library linked dynamically with estgb. Multiple instances of estgb used less RAM.
  • Expremental use of cedrus264 codec for hardware accelerated video encoding (with legacy kernel only).

Why Telegram?

Using Telegram service providing following advantages, dramatically simplifies the device and reduces costs:

  • Cloud storage for photos and videos in the chats, groups or channels. All information from the device will be kept in the Telegram's cloud. No need to make your own infrastructure or use other paid service.
  • Access to Telegram from any device and platform even at the same time
  • Simply to share photo and videos from the camera
  • Telegram has an open API and protocol free for everyone (hey, Whatsapp and Viber!)

Software

Hardware

Hardware part consists of:

  • Orange Pi board
  • UVC USB camera (or any IPCam)
  • SD Card
  • High gain WiFi antenna
  • Power supply 5V/2A (or 12V/1A with DC-DC converter)
  • Box, cables, screws, nuts

Bill of materials

IVC KOLPAK Gen1 with USB UVC Camera
Pos # Component Q-ty Est. price Link to shop
1 Orange Pi Lite 1 US $12.00 AliExpress
2 SD card 32G 1 US $4.99 AliExpress
3 UVC USB Camera (OV2710 2MP 1080P HD) 1 US $20.00 AliExpress
4 WiFi antenna with pigtail 1 US $4.84 AliExpress
5 Power supply 5V/2A 1 US $1.61 AliExpress
6 Short USB Cable for 3G/4G modem 1 US $0.52 AliExpress
7 Screws and nuts 1 US $4.68 AliExpress
8 CPU and RAM heatsinks 1 US $1.76 AliExpress
9 3G/4G modem (any Huawei with HiLink firmware) 1 - Local shop
10 Junction box 1 - Local shop
IVC KOLPAK Gen2 with XM H264 IP Camera (not tested yet)
Pos # Component Q-ty Est. price Link to shop
1 Orange Pi Zero+ 1 US $14.90 AliExpress
2 SD card 32G 1 US $4.99 AliExpress
3 XM H264 IP Camera 1 US $18.47 AliExpress
4 WiFi antenna with pigtail 1 US $4.84 AliExpress
5 Power supply 5V/2A 1 US $1.61 AliExpress
6 Short USB Cable for 3G/4G modem 1 US $0.52 AliExpress
7 Screws and nuts 1 US $4.68 AliExpress
8 CPU and RAM heatsinks 1 US $1.76 AliExpress
9 3G/4G modem (any Huawei with HiLink firmware) 1 - Local shop
10 Junction box 1 - Local shop

Pre-installed images

Pre-installed images (Armbian, motion, ImageMagick, estgb, WiFi Hotspot and scripts) are available for Orange Pi Lite (with H3 CPU) both for mainline kernel (Debian9) and experimental image with legacy kernel (Ubuntu Xenial) for cedrus264 test purposes. Ask for pre-installed images in Telegram group @ivckolpak.

Building from the scratch

Step 1. Install OS and software
  1. Download, burn, install Armbian according to installation guide for Armbian
  2. Build and install motion 4.2+ according to abbreviated building guide
  3. Install from repository ImageMagick: sudo apt-get install imagemagick
  4. Install from repository libjson-c3: sudo apt-get install libjson-c3
  5. Install from repository usb-modeswitch: sudo apt-get install usb-modeswitch
  6. Extract ivc-kolpak package from this repository into /etc/ivc-kolpak
Step 2. Create Telegram bot
  1. Create your own telegram bot using @BotFather bot according to the official guide. Get bot token.
  2. Create 3 channels (or groups): Photo, Video and System. Get id for each channel (or group) using @getidsbot.
  3. Add your new bot to the channels (or groups) as administrator.
Step 3. Configuring system
  1. Configure ramdisk
    • Add into file /etc/fstab following line: ramdisk /mnt/ramdisk tmpfs rw,size=256M 0 0
  2. Configure WiFi hotspot
    • Use armbian-config utility to configure WiFi hotspot
  3. Configure ImageMagick
    • In the file /etc/ImageMagick-6/policy.xml find line policy domain="path" rights="none" pattern="@*"/ and comment it like <!-- policy domain="path" rights="none" pattern="@*"/ -->
  4. Configure telegram bot.
    • Write bot token of your bot into files .token in paths /etc/ivc-kolpak/channels/photo/, /etc/ivc-kolpak/channels/video/, /etc/ivc-kolpak/channels/system/
    • Write id for each channel (or group) into files .userid in the same way as bot token.
  5. Make symlinks
    • make symlinks for all scripts from /etc/ivc-kolpak/scripts/ to /usr/bin/. Be sure that all scripts have permissions to execute.
    • make symlinks from /etc/ivc-kolpak/motion/ to /usr/bin/.
    • make symlink for /etc/ivc-kolpak/bin/telebot.so.0.5.0 to /lib/
    • make symlink for /etc/ivc-kolpak/bin/estgb to /usr/bin/. Be sure that estgb have permissions to execute.
  6. DOES ANYBODY WANT TO CREATE INSTALLATION SCRIPT? :)

Support

Telegram group @ivckolpak is provided for info and questions