Autostart fuer das Google AIY-VoiceKit

2. Januar 2018

Fuer das Google AIY-VoiceKit ist auf
https://github.com/google/aiyprojects-raspbian/blob/aiyprojects/HACKING.md#running-automatically
beschrieben, wie man die Spracherkennung automatisch starten lassen kann.

Allerdings scheint dies nur fuer altere Images der Software zu klappen, oder wenn man sein eigenes Raspbian per Git mit der Software bestueckt.

Ich hatte das aktuelle Image
https://dl.google.com/dl/aiyprojects/voice/aiyprojects-2017-09-11.img.xz
zum aufsetzen genommen, aber da fehlt z.B. die Datei voice-recognizer.service

Erst hatte ich mir ein Script geschrieben, um die Erkennung ueber die /etc/rc.local zu starten als User pi

Nun habe ich mir – aufgrund der AIY Facebookgruppe – nochmal die Moeglichkeit es als Service zu starten angesehen.
Ich habe also per wget die Datei runtergeladen, editiert, umkopiert, mein Script deaktiviert und aus dem normalen Script zur Erkennung die main.py erzeugt/kopiert.

Nun startet die Erkennung auf meinem AYI per Service.

Hier nun fuer mich als Gedankenstuetze und andere zum nachvollziehen:

root@raspberrypi:/home/pi/AIY-voice-kit-python/systemd# wget https://raw.githubusercontent.com/google/aiyprojects-raspbian/aiyprojects/systemd/voice-recognizer.service
root@raspberrypi:/home/pi/AIY-voice-kit-python/systemd# nano voice-recognizer.service
root@raspberrypi:/home/pi/AIY-voice-kit-python/systemd# cp ./voice-recognizer.service /lib/systemd/system/
root@raspberrypi:/home/pi/AIY-voice-kit-python/systemd# systemctl enable voice-recognizer.service
Created symlink from /etc/systemd/system/multi-user.target.wants/voice-recognizer.service to /lib/systemd/system/voice-recognizer.service.
root@raspberrypi:/home/pi/AIY-voice-kit-python/src# cp ./assistant_library_demo.py ./main.py
root@raspberrypi:/home/pi/AIY-voice-kit-python/src# reboot


# ————————————————————————————————–
# File: voice-recognizer.service
# This service can be used to run your code automatically on startup. Look in
# HACKING.md for instructions on creating main.py and enabling it.

[Unit]
Description=voice recognizer
After=network.target ntpdate.service

[Service]
Environment=VIRTUAL_ENV=/home/pi/AIY-voice-kit-python/env
Environment=PATH=/home/pi/AIY-voice-kit-python/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
ExecStart=/home/pi/AIY-voice-kit-python/env/bin/python3 -u src/main.py
WorkingDirectory=/home/pi/AIY-voice-kit-python
StandardOutput=inherit
StandardError=inherit
Restart=always
User=pi

[Install]
WantedBy=multi-user.target
# ————————————————————————————————–

Advertisements

RPi-Monitor/OPi-Monitor /etc/rpimonitor/template/sdcard.conf

9. Oktober 2017

fuer Orange Pi Zero verbesserte Version von George Poulson (FB):

https://pastebin.com/Fr0irRAg

########################################################################
# Extract SDCard information
# Page: 1
# Information Status Statistics
# – root total – yes – yes
# – root used – yes – yes
# – boot total – no – no
# – boot used – no – no
########################################################################
static.7.name=sdcard_root_total
static.7.source=df /
static.7.regexp=\S+\s+(\d+).*\/$
static.7.postprocess=$1/1024

#static.8.name=sdcard_boot_total
#static.8.source=df /boot
#static.8.regexp=\S+\s+(\d+).*\/boot$
#static.8.postprocess=$1/1024

dynamic.6.name=sdcard_root_used
dynamic.6.source=df /
dynamic.6.regexp=\S+\s+\d+\s+(\d+).*\/$
dynamic.6.postprocess=$1/1024
dynamic.6.rrd=GAUGE

#dynamic.7.name=sdcard_boot_used
#dynamic.7.source=df /boot
#dynamic.7.regexp=\S+\s+\d+\s+(\d+).*\/boot$
#dynamic.7.postprocess=$1/1024
#dynamic.7.rrd=GAUGE

