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
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.
- 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
- 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).
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!)
- Armbian (external link)
- motion (external link)
- ffmpeg (external link)
- enhanced sender telegram bot (external link)
- several bash scrips: system report, archive cleanup, watchdog, on/off camera on trusted WiFi client, etc...
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
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 |
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 (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
.
- Download, burn, install Armbian according to installation guide for Armbian
- Build and install motion 4.2+ according to abbreviated building guide
- Install from repository
ImageMagick
:sudo apt-get install imagemagick
- Install from repository
libjson-c3
:sudo apt-get install libjson-c3
- Install from repository
usb-modeswitch
:sudo apt-get install usb-modeswitch
- Extract
ivc-kolpak
package from this repository into/etc/ivc-kolpak
- Create your own telegram bot using
@BotFather
bot according to the official guide. Getbot token
. - Create 3 channels (or groups): Photo, Video and System. Get
id
for each channel (or group) using@getidsbot
. - Add your new bot to the channels (or groups) as administrator.
- Configure ramdisk
- Add into file
/etc/fstab
following line:ramdisk /mnt/ramdisk tmpfs rw,size=256M 0 0
- Add into file
- Configure WiFi hotspot
- Use
armbian-config
utility to configure WiFi hotspot
- Use
- Configure ImageMagick
- In the file
/etc/ImageMagick-6/policy.xml
find linepolicy domain="path" rights="none" pattern="@*"/
and comment it like<!-- policy domain="path" rights="none" pattern="@*"/ -->
- In the file
- 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.
- Write
- 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 thatestgb
have permissions to execute.
- make symlinks for all scripts from
- DOES ANYBODY WANT TO CREATE INSTALLATION SCRIPT? :)
Telegram group @ivckolpak
is provided for info and questions