ViaMyBox is a raspberry pi project. It combines several functional ideas and the possibility of simplified management of this functionality. Functional management is carried out through the console script via-setup.sh, through the Home Assistant console as well as a mini-web interface. In the ViaMyBox project, I combined some ideas found on the Internet that seem interesting to me and the opportunity quick setup and management. The main functionality at the moment is video recording, a smart home based on the Home Assistant, Kodi Home Theater, Wordpress LNMP Server. Modules Home Assistant, MotionEye are optional; install via via-setup.sh utility. The LNMP server is optionally installed separately (see /home/pi/viamybox/scripts/lnmp/README).
ViaMyBox distribution is assembled and tested based on 2019-09-26-raspbian-buster.The functionality provided by ViaMyBox is:
- video recording with synchronization of sound from a usb camera using gstreamer technology
- audio recording from usb camera via gstreamer technology
- timelapse video recording from usb or csi camera using ffmpeg
- photo registration via mjpg-streamer
- photo recording by hc-sr501 motion sensor
- creation of a video file after photo registration
- the ability to record audio and video on yandex disk
Smart house - Home Assistant based on docker image https://github.com/home-assistant/hassio-installer:
- management via the console utility via-setup.sh docker containers of Home Assistant installation and removal of the image. Stop and start the Home Assiatnt containers
- control via the web console Home Assistant of the above video registration functions
- some raspberry pi control functions. CPU temperature control, micro sd volume, power supply status
Kodi Home Theater
Kiosk mode Full-screen browser window with your favorite media sites. We included about 2 dozen sites to quickly manage the kiosk from Youtube, Facebook, Instagram and Twitter to Spotify, Amazon, Google music.
Radio quickly manage and install Mopidy TuneIn radio and Bellerofonte radio from Home Assistant and console shell via via-setup.sh.
Cast youtube with gotubecast and mps-youtube. Quickly manage and install from console shell.
MotionEye web management based on the docker image https://hub.docker.com/r/ccrisan/motioneye:
- web-based interface MotionEye
- management through the console utility via-setup.sh docker container installation and removal of the docker image and containers. Stop and start docker container.
- management of video recording functions
Console utility via-setup.sh: managing this project stuff.
- management of video recording functions
- managing docker images Home Assistant and MotionEye
- inadyn service management
- management of connection to a remote yandex disk based on webdav
Python client for sensors and IOT devices:
The ability to connect temperature-humidity sensor DHT11, motion sensor HC-SR501, relays (KY019,2PH63891A,2PH63083A,8RELAYBRD-5V) and similar to the Raspberry Pi and their remote control via Home Assistant or other mqtt broker. This is a python script that works as a Mosquito client. It is possible to connect it as a service. On the receiving side of Home Assistant mosquito broker. The relay has a "confirmed activation" mode, that is, the status of the relay operation is checked. After installing or cloning the project, change the mqtt and sensor settings in the configuration file:
Initialize the service:
cp ~/viamybox/conffiles/iot/<name>.service /lib/systemd/system/ sudo systemctl enable <name>.service
Start service or python script:
sudo systemctl start <name service> python ~/viamybox/scripts/iot/<name>.py
On the Home Assistant side the sensor settings in the configuration.yaml for example:
Change your password! Use the viamybox recording features ONLY on secure networks!
ViaMyBox site: https://viamybox.com
The project uses and install nginx, mjpg-streamer, gstreamer, docker, kodi and related packages through script ~/viamybox/scripts/prepostinstall/00install.sh The packages in this script are divided into sections. Browse and exclude sections of packages that are not required by you functionality.
Mjpg-streamer will be installed with the script ~/viamybox/scripts/prepostinstall/01aftercopy.sh The ViaMyBox project uses the mjpg-streamer of the jacksonliam project https://github.com/jacksonliam/mjpg-streamer If you use another mjpg-streamer, exclude the section # mjpg-streamer from the 01aftercopy.sh file
If you are using apache web server or nginx, look in the #nginx section in the file. ViaMyBox uses a web server at the address /home/pi/viamybox/www on port 80 If the port 80 for the web server is allocated, change the port in the file /home/pi/viamybox/conffiles/viamybox.local before installation.
Installation project ViaMyBox
the project should be in the folder /home/pi:
cd /home/pi git clone https://github.com/viatc/viamybox.git
cd /home/pi unzip viamybox-master.zip -d /home/pi/ mv -r viamybox-master viamybox
make the scripts executable:
cd viamybox/scripts/prepostinstall/ chmod +x ./*.sh
installation of the necessary packages:
setting up the ViaMyBox project:
Installing the LNMP server (optionally)
LNMP server, server for Wordpress site. Includes MySQL, Nginx, PHP + Wordpress shell. Running installation scripts will allow you to start initializing the Wordpress site on raspberry pi in a few minutes. If you want to install only the LNMP server. You can do this by installing scripts in the lnmp folder
cd /home/pi/viamybox/scripts/lnmp/ chmod +x ./*.sh
and run 2 scripts in turn:
sudo ./00install.sh sudo ./01via-setup-lamp.sh
Deployment removal and management of docker containers of Home Assistant is carried out through 1 menu item:
Next, connect to the Home Assistant http://:8123 and install the database: Hass.io Tab -> Snapshots The following project is used as a source: https://github.com/home-assistant/hassio-installer For web access and access to the Home Assistant default user: pi default password: raspberry
Deployment removal and management docker containers of MotionEye is done through 2 menu items:
Next, connect to the MotionEye console http://:8133 To access the MotionEye container: user: admin without password
Video and audio recording takes place content in the folder: /home/pi/camera
If yandex disk is connected: /home/pi/camera/yandex.disk
You can use WinSCP to dowload your media in Windows.
Bellerofonte Radiobox https://github.com/bellerofonte/radiobox
Gstreamer video audio registration https://gstreamer.freedesktop.org/
Gotubecast Youtube media access service https://github.com/CBiX/gotubecast
Kodi Home theatre https://kodi.tv/
MotionEye docker image: https://hub.docker.com/r/ccrisan/motioneye
Mopidy TuneIn: https://github.com/kingosticks/mopidy-tunein
Mps-youtube - youtube, last.fm playing and searching media engine https://github.com/mps-youtube/mps-youtube
Home Assistant based on docker image https://github.com/home-assistant/hassio-installer
Raspberry Pi Power Supply Checker https://github.com/custom-components/sensor.rpi_power
© 2021 ViaMyBox Technological Studio
© 2021 GitHub, Inc.