web.status.1.content.7.name=SD card
web.status.1.content.7.icon=sd.png
#web.status.1.content.7.line.1=“<b>/boot</b> Used: <b>“+KMG(data.sdcard_boot_used,’M‘)+“</b> (<b>“+Percent(data.sdcard_boot_used,data.sdcard_boot_total,’M‘)+“</b>) Free: <b>“+KMG(data.sdcard_boot_total-data.sdcard_boot_used,’M‘)+ „</b> Total: <b>“+ KMG(data.sdcard_boot_total,’M‘) +“</b>“
#web.status.1.content.7.line.2=ProgressBar(data.sdcard_boot_used,data.sdcard_boot_total,60,80)
web.status.1.content.7.line.1=“<b>/</b> Used: <b>“+KMG(data.sdcard_root_used,’M‘) + „</b> (<b>“ + Percent(data.sdcard_root_used,data.sdcard_root_total,’M‘)+“</b>) Free: <b>“+KMG(data.sdcard_root_total-data.sdcard_root_used,’M‘)+ „</b> Total: <b>“+ KMG(data.sdcard_root_total,’M‘) + „</b>“
web.status.1.content.7.line.2=ProgressBar(data.sdcard_root_used,data.sdcard_root_total,60,80)

#web.statistics.1.content.3.name=Disks – boot
#web.statistics.1.content.3.graph.1=sdcard_boot_total
#web.statistics.1.content.3.graph.2=sdcard_boot_used
#web.statistics.1.content.3.ds_graph_options.sdcard_boot_total.label=Size of /boot (MB)
#web.statistics.1.content.3.ds_graph_options.sdcard_boot_total.color=“#FF7777″
#web.statistics.1.content.3.ds_graph_options.sdcard_boot_used.label=Used on /boot (MB)
#web.statistics.1.content.3.ds_graph_options.sdcard_boot_used.lines={ fill: true }
#web.statistics.1.content.3.ds_graph_options.sdcard_boot_used.color=“#7777FF“

web.statistics.1.content.4.name=Disks – root
web.statistics.1.content.4.graph.1=sdcard_root_total
web.statistics.1.content.4.graph.2=sdcard_root_used
web.statistics.1.content.4.ds_graph_options.sdcard_root_total.label=Size of / (MB)
web.statistics.1.content.4.ds_graph_options.sdcard_root_total.color=“#FF7777″
web.statistics.1.content.4.ds_graph_options.sdcard_root_used.label=Used on / (MB)
web.statistics.1.content.4.ds_graph_options.sdcard_root_used.lines={ fill: true }
web.statistics.1.content.4.ds_graph_options.sdcard_root_used.color=“#7777FF“
########################################################################

RPi-Monitor/OPi-Monitor /etc/rpimonitor/template/memory.conf

9. Oktober 2017

fuer Orange Pi Zero verbesserte Version von George Poulson (FB):
https://pastebin.com/cpjB9y0U

########################################################################
# Extract Memory information
# Page: 1
# Information Status Statistics
# – memory total – yes – yes
# – memory free – yes – yes
# – memory available – yes – yes
########################################################################
static.5.name=memory_total
static.5.source=/proc/meminfo
static.5.regexp=MemTotal:\s+(\d+)
static.5.postprocess=$1/1024

dynamic.9.name=memory_free
dynamic.9.source=/proc/meminfo
dynamic.9.regexp=MemFree:\s+(\d+)
dynamic.9.postprocess=$1/1024
dynamic.9.rrd=GAUGE

dynamic.15.name=memory_available
dynamic.15.source=/usr/bin/free -mk
#dynamic.15.regexp=^-\/\+ buffers\/cache:\s+\d+\s+(\d+)
dynamic.15.regexp=Mem:\s+\d+\s+\d+\s+\s+\d+\s+\s+\d+\s+\d+\s+(\d+)
dynamic.15.postprocess=$1/1024
dynamic.15.rrd=GAUGE

web.status.1.content.5.name=Memory
web.status.1.content.5.icon=memory.png
web.status.1.content.5.line.1=“Used: <b>“ + KMG(data.memory_total-data.memory_available,’M‘) + „</b> (<b>“ + Percent(data.memory_total-data.memory_available,data.memory_total,’M‘) + „</b>) Available: <b>“ + KMG(data.memory_available,’M‘) + „</b> Total: <b>“ + KMG(data.memory_total,’M‘) + „</b>“
web.status.1.content.5.line.2=ProgressBar(data.memory_total-data.memory_available,data.memory_total)

