install
apt install qemu-kvm virt-manager
adduser <Username> libvirt
iso path
/var/lib/libvirt/images/
terminal usage
kvm -m 1G -drive file=system.img,cache=writeback
qemu-system-x86_64 -drive cache=writeback,file=system.img -m 1G
install
apt install qemu-kvm virt-manager
adduser <Username> libvirt
iso path
/var/lib/libvirt/images/
terminal usage
kvm -m 1G -drive file=system.img,cache=writeback
qemu-system-x86_64 -drive cache=writeback,file=system.img -m 1G
# install qrencode
apt install qrencode
# use qrencode with image
qrencode -o test.png 'test'
# use qrencode with ImageMagick
echo "test" | qrencode -s 10 -o -| display
# Text to qr to Browser image
echo "test" | qrencode -s 10 -o -| base64
iVBORw0KGgoAAAANSUhEUgAAASIAAAEiAQMAAABncE31AAAABlBMVEUAAAD///+l2Z/ TlP//8i138cAAAAJcEhZcwAACxIAAAsSAdLdfvwAAAEJSURBVGiB7dhBDoQgDIXhJh5gjuTVOZIH
MGGgQGlMJs7Ckszk70IFP1cvQoPkb0pQKBQK9RdKem05p9cpsh9jZkdFqzY4tuKL0if/AhWp UzqsTyUw1EKlf0fPCrVW6fR9jqgHld6aOntW7gUqUNmO3GO62bdRz6lZ/p2bRYWp0QOJ5FTb0dwW
KhFUuPJN6BiWOq9/BypApVe92Mokc4gKVr0bapGc9uUlIVSQ6vuwZjViQi1Qs8byVABqiXKd KR3fouJUC2KcPPhwUOHKTn20HdVOtJ29oZapuTJ93LdRQWr2n2IHcKhYpTebTtL7ol6oQOV2ZPsn
lKKi1V2hUCgU6tfVG4K7L1m35cX0AAAAAElFTkSuQmCC
# url
data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAASIAAAEiAQAAAAB1xeIbAAABeElEQVR4nO2aS26EMBBEX8dIWXqk OUCOAjfL1eAoc4BIsIxkVFmYz2SySBYhQNxegDBvUWrZ7VKBie9H9/QDCJxyyimnnDo6ZdOooLMK a4Z5ptlVVxFULUnqARhNLUGSpM/U3+sqghqWNR4T1gB5G+ytqzAqfLWdh9DllFO/Rs1tJQoYwOqb 5Zn71X9U9eemptp3ueABICSD0fbVVQKVa7+ucTGMNm2DPXWVQJGtZK2E2nzMBqmNKb/Ioz2q+nNT d7WfL5LUB0nLo9d+E+qu54jhKgMwYoKuCbK9dJVAzT5nuMqICXW2tP/4Nh+4R1V/boo1Opj6fZSo +yCI3nM2pe59Tp1vYyV4d4/5R9SaY+bF311A6kHtrrr+N7X4nMndTLNLu3GPuT0155iSEtKtgu4C 1uysqyRqSo5jQu0aLOyvqwRKLUHWEGSvt2f/drIl9ZhjQuwnk9+9pNnpH1X9uanHHDNnyNltDua1 35Iy/zfKKaeccqoI6gPykb77Lm4sZgAAAABJRU5ErkJggg==
# install python3-qrcode
apt install python3-qrcode
Text to qr image
echo "test" | qr > test.png
Text to qr to base64
echo "test" | qr | base64
Text to qr to Browser image
data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAASIAAAEiAQAAAAB1xeIbAAABeElEQVR4nO2aS26EMBBEX8dIWXqk OUCOAjfL1eAoc4BIsIxkVFmYz2SySBYhQNxegDBvUWrZ7VKBie9H9/QDCJxyyimnnDo6ZdOooLMK a4Z5ptlVVxFULUnqARhNLUGSpM/U3+sqghqWNR4T1gB5G+ytqzAqfLWdh9DllFO/Rs1tJQoYwOqb 5Zn71X9U9eemptp3ueABICSD0fbVVQKVa7+ucTGMNm2DPXWVQJGtZK2E2nzMBqmNKb/Ioz2q+nNT d7WfL5LUB0nLo9d+E+qu54jhKgMwYoKuCbK9dJVAzT5nuMqICXW2tP/4Nh+4R1V/boo1Opj6fZSo +yCI3nM2pe59Tp1vYyV4d4/5R9SaY+bF311A6kHtrrr+N7X4nMndTLNLu3GPuT0155iSEtKtgu4C 1uysqyRqSo5jQu0aLOyvqwRKLUHWEGSvt2f/drIl9ZhjQuwnk9+9pNnpH1X9uanHHDNnyNltDua1 35Iy/zfKKaeccqoI6gPykb77Lm4sZgAAAABJRU5ErkJggg==
apt install zbar-tools
zbarimg /path/to/image
download
https://www.raspberrypi.org/downloads/raspbian/
verify sha256sum
65308c4a52cb2a6e7995c67e66aceca68a1b1944f2aacb1f89be55f4db9d48ab 2018-06-27-raspbian-stretch.img 8636ab9fdd8f58a8ec7dde33b83747696d31711d17ef68267dbbcd6cfb968c24 2018-06-27-raspbian-stretch.zip 1d1d85d0faa8211ca2be15b8777cf785000768f0115056673f55083281d081de 2018-06-27-raspbian-stretch.zip.torrent 85d9213eafd4982162306249100856491c51d304cf0faa5ee23306cee64effac 2018-06-27-raspbian-stretch-lite.img 3271b244734286d99aeba8fa043b6634cad488d211583814a2018fc14fdca313 2018-06-27-raspbian-stretch-lite.zip a90c299df88198fc5b60c705d809f924a8a3f20eadd813c44c19abd900f6cd9c 2018-06-27-raspbian-stretch-lite.zip.torrent
flash sd card
dd if=2018-06-27-raspbian-stretch.img of=/dev/mmblk0 bs=1M
configure raspbian
sudo raspi-config
enable ssh, spi, serial, 1-wire, …
sudo touch /boot/ssh
download
https://www.raspberrypi.org/downloads/raspbian/
verify sha256sum
4cdb8ebbbc52a8a3061082d3524b821aa4ad7e0db56413c2a129d96723c0f64d 2018-04-18-raspbian-stretch.img 0e2922e551a895b136f2ea83d1bc0ca71e016e6d50244ba3da52bd764df5d1b6 2018-04-18-raspbian-stretch.zip 5f0a0361cf308bcf2e5aea552fd14ff85582de607bdf9c374e0e18ebaaf6348b 2018-04-18-raspbian-stretch.zip.torrent 5a0747b2bfb8c8664192831b7dc5b22847718a1cb77639a1f3db3683b242dc96 2018-04-18-raspbian-stretch-lite.img 5a0747b2bfb8c8664192831b7dc5b22847718a1cb77639a1f3db3683b242dc96 2018-04-18-raspbian-stretch-lite.zip d6d0395848e42bc21acd6cf9656cd0a429c710b9bb57af36d927faa7e62d87c9 2018-04-18-raspbian-stretch-lite.zip.torrent
flash sd card
dd if=2018-04-18-raspbian-stretch.img of=/dev/mmblk0 bs=1M
configure raspbian
sudo raspi-config
enable ssh, spi, serial, 1-wire, …
sudo touch /boot/ssh
log into router via ssh
opkg update opkg install tcpdump tcpdump -i eth1 -l -vvv dst port 53
save dump
tcpdump -i eth1 -l -vvv dst port 53 >> /tmp/dns.dump grep -E 'A\?' /tmp/dns.dump |sed -e 's/^.*A? //' -e 's/ .*//'|sort -u
live dns view
tcpdump -lvi any "udp port 53" 2>/dev/null | grep -E 'A\?' | awk '{print $(NF-1)}'
http://www.openbsd.org/63.html
http://www.openbsd.org/ftp.html
untrusted comment: signature from openbsd 6.3 base secret key RWRxzbLwAd76ZRV2uct0nZY/4MOgNUlFqaPXXWDXIikK2CJEbAW27Q9sEfQ6l7b9o7sVLrcUnSzJYJ0SW85IVANQjqjpOJg6Zw0= SHA256 (BUILDINFO) = d094710348893d5e8234c84892e8d4c1f14d3d0f927228c9ddc0fcef787cfe19 SHA256 (INSTALL.i386) = dfb3729a34572b8c8144ccbdcb0ea155a446ff813789014a5b1f35453e86db9f SHA256 (base63.tgz) = 44a02fe614a010c2add7ed3af1ed9b36d146b91a417ad2c12ac8afa76130c8aa SHA256 (bsd) = 0be3118ce6430d6e1ede379f28631c52ff4ff527e02eb5e0967513b07e4dad00 SHA256 (bsd.mp) = b2f8f4c25a868fde2347057a4d22354b37516b2fc731d10fbc605f45da2be513 SHA256 (bsd.rd) = cb647e2a51e775632d8005f33f31ad98fcdcae6c7778c43ec3b44ca42df02731 SHA256 (cd63.iso) = f0394f2b27974845311bf88ad0c840760716bd3a46979638eddafc9ab4be3807 SHA256 (cdboot) = 175267499ebc45724b966304f094553d68ae606fb30b5ef0000cc0d668a51e87 SHA256 (cdbr) = 6e4544abbf48a7e7b184d92509b769215282fe4897e64082713b82981024c1bc SHA256 (comp63.tgz) = a68c4cf5c957badb61d6e4c65a3e1c7d587d22f992d248ccc7eef82ad360ac6f SHA256 (floppy63.fs) = 0deae38bbf582884d5f57dac4f95e06e6ac724080a2e3303fcc735bef6c33592 SHA256 (game63.tgz) = 563ee6502ebd8c6798402491dac385adef5aea24ecfed0b2a5f945cef9607413 SHA256 (install63.fs) = d191b4466f6562551fbdc5afbaccc1d58ab0d5ce2768e2bb93f776f219a2fdc9 SHA256 (install63.iso) = af27c565c4abac76f4d3cc5cf51a31e1f9b5f37656c2a8af36ca708212bc8245 SHA256 (man63.tgz) = 106061f2b79e6c6466ec482dda82226e2151dcf08773b93c3f364696b7ef2b51 SHA256 (miniroot63.fs) = c7bbfaec254299fdc9607a04d3be2bf1783688ea56bb12963e8a7abdef67abbf SHA256 (pxeboot) = f446ce7636e50543f42e891f059a292c8deffd19267f8fb3d51b7cf25be70b8c SHA256 (xbase63.tgz) = 27a8c0729da43765f6cfad863ae098592d6d450aa45122dc08cc182625ffd411 SHA256 (xfont63.tgz) = cd4ec1fe5309f243db16354f46c29ff7e280558dabdea183ea65edd73073534a SHA256 (xserv63.tgz) = 82a55b157059d567bc8eb0d20e1d9301c5424fa8bb37e4b4cc2fdf1f52d7a602 SHA256 (xshare63.tgz) = 1f4ddd54a4f6b8fd100a9e92bd7c11edea695d15946dddc1656c40c050aea199
untrusted comment: signature from openbsd 6.3 base secret key RWRxzbLwAd76ZdnKJCBPgPN6KHiTbJkhmkFL3Z7TV/Fg+fGE6SnBQcGDhwXhiWkYxEYHaPVkSAjrJd3GjtgUCo3AOEUuuOK3Ugg= SHA256 (BOOTIA32.EFI) = 388027947da29570fb61dc29f822a38382d62f6330db1b053afc5a1cbe0872dc SHA256 (BOOTX64.EFI) = 4aea681b75a26f28250185708e9d6f9c19e4ee46cb5d8563eee57f51b59a8499 SHA256 (BUILDINFO) = d8e6c4e63945d23159fad5b61dbd26f3beb6b326f1cf648a599207eafe15adc6 SHA256 (INSTALL.amd64) = f2aa9402305ad474dda117a94d01727a5ffc8d0b601d7d84441b56401c529486 SHA256 (base63.tgz) = 6974edc9860b5907a139b69679cd83f035ddf25b88112753b0de8db7c8bc7798 SHA256 (bsd) = a576dd47b59cfd960543d9f1b425329aff4805148135bfa2f9fb498e4e9cab9b SHA256 (bsd.mp) = 274f7a2948b770fd9b6199015c80abc94abe6ce25fafe25f979a386725b61c7d SHA256 (bsd.rd) = 1c0adb43a02ae3aee512bcf0829dac0ccb2e4d614b161049af7ce530e5da2dfc SHA256 (cd63.iso) = 7b3feffcc9ade0dcaba3c5996c1eb797928cd76cecfa4c54bf8297b191bd461f SHA256 (cdboot) = 4a7100056d930c853a49bc1d203763b51951dc38b20308d675fe8a678f5a9ae1 SHA256 (cdbr) = ff2a89976c0c91d3c5037760a45e0dcc337410b5f82710ef628ac73e13296a6d SHA256 (comp63.tgz) = f0aa47152ee4e11e0d9ab1cf8788c07b4487c425b92a1c043b7961f27634b571 SHA256 (floppy63.fs) = 7286a386402b76829a15bd4877e4adce5fd8f9b50c86223cc494dbd97201fc85 SHA256 (game63.tgz) = a75af254b38495a53d10ea1d6540041b170a6dad5048fc4b2c59c399007fb5c8 SHA256 (install63.fs) = df19266be16079ccd6114447f7bb13bdedb9c5cb66ecc1ea98544290fa4dc138 SHA256 (install63.iso) = ee775405dd7926975befbc3fef23de8c4b5a726c3b5075e4848fcd3a2a712ea8 SHA256 (man63.tgz) = 331cab3ea89f81157f8cc111fb8b4eaba3bb6c6decd74e59521d2447208619b1 SHA256 (miniroot63.fs) = da54a4237c4dee1261d73b585532b16047e5c866047b3e8da879a9dbc46d2f73 SHA256 (pxeboot) = 60029919798f48ea40ecb123adfed6217f099d5ed9cd1a6c7de5b544d7b7b0f6 SHA256 (xbase63.tgz) = 9fbdf7f8f3a7c9e54a10859b55a3bf02a0ae142924688f823d09afc26fb0fe11 SHA256 (xfont63.tgz) = 35103b2a0b4e8ee0bccd5d55e24fa37afe4e7c86b7301f641cab12b9bccdb8bd SHA256 (xserv63.tgz) = f7dce27e557f4ce1c61ddc4395624079a212af6f11eaa3c4f73f4271b8d62c76 SHA256 (xshare63.tgz) = 5a91ebd61ad8d64c0d98d07bbd80f9c8346b12fa5c61bdad36a8b107179ed3bd
untrusted comment: signature from openbsd 6.3 base secret key RWRxzbLwAd76ZRYr4Sql5g3jvvE1hVZ0t3uAe8oUVPCPNzwzZSsYM0O4C13SxnO7LkDUlRsazmh9d9EOZl8wo8qzkLVFJMActgI= SHA256 (BOOTAA64.EFI) = 22a5e1ba64ec666f645e637ee5aff5ef1292725247e4e383fc33ace6e8612f92 SHA256 (BUILDINFO) = c0e40b83bb0497f5d677c8e608a430b1ec8bb3d7f40090e4041f598132494604 SHA256 (INSTALL.arm64) = 56ff0e5b849a9bbb828c506bc4f66490a735ee06241c62dc0217fd3a4b524a01 SHA256 (base63.tgz) = f1705cf178003e626ab863f301e959e04e087fa07031d526f7c1df61aeae2924 SHA256 (bsd) = e481bfaf81ea0d63c8119a385a15e63dd6189bfc02f4ca9c2be47658e013d69f SHA256 (bsd.mp) = 1c63d76e5a6cc76280dc23ec169e46c1639e9d55b3a70a80c7f8af590a76b42c SHA256 (bsd.rd) = cfa3f8deacbfbbd44c3de7e56d49f40ff17e229e4a81dd76eefd312ba241e715 SHA256 (comp63.tgz) = d905a868e8c6296032c5ffa9018e6a047f3a3b6068a95e5a82cfdd58175b750a SHA256 (game63.tgz) = 1a48c5c6eddc48de744bc1e0c76d48fe5d2bdd4e85ca67a6b9607ed70bc15cb9 SHA256 (man63.tgz) = 4ba9da3b87c971871fb1128c47893e3bc251c578e15fc94ac1fc8c2353fee1da SHA256 (miniroot63.fs) = 6b782b5394b70367ce5407571948914fe878ac6523225f652fefc3563ef72e6c SHA256 (xbase63.tgz) = 1996eaef5d9811486e273df196ab73126db11a06cc336b4f9e8e24f41f5c5599 SHA256 (xfont63.tgz) = 1b5f06a034a0fd95baf4a47e81f74a34b678f9cec02e47e370dea5d0f87c1fe9 SHA256 (xserv63.tgz) = 3a44d9f1af1a1d3c529a06a9eb9acbf37a2e11f24513e4054d550c303c5d5a8f SHA256 (xshare63.tgz) = 32ae72aa6be1c23df36fbeeba580b96592bd62c777a1ab017f2e22ff7141744a
Check Signature
signify pubkeys for this release: base: RWRxzbLwAd76ZZxHU7wuIFUOVGwl6SjNNzanKWTql8w+hui7WLE/72mW fw: RWT3tdmiAc+DH/CJOxPFT10kUM90/UcLTgSEUEKzhKm9QEhy+UD4CWPy pkg: RWT58k1AWz/zZO9DHcPHXiHhDNP6hdwGjxNkyMoc/sh4O5NI8Zz1R1lD
signify -C -p /etc/signify/openbsd-63-base.pub -x SHA256.sig
signify-openbsd -Cp openbsd-63-base.pub -x SHA256.sig install63.iso
Full Disk Encryption Install auf sd0/wd0
Boot CD and start (S)hell
zeroing the first chunk of the entire scsi disc (optional)
dd if=/dev/zero of=/dev/rsd2c bs=1m count=1
sd/rsd: Its device files would be /dev/sd2a for the block device and /dev/rsd2a for the raw (character) device.
2: The devices are numbered by the order in which they are detected at boot time, starting at zero. Here: Disc number three.
c: The c partition is always the entire disk.
if there is no sd0 (optional)
cd /dev && sh MAKEDEV sd0
fdisk -iy sd0
disklabel -E sd0
add partition a
z a a
offset: [64]
size: [1234567890]
FS type: [4.2BSD] RAID
w[Enter]q[Enter]
bioctl -c C -l /dev/sd0a softraid0
exit
start (I)nstall
…
Which disk is the root disk? (‘?’ for detials) [sd0]
“?” should show you “sd?: SR CRYPTO”
e.g. “sd1”
install Packages
add to .profiles file:
export PKG_PATH=https://ftp.fau.de/pub/OpenBSD/`uname -r`/packages/`uname -m`/
pkg_add nano rsync wget openvpn firefox unzip htop
search Packages
pkg_info -Q sshfs
pkg_add sshfs-fuse
update OpenBSD
pkg_add -Uu
install mate Desktop
disable display manager
rcctl disable xenodm
pkg_add -Iv mate-desktop mate-notification-daemon mate-terminal mate-panel mate-session-manager mate-icon-theme mate-control-center mate-calc caja slim slim-themes
echo 'exec mate-session' > .xinitrc
echo "/usr/local/bin/slim -d" >> /etc/rc.local
echo 'pkg_scripts="dbus_daemon avahi_daemon" dbus_enable=YES' >> /etc/rc.conf.local
startx
Vom Installationsmedium booten und die Installations Architektur auswählen (heute meistens x86_64)
Torrent: https://www.archlinux.org/releng/releases/2017.12.01/torrent/
GPG: 4AA4767BBC9C4B1D18AE28B77F2D434B9741E8AC
MD5: d0ae8c4b4a037238e5f0880243d4619e
SHA1: ec5e7c58520d7e1be72bc27c669d3c5fc94d6947
Installationsanleitung
https://wiki.archlinux.de/title/Arch_Install_Scripts
https://wiki.archlinux.org/index.php/Installation_guide
Sobald Terminal tty1 geladen ist folgendes ausführen
loadkeys de-latin1
pacman -Sy
jetzt sollten updates heruntergeladen werden – wenn nicht: Internetverbindung checken
Für remote SSH Setup (optional)
pacman -S openssh
systemctl enable sshd.service systemctl start sshd.service
jetzt sollte man sich über die ip (ip addr show) per ssh einloggen können (Passwort setzen nicht vergessen – passwd)
Festplatten ‘dos’ partitionieren
cfdisk /dev/sda
/dev/sda1 – 1 GB – ext4 – /boot
/dev/sda2 – * GB – luks – cryptcontainer
Partitionen anlegen
mkfs.ext4 /dev/sda1 cryptsetup luksFormat /dev/sda2 cryptsetup luksOpen /dev/sda2 sda2_crypt mkfs.ext4 /dev/mapper/sda2_crypt
Dateisysteme einhängen
mount -t ext4 /dev/mapper/sda2_crypt /mnt mkdir -p /mnt/boot mount -t ext4 /dev/sda1 /mnt/boot
Basissystem einrichten
pacstrap /mnt base base-devel grub nano openssh net-tools lz4 virtualbox-guest-modules-arch virtualbox-guest-utils
System einrichten
genfstab -Lp /mnt > /mnt/etc/fstab #cp /etc/resolv.conf /mnt/etc/resolv.conf
arch-chroot /mnt /bin/bash
echo "ArchLinux" > /etc/hostname
echo LANG=de_DE.UTF-8 > /etc/locale.conf echo LC_COLLATE=C >> /etc/locale.conf
echo KEYMAP=de-latin1 > /etc/vconsole.conf
nano /etc/default/grub
GRUB_CMDLINE_LINUX=”cryptdevice=/dev/md1:md1_crypt”
ln -s /usr/share/zoneinfo/ZONE/ORT /etc/localtime # Zone/Ort anpassen
ln -s /usr/share/zoneinfo/Europe/Berlin /etc/localtime systemctl enable dhcpcd.service
Gewünschte Sprachen in /etc/locale.gen auskommentieren, anschließend mit locale-gen erzeugen
en_US ISO-8859-1 en_US.UTF-8 UTF-8 de_DE ISO-8859-1
/etc/mkinitcpio.conf konfigurieren und Kernel-Image mit mkinitcpio -p linux erzeugen
z.B. zu HOOKS mdadm und zu MODULES raid1 hinzufügen
MODULES=(ext4) HOOKS=(base udev autodetect modconf block keyboard encrypt filesystems fsck)
mkinitcpio -p linux
Bootloader Grub einrichten
grub-install --no-floppy /dev/sda grub-mkconfig -o /boot/grub/grub.cfg
passwd useradd UserName passwd UserName mkdir /home/UserName chown UserName:UserName /home/UserName
Gnome3 isntallieren
pacman -S xorg-server xorg-xinit gnome gnome-extra
echo "setxkbmap de-latin1" >> /home/UserName/.xinitrc echo "exec gnome-session" >> /home/UserName/.xinitrc
Fertig – nur noch sauber Beenden und Neu starten
exit umount /mnt/boot umount /mnt reboot
enable cam
sudo raspi-config
-> 5 Interfacing Options -> P1 Camera -> enable
install motion
sudo apt install motion
enable video0 device
sudo modprobe bcm2835-v4l2
add “bcm2835-v4l2” to your /etc/modules file
create a ramdisk
sudo mkdir /mnt/ramdisk sudo echo "ramfs /mnt/ramdisk ramfs defaults 0 0" >> /etc/fstab sudo mount /mnt/ramdisk sudo chmod o+w /mnt/ramdisk
edit your config /etc/motion/motion.conf
# # This config file was generated by motion 4.0 ############################################################ # Daemon ############################################################ # Start in daemon (background) mode and release terminal (default: off) daemon on # File to store the process ID, also called pid file. (default: not defined) process_id_file /var/run/motion/motion.pid ############################################################ # Basic Setup Mode ############################################################ # Start in Setup-Mode, daemon disabled. (default: off) setup_mode off # Use a file to save logs messages, if not defined stderr and syslog is used. (default: not defined) logfile /var/log/motion/motion.log # Level of log messages [1..9] (EMG, ALR, CRT, ERR, WRN, NTC, INF, DBG, ALL). (default: 6 / NTC) log_level 6 # Filter to log messages by type (COR, STR, ENC, NET, DBL, EVT, TRK, VID, ALL). (default: ALL) log_type all ########################################################### # Capture device options ############################################################ # Videodevice to be used for capturing (default /dev/video0) # for FreeBSD default is /dev/bktr0 videodevice /dev/video0 # v4l2_palette allows one to choose preferable palette to be use by motion # to capture from those supported by your videodevice. (default: 17) # E.g. if your videodevice supports both V4L2_PIX_FMT_SBGGR8 and # V4L2_PIX_FMT_MJPEG then motion will by default use V4L2_PIX_FMT_MJPEG. # Setting v4l2_palette to 2 forces motion to use V4L2_PIX_FMT_SBGGR8 # instead. # # Values : # V4L2_PIX_FMT_SN9C10X : 0 'S910' # V4L2_PIX_FMT_SBGGR16 : 1 'BYR2' # V4L2_PIX_FMT_SBGGR8 : 2 'BA81' # V4L2_PIX_FMT_SPCA561 : 3 'S561' # V4L2_PIX_FMT_SGBRG8 : 4 'GBRG' # V4L2_PIX_FMT_SGRBG8 : 5 'GRBG' # V4L2_PIX_FMT_PAC207 : 6 'P207' # V4L2_PIX_FMT_PJPG : 7 'PJPG' # V4L2_PIX_FMT_MJPEG : 8 'MJPEG' # V4L2_PIX_FMT_JPEG : 9 'JPEG' # V4L2_PIX_FMT_RGB24 : 10 'RGB3' # V4L2_PIX_FMT_SPCA501 : 11 'S501' # V4L2_PIX_FMT_SPCA505 : 12 'S505' # V4L2_PIX_FMT_SPCA508 : 13 'S508' # V4L2_PIX_FMT_UYVY : 14 'UYVY' # V4L2_PIX_FMT_YUYV : 15 'YUYV' # V4L2_PIX_FMT_YUV422P : 16 '422P' # V4L2_PIX_FMT_YUV420 : 17 'YU12' # v4l2_palette 17 # Tuner device to be used for capturing using tuner as source (default /dev/tuner0) # This is ONLY used for FreeBSD. Leave it commented out for Linux ; tunerdevice /dev/tuner0 # The video input to be used (default: -1) # Should normally be set to 0 or 1 for video/TV cards, and -1 for USB cameras # Set to 0 for uvideo(4) on OpenBSD input -1 # The video norm to use (only for video capture and TV tuner cards) # Values: 0 (PAL), 1 (NTSC), 2 (SECAM), 3 (PAL NC no colour). Default: 0 (PAL) norm 0 # The frequency to set the tuner to (kHz) (only for TV tuner cards) (default: 0) frequency 0 # Override the power line frequency for the webcam. (normally not necessary) # Values: # -1 : Do not modify device setting # 0 : Power line frequency Disabled # 1 : 50hz # 2 : 60hz # 3 : Auto power_line_frequency -1 # Rotate image this number of degrees. The rotation affects all saved images as # well as movies. Valid values: 0 (default = no rotation), 90, 180 and 270. rotate 0 # Image width (pixels). Valid range: Camera dependent, default: 352 #width 320 width 800 # Image height (pixels). Valid range: Camera dependent, default: 288 #height 240 height 608 # Maximum number of frames to be captured per second. # Valid range: 2-100. Default: 100 (almost no limit). #framerate 2 framerate 20 # Minimum time in seconds between capturing picture frames from the camera. # Default: 0 = disabled - the capture rate is given by the camera framerate. # This option is used when you want to capture images at a rate lower than 2 per second. minimum_frame_time 0 # URL to use if you are using a network camera, size will be autodetected (incl http:// ftp:// mjpg:// rtsp:// mjpeg:// or file:///) # Must be a URL that returns single jpeg pictures or a raw mjpeg stream. A trailing slash may be required for some cameras. # Default: Not defined ; netcam_url value # Username and password for network camera (only if required). Default: not defined # Syntax is user:password ; netcam_userpass value # The setting for keep-alive of network socket, should improve performance on compatible net cameras. # off: The historical implementation using HTTP/1.0, closing the socket after each http request. # force: Use HTTP/1.0 requests with keep alive header to reuse the same connection. # on: Use HTTP/1.1 requests that support keep alive as default. # Default: off netcam_keepalive off # URL to use for a netcam proxy server, if required, e.g. "http://myproxy". # If a port number other than 80 is needed, use "http://myproxy:1234". # Default: not defined ; netcam_proxy value # Set less strict jpeg checks for network cameras with a poor/buggy firmware. # Default: off netcam_tolerant_check off # RTSP connection uses TCP to communicate to the camera. Can prevent image corruption. # Default: on rtsp_uses_tcp on # Name of camera to use if you are using a camera accessed through OpenMax/MMAL # Default: Not defined ; mmalcam_name vc.ril.camera # Camera control parameters (see raspivid/raspistill tool documentation) # Default: Not defined ; mmalcam_control_params -hf #mmalcam_control_params -ex sports -mm matrix # Use the still camera output - limits frame rate, but can show more of frame Default: off #mmalcam_use_still off # Activate a secondary buffer with larger resolution Default: 0 (off) #mmalcam_secondary_buffer_upscale 2 # Pre-encode the secondary buffer to this jpeg quality Default: 0 (off), range 1-100 #mmalcam_secondary_buffer_jpeg 100 # Path to file where raw dump of camera YUV capture will be written (for testing, profiling & debugging) Default: Not defined ; mmalcam_raw_capture_file value # Let motion regulate the brightness of a video device (default: off). # The auto_brightness feature uses the brightness option as its target value. # If brightness is zero auto_brightness will adjust to average brightness value 128. # Only recommended for cameras without auto brightness auto_brightness off #auto_brightness on # Set the initial brightness of a video device. # If auto_brightness is enabled, this value defines the average brightness level # which Motion will try and adjust to. # Valid range 0-255, default 0 = disabled brightness 0 # Set the contrast of a video device. # Valid range 0-255, default 0 = disabled contrast 0 # Set the saturation of a video device. # Valid range 0-255, default 0 = disabled saturation 0 # Set the hue of a video device (NTSC feature). # Valid range 0-255, default 0 = disabled hue 0 ############################################################ # Round Robin (multiple inputs on same video device name) ############################################################ # Number of frames to capture in each roundrobin step (default: 1) roundrobin_frames 1 # Number of frames to skip before each roundrobin step (default: 1) roundrobin_skip 1 # Try to filter out noise generated by roundrobin (default: off) switchfilter off ############################################################ # Motion Detection Settings: ############################################################ # Threshold for number of changed pixels in an image that # triggers motion detection (default: 1500) ;threshold 1500 threshold 450 # Automatically tune the threshold down if possible (default: off) threshold_tune off # Noise threshold for the motion detection (default: 32) noise_level 32 # Automatically tune the noise threshold (default: on) noise_tune on # Despeckle motion image using (e)rode or (d)ilate or (l)abel (Default: not defined) # Recommended value is EedDl. Any combination (and number of) of E, e, d, and D is valid. # (l)abeling must only be used once and the 'l' must be the last letter. # Comment out to disable despeckle_filter EedDl # Detect motion in predefined areas (1 - 9). Areas are numbered like that: 1 2 3 # A script (on_area_detected) is started immediately when motion is 4 5 6 # detected in one of the given areas, but only once during an event. 7 8 9 # One or more areas can be specified with this option. Take care: This option # does NOT restrict detection to these areas! (Default: not defined) ; area_detect value # PGM file to use as a sensitivity mask. # Full path name to. (Default: not defined) ; mask_file value # Dynamically create a mask file during operation (default: 0) # Adjust speed of mask changes from 0 (off) to 10 (fast) smart_mask_speed 0 # Ignore sudden massive light intensity changes given as a percentage of the picture # area that changed intensity. Valid range: 0 - 100 , default: 0 = disabled lightswitch 0 # Picture frames must contain motion at least the specified number of frames # in a row before they are detected as true motion. At the default of 1, all # motion is detected. Valid range: 1 to thousands, recommended 1-5 minimum_motion_frames 1 # Specifies the number of pre-captured (buffered) pictures from before motion # was detected that will be output at motion detection. # Recommended range: 0 to 5 (default: 0) # Do not use large values! Large values will cause Motion to skip video frames and # cause unsmooth movies. To smooth movies use larger values of post_capture instead. #pre_capture 0 pre_capture 1 # Number of frames to capture after motion is no longer detected (default: 0) #post_capture 0 post_capture 5 # Event Gap is the seconds of no motion detection that triggers the end of an event. # An event is defined as a series of motion images taken within a short timeframe. # Recommended value is 60 seconds (Default). The value -1 is allowed and disables # events causing all Motion to be written to one single movie file and no pre_capture. # If set to 0, motion is running in gapless mode. Movies don't have gaps anymore. An # event ends right after no more motion is detected and post_capture is over. event_gap 60 # Maximum length in seconds of a movie # When value is exceeded a new movie file is created. (Default: 0 = infinite) max_movie_time 0 # Always save images even if there was no motion (default: off) emulate_motion off ############################################################ # Image File Output ############################################################ # Output 'normal' pictures when motion is detected (default: on) # Valid values: on, off, first, best, center # When set to 'first', only the first picture of an event is saved. # Picture with most motion of an event is saved when set to 'best'. # Picture with motion nearest center of picture is saved when set to 'center'. # Can be used as preview shot for the corresponding movie. output_pictures on # Output pictures with only the pixels moving object (ghost images) (default: off) output_debug_pictures off # The quality (in percent) to be used by the jpeg compression (default: 75) ;quality 75 quality 100 # Type of output images # Valid values: jpeg, ppm (default: jpeg) picture_type jpeg ############################################################ # FFMPEG related options # Film (movies) file output, and deinterlacing of the video input # The options movie_filename and timelapse_filename are also used # by the ffmpeg feature ############################################################ # Use ffmpeg to encode movies in realtime (default: off) ffmpeg_output_movies on # Use ffmpeg to make movies with only the pixels moving # object (ghost images) (default: off) ffmpeg_output_debug_movies off # Use ffmpeg to encode a timelapse movie # Default value 0 = off - else save frame every Nth second ffmpeg_timelapse 0 # The file rollover mode of the timelapse video # Valid values: hourly, daily (default), weekly-sunday, weekly-monday, monthly, manual ffmpeg_timelapse_mode daily # Bitrate to be used by the ffmpeg encoder (default: 400000) # This option is ignored if ffmpeg_variable_bitrate is not 0 (disabled) #ffmpeg_bps 400000 ffmpeg_bps 500000 # Enables and defines variable bitrate for the ffmpeg encoder. # ffmpeg_bps is ignored if variable bitrate is enabled. # Valid values: 0 (default) = fixed bitrate defined by ffmpeg_bps, # or the range 1 - 100 where 1 means worst quality and 100 is best. ffmpeg_variable_bitrate 0 # Codec to used by ffmpeg for the video compression. # Timelapse videos have two options. # mpg - Creates mpg file with mpeg-2 encoding. # If motion is shutdown and restarted, new pics will be appended # to any previously created file with name indicated for timelapse. # mpeg4 - Creates avi file with the default encoding. # If motion is shutdown and restarted, new pics will create a # new file with the name indicated for timelapse. # Supported formats are: # mpeg4 or msmpeg4 - gives you files with extension .avi # msmpeg4 is recommended for use with Windows Media Player because # it requires no installation of codec on the Windows client. # swf - gives you a flash film with extension .swf # flv - gives you a flash video with extension .flv # ffv1 - FF video codec 1 for Lossless Encoding # mov - QuickTime # mp4 - MPEG-4 Part 14 H264 encoding # mkv - Matroska H264 encoding # hevc - H.265 / HEVC (High Efficiency Video Coding) ffmpeg_video_codec mpeg4 # When creating videos, should frames be duplicated in order # to keep up with the requested frames per second # (default: true) ffmpeg_duplicate_frames true ############################################################ # SDL Window ############################################################ # Number of motion thread to show in SDL Window (default: 0 = disabled) #sdl_threadnr 0 ############################################################ # External pipe to video encoder # Replacement for FFMPEG builtin encoder for ffmpeg_output_movies only. # The options movie_filename and timelapse_filename are also used # by the ffmpeg feature ############################################################# # Bool to enable or disable extpipe (default: off) use_extpipe off # External program (full path and opts) to pipe raw video to # Generally, use '-' for STDIN... ;extpipe mencoder -demuxer rawvideo -rawvideo w=%w:h=%h:i420 -ovc x264 -x264encopts bframes=4:frameref=1:subq=1:scenecut=-1:nob_adapt:threads=1:keyint=1000:8x8dct:vbv_bufsize=4000:crf=24:partitions=i8x8,i4x4:vbv_maxrate=800:no-chroma-me -vf denoise3d=16:12:48:4,pp=lb -of avi -o %f.avi - -fps %fps ;extpipe x264 - --input-res %wx%h --fps %fps --bitrate 2000 --preset ultrafast --quiet -o %f.mp4 ;extpipe mencoder -demuxer rawvideo -rawvideo w=%w:h=%h:fps=%fps -ovc x264 -x264encopts preset=ultrafast -of lavf -o %f.mp4 - -fps %fps ;extpipe ffmpeg -y -f rawvideo -pix_fmt yuv420p -video_size %wx%h -framerate %fps -i pipe:0 -vcodec libx264 -preset ultrafast -f mp4 %f.mp4 ############################################################ # Snapshots (Traditional Periodic Webcam File Output) ############################################################ # Make automated snapshot every N seconds (default: 0 = disabled) snapshot_interval 0 ############################################################ # Text Display # %Y = year, %m = month, %d = date, # %H = hour, %M = minute, %S = second, %T = HH:MM:SS, # %v = event, %q = frame number, %t = camera id number, # %D = changed pixels, %N = noise level, \n = new line, # %i and %J = width and height of motion area, # %K and %L = X and Y coordinates of motion center # %C = value defined by text_event - do not use with text_event! # You can put quotation marks around the text to allow # leading spaces ############################################################ # Locate and draw a box around the moving object. # Valid values: on, off, preview (default: off) # Set to 'preview' will only draw a box in preview_shot pictures. ;locate_motion_mode off locate_motion_mode on # Set the look and style of the locate box if enabled. # Valid values: box, redbox, cross, redcross (default: box) # Set to 'box' will draw the traditional box. # Set to 'redbox' will draw a red box. # Set to 'cross' will draw a little cross to mark center. # Set to 'redcross' will draw a little red cross to mark center. ;locate_motion_style box locate_motion_style redbox # Draws the timestamp using same options as C function strftime(3) # Default: %Y-%m-%d\n%T = date in ISO format and time in 24 hour clock # Text is placed in lower right corner text_right %Y-%m-%d\n%T-%q # Draw a user defined text on the images using same options as C function strftime(3) # Default: Not defined = no text # Text is placed in lower left corner ; text_left CAMERA %t text_left Position xyz # Draw the number of changed pixed on the images (default: off) # Will normally be set to off except when you setup and adjust the motion settings # Text is placed in upper right corner ;text_changes off text_changes on # This option defines the value of the special event conversion specifier %C # You can use any conversion specifier in this option except %C. Date and time # values are from the timestamp of the first image in the current event. # Default: %Y%m%d%H%M%S # The idea is that %C can be used filenames and text_left/right for creating # a unique identifier for each event. text_event %Y%m%d%H%M%S # Draw characters at twice normal size on images. (default: off) ;text_double off text_double on # Text to include in a JPEG EXIF comment # May be any text, including conversion specifiers. # The EXIF timestamp is included independent of this text. ;exif_text %i%J/%K%L ############################################################ # Target Directories and filenames For Images And Films # For the options snapshot_, picture_, movie_ and timelapse_filename # you can use conversion specifiers # %Y = year, %m = month, %d = date, # %H = hour, %M = minute, %S = second, # %v = event, %q = frame number, %t = camera id number, # %D = changed pixels, %N = noise level, # %i and %J = width and height of motion area, # %K and %L = X and Y coordinates of motion center # %C = value defined by text_event # Quotation marks round string are allowed. ############################################################ # Target base directory for pictures and films # Recommended to use absolute path. (Default: current working directory) ;target_dir /var/lib/motion target_dir /mnt/ramdisk # File path for snapshots (jpeg or ppm) relative to target_dir # Default: %v-%Y%m%d%H%M%S-snapshot # Default value is equivalent to legacy oldlayout option # For Motion 3.0 compatible mode choose: %Y/%m/%d/%H/%M/%S-snapshot # File extension .jpg or .ppm is automatically added so do not include this. # Note: A symbolic link called lastsnap.jpg created in the target_dir will always # point to the latest snapshot, unless snapshot_filename is exactly 'lastsnap' ;snapshot_filename %v-%Y%m%d%H%M%S-snapshot snapshot_filename %v %Y-%m-%d-%H-%M-xyz # File path for motion triggered images (jpeg or ppm) relative to target_dir # Default: %v-%Y%m%d%H%M%S-%q # Default value is equivalent to legacy oldlayout option # For Motion 3.0 compatible mode choose: %Y/%m/%d/%H/%M/%S-%q # File extension .jpg or .ppm is automatically added so do not include this # Set to 'preview' together with best-preview feature enables special naming # convention for preview shots. See motion guide for details ;picture_filename %v-%Y%m%d%H%M%S-%q picture_filename xyz_%H-%M-%S_%q # File path for motion triggered ffmpeg films (movies) relative to target_dir # Default: %v-%Y%m%d%H%M%S # File extensions(.mpg .avi) are automatically added so do not include them movie_filename %v-%Y%m%d%H%M%S # File path for timelapse movies relative to target_dir # Default: %Y%m%d-timelapse # File extensions(.mpg .avi) are automatically added so do not include them timelapse_filename %Y%m%d-timelapse ############################################################ # Global Network Options ############################################################ # Enable IPv6 (default: off) ipv6_enabled off ############################################################ # Live Stream Server ############################################################ # The mini-http server listens to this port for requests (default: 0 = disabled) stream_port 8081 # Quality of the jpeg (in percent) images produced (default: 50) ;stream_quality 50 stream_quality 100 # Output frames at 1 fps when no motion is detected and increase to the # rate given by stream_maxrate when motion is detected (default: off) stream_motion off # Maximum framerate for stream streams (default: 1) ;stream_maxrate 1 stream_maxrate 20 # Restrict stream connections to localhost only (default: on) ;stream_localhost on stream_localhost off # Limits the number of images per connection (default: 0 = unlimited) # Number can be defined by multiplying actual stream rate by desired number of seconds # Actual stream rate is the smallest of the numbers framerate and stream_maxrate stream_limit 0 # Set the authentication method (default: 0) # 0 = disabled # 1 = Basic authentication # 2 = MD5 digest (the safer authentication) stream_auth_method 0 # Authentication for the stream. Syntax username:password # Default: not defined (Disabled) ; stream_authentication username:password # Percentage to scale the stream image for preview # Default: 25 ; stream_preview_scale 25 # Have stream preview image start on a new line # Default: no ; stream_preview_newline no ############################################################ # HTTP Based Control ############################################################ # TCP/IP port for the http server to listen on (default: 0 = disabled) webcontrol_port 8080 # Restrict control connections to localhost only (default: on) ;webcontrol_localhost on webcontrol_localhost off # Output for http server, select off to choose raw text plain (default: on) webcontrol_html_output on # Authentication for the http based control. Syntax username:password # Default: not defined (Disabled) ; webcontrol_authentication username:password ############################################################ # Tracking (Pan/Tilt) ############################################################# # Type of tracker (0=none (default), 1=stepper, 2=iomojo, 3=pwc, 4=generic, 5=uvcvideo, 6=servo) # The generic type enables the definition of motion center and motion size to # be used with the conversion specifiers for options like on_motion_detected track_type 0 # Enable auto tracking (default: off) track_auto off # Serial port of motor (default: none) ;track_port /dev/ttyS0 # Motor number for x-axis (default: 0) ;track_motorx 0 # Set motorx reverse (default: 0) ;track_motorx_reverse 0 # Motor number for y-axis (default: 0) ;track_motory 1 # Set motory reverse (default: 0) ;track_motory_reverse 0 # Maximum value on x-axis (default: 0) ;track_maxx 200 # Minimum value on x-axis (default: 0) ;track_minx 50 # Maximum value on y-axis (default: 0) ;track_maxy 200 # Minimum value on y-axis (default: 0) ;track_miny 50 # Center value on x-axis (default: 0) ;track_homex 128 # Center value on y-axis (default: 0) ;track_homey 128 # ID of an iomojo camera if used (default: 0) track_iomojo_id 0 # Angle in degrees the camera moves per step on the X-axis # with auto-track (default: 10) # Currently only used with pwc type cameras track_step_angle_x 10 # Angle in degrees the camera moves per step on the Y-axis # with auto-track (default: 10) # Currently only used with pwc type cameras track_step_angle_y 10 # Delay to wait for after tracking movement as number # of picture frames (default: 10) track_move_wait 10 # Speed to set the motor to (stepper motor option) (default: 255) track_speed 255 # Number of steps to make (stepper motor option) (default: 40) track_stepsize 40 ############################################################ # External Commands, Warnings and Logging: # You can use conversion specifiers for the on_xxxx commands # %Y = year, %m = month, %d = date, # %H = hour, %M = minute, %S = second, # %v = event, %q = frame number, %t = camera id number, # %D = changed pixels, %N = noise level, # %i and %J = width and height of motion area, # %K and %L = X and Y coordinates of motion center # %C = value defined by text_event # %f = filename with full path # %n = number indicating filetype # Both %f and %n are only defined for on_picture_save, # on_movie_start and on_movie_end # Quotation marks round string are allowed. ############################################################ # Do not sound beeps when detecting motion (default: on) # Note: Motion never beeps when running in daemon mode. quiet on # Command to be executed when an event starts. (default: none) # An event starts at first motion detected after a period of no motion defined by event_gap ; on_event_start value # Command to be executed when an event ends after a period of no motion # (default: none). The period of no motion is defined by option event_gap. ; on_event_end value # Command to be executed when a picture (.ppm|.jpg) is saved (default: none) # To give the filename as an argument to a command append it with %f ; on_picture_save value # Command to be executed when a motion frame is detected (default: none) ; on_motion_detected value #on_motion_detected /home/pi/mmal/motion-mmal/copy on_motion_detected /home/pi/motion-detect.sh # Command to be executed when motion in a predefined area is detected # Check option 'area_detect'. (default: none) ; on_area_detected value # Command to be executed when a movie file (.mpg|.avi) is created. (default: none) # To give the filename as an argument to a command append it with %f ; on_movie_start value # Command to be executed when a movie file (.mpg|.avi) is closed. (default: none) # To give the filename as an argument to a command append it with %f ; on_movie_end value # Command to be executed when a camera can't be opened or if it is lost # NOTE: There is situations when motion don't detect a lost camera! # It depends on the driver, some drivers dosn't detect a lost camera at all # Some hangs the motion thread. Some even hangs the PC! (default: none) ; on_camera_lost value ##################################################################### # Common Options for database features. # Options require database options to be active also. ##################################################################### # Log to the database when creating motion triggered picture file (default: on) ; sql_log_picture on # Log to the database when creating a snapshot image file (default: on) ; sql_log_snapshot on # Log to the database when creating motion triggered movie file (default: off) ; sql_log_movie off # Log to the database when creating timelapse movies file (default: off) ; sql_log_timelapse off # SQL query string that is sent to the database # Use same conversion specifiers has for text features # Additional special conversion specifiers are # %n = the number representing the file_type # %f = filename with full path # Default value: # Create tables : ## # Mysql # CREATE TABLE security (camera int, filename char(80) not null, frame int, file_type int, time_stamp timestamp(14), event_time_stamp timestamp(14)); # # Postgresql # CREATE TABLE security (camera int, filename char(80) not null, frame int, file_type int, time_stamp timestamp without time zone, event_time_stamp timestamp without time zone); # # insert into security(camera, filename, frame, file_type, time_stamp, text_event) values('%t', '%f', '%q', '%n', '%Y-%m-%d %T', '%C') ; sql_query insert into security(camera, filename, frame, file_type, time_stamp, event_time_stamp) values('%t', '%f', '%q', '%n', '%Y-%m-%d %T', '%C') ############################################################ # Database Options ############################################################ # database type : mysql, postgresql, sqlite3 (default : not defined) ; database_type value # database to log to (default: not defined) # for sqlite3, the full path and name for the database. ; database_dbname value # The host on which the database is located (default: localhost) ; database_host value # User account name for database (default: not defined) ; database_user value # User password for database (default: not defined) ; database_password value # Port on which the database is located # mysql 3306 , postgresql 5432 (default: not defined) ; database_port value # Database wait time in milliseconds for locked database to # be unlocked before returning database locked error (default 0) ; database_busy_timeout 0 ############################################################ # Video Loopback Device (vloopback project) ############################################################ # Output images to a video4linux loopback device # The value '-' means next available (default: not defined) ; video_pipe value # Output motion images to a video4linux loopback device # The value '-' means next available (default: not defined) ; motion_video_pipe value ############################################################## # camera config files - One for each camera. # Except if only one camera - You only need this config file. # If you have more than one camera you MUST define one camera # config file for each camera in addition to this config file. ############################################################## # Remember: If you have more than one camera you must have one # camera file for each camera. E.g. 2 cameras requires 3 files: # This motion.conf file AND camera1.conf and camera2.conf. # Only put the options that are unique to each camera in the # camera config files. ; camera /etc/motion/camera1.conf ; camera /etc/motion/camera2.conf ; camera /etc/motion/camera3.conf ; camera /etc/motion/camera4.conf ############################################################## # Camera config directory - One for each camera. ############################################################## # ; camera_dir /etc/motion/conf.d
enable daemon
set start_motion_daemon=yes in /etc/default/motion file
enable service
sudo systemctl enable motion.service sudo systemctl start motion.service
enable 1-Wire
sudo raspi-config
5 Interfacing Options -> P7 1-Wire -> enable
connect your 1-Wire device (here DS18b20)
Pin 1 (black) GND
Pin 2 (yellow) DATA (RPi GPIO 4 / Pin 7)
Pin 3 (red) VCC(+3.3V)
Connect Pin 2 & Pin 3 with 4,7 kOhm resistor (compare)
search for your device
ls /sys/bus/w1/devices/
e.g. 28-041650c7e4ff
get sensor value
temparray=($(cat /sys/bus/w1/devices/28-041650c7e4ff/w1_slave)) && echo ${temparray[21]} | cut -c3-7
bash file
#!/bin/bash CPUtemp=$(cat /sys/class/thermal/thermal_zone0/temp) echo "CPU temp=$CPUtemp'mC" GPUtemp=$(/opt/vc/bin/vcgencmd measure_temp) echo "GPU $GPUtemp" echo "CPU freq=$(cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq)" echo "CPU maxf=$(cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq)" echo "GPU RAM $(/opt/vc/bin/vcgencmd get_config sdram_freq)" echo "GPU Video core $(/opt/vc/bin/vcgencmd get_config core_freq)" echo "GPU 3D core $(/opt/vc/bin/vcgencmd get_config gpu_freq)"
to steadily view run
watch -n1 file.bash