web.statistics.1.content.6.name=Memory
web.statistics.1.content.6.graph.1=memory_total
web.statistics.1.content.6.graph.2=memory_free
web.statistics.1.content.6.graph.3=memory_available
web.statistics.1.content.6.ds_graph_options.memory_total.label=Total Memory(MB)
web.statistics.1.content.6.ds_graph_options.memory_free.label=Free Memory (MB)
web.statistics.1.content.6.ds_graph_options.memory_free.color=“#7777FF“
web.statistics.1.content.6.ds_graph_options.memory_available.label=Available Memory (MB)
web.statistics.1.content.6.ds_graph_options.memory_available.color=“#77FF77″
########################################################################

whitelist Servernamen fuer Google-Adds auf Google-Suchseite

4. Oktober 2017

dartsearch.net
clickserve.dartsearch.net
googleadservices.com
www.dartsearch.net
www.googleadservices.com

ansonsten kann man keine Angebote aufrufen, die auf der Google-Seite angeboten werden

whitelist server fuer Pi-Hole und spiegel.de

4. Oktober 2017

imagesrv.adition.com

Banana Pi M2 Berry umstellen zwischen 720p und 1080p

4. Oktober 2017

bpi-bootsel /usr/lib/u-boot/bananapi/bpi-m2u/BPI_M2U_1080P.img.gz
/usr/lib/u-boot/bananapi/bpi-m2p/BPI-M2P-1080P.img.gz

Disks: (lsblk | grep disk)
mmcblk0 179:0 0 28.8G 0 disk

Disks: (fdisk -l | grep Disk | grep bytes)
Disk /dev/mmcblk0: 28.8 GiB, 30908350464 bytes, 60367872 sectors
root@m2berry:/# bpi-bootsel /usr/lib/u-boot/bananapi/bpi-m2u/BPI_M2U_1080P.img.gz
Warning: Try to write to BOOTDISK /dev/mmcblk0
INFO: /dev/mmcblk0 : SD/eMMC !!
umount device: /dev/mmcblk0
umount /dev/mmcblk0p1

##########################
# Burning the bootloader #
##########################

sudo gunzip -c /usr/lib/u-boot/bananapi/bpi-m2u/BPI_M2U_1080P.img.gz | dd of=/dev/mmcblk0 bs=1024 seek=8
sudo: unable to resolve host m2berry

102392+0 records in
102392+0 records out
104849408 bytes (105 MB, 100 MiB) copied, 33.2562 s, 3.2 MB/s
sudo: unable to resolve host m2berry
OK!! You can reboot the system now!!

bpi-bootsel /usr/lib/u-boot/bananapi/bpi-m2u/BPI_M2B_720P.img.gz

Initiale Befehle fuer Mystic BBS

4. Oktober 2017

lokaler Login:
/mystic/mystic -l

Config:
/mystic/mystic -cfg

Server as daemon:
/mystic/mis -d

Server im Fenster:
/mystic/mis

Get back eth0 and wlan0 in debian 9 stretch

4. Oktober 2017

http://www.itzgeek.com/how-tos/mini-howtos/change-default-network-name-ens33-to-old-eth0-on-ubuntu-16-04.html

sudo vi /etc/default/grub

from

GRUB_CMDLINE_LINUX=““

to

GRUB_CMDLINE_LINUX=“net.ifnames=0 biosdevname=0″

then

sudo grub-mkconfig -o /boot/grub/grub.cfg

Slow down Allwinner H3-device

4. Oktober 2017

echo 0 >/sys/devices/system/cpu/cpu3/online
echo 0 >/sys/devices/system/cpu/cpu2/online
echo 0 >/sys/devices/system/cpu/cpu1/online
echo 408000 >/sys/devices/platform/sunxi-ddrfreq/devfreq/sunxi-ddrfreq/userspace/set_freq

echo 0 >/sys/devices/system/cpu/cpu3/online
echo 0 >/sys/devices/system/cpu/cpu2/online
echo 0 >/sys/devices/system/cpu/cpu1/online
echo 264000 >/sys/devices/platform/sunxi-ddrfreq/devfreq/sunxi-ddrfreq/userspace/set_freq

h3consumption -m 912 -c 4 -d 408 -g off -u on -e fast -w on
h3consumption -m 912 -c 1 -d 408 -g off -u on -e fast -w on
h3consumption -m 912 -c 1 -D 132 -g off -u on -e fast -w on
h3consumption -m 912 -c 1 -D 132 -g off -u on -e fast -w off

man command installieren fuer man-pages

4. Oktober 2017

apt-get install man-db