iobroker autostart script

The following script is always running but executes given commands only once after iobroker restarted (either via ‘iobroker restart’-command or via a system’s reboot). It does not need any additional objects etc. In this special case it checks in intervals if the Zigbee adapter is running, then restarts the adapter once (because of an issue that’s not part of this post). Please keep in mind: The script also executes every time it is saved. 

 

/*
    To run once after iob start / restart / system reboot.
    By using an interval with a simple logic
    the script can run infinetely but only executes the given actions once.
*/
const CHECKINTERVAL_ZIGBEE = 7500; //minimum. Query-command is SLOW
var bRunOnce = false;

let waitforZigbeeRunning;
let waitforZigbeeRestart;

let mainInterval = setInterval(function(){
    if(!bRunOnce){
        bRunOnce = true;
        waitforZigbeeRunning = setInterval(function(){
            //exec is SLOW 
            exec("iob status zigbee", function (error, stdout, stderr) {
                if(stdout.includes('is running')){
                    console.log('zigbee adapter detected as running. clearing checker-interval');
                    clearInterval(waitforZigbeeRunning);
                    waitforZigbeeRestart = setTimeout(function(){
                        console.log('run command 10 sec after clearing checker interval');
                        exec("iob restart zigbee", function (error, stdout, stderr) {});
                        sendTo('whatsapp-cmb.0', 'send', {
                            text: 'zigbee restartet 120 sec after clearing checker interval', 
                        });
                    }, 120000);
                }else{
                    //console.log('zigbee adapter not running yet');
                }
            });
        }, CHECKINTERVAL_ZIGBEE);
    }  
}, 1000);

Use FFmpeg to record from webcam, pipe output to FFplay

This code will record the video which is grabbed from an USB webcam and save it to a file. In parallel, it will output a preview to your screen by piping ffmpeg’s output into ffplay. The code is tested on a Raspberry Pi 5, the webcam in question is a Logitec c920. The output to screen has some noticeable lag and low resolution but it’s enough to help as a control.

 

ffmpeg -y -f v4l2 -input_format mjpeg -video_size 1280x720 -framerate 30 -i /dev/video0 -vcodec libx264 -an output.mp4 -f nut - | ffplay -i -

Der Branko

Es gibt so etwas wie eine regelmäßige Bandprobe, bei der ich mitmache. Es passieren Sachen im Umfeld von improvisiertem elektronischem HipHop- oder so. Ich spiele ClockBox und Sampler. Mein musikalischer Input hält sich im Rahmen, aber ich stehe nicht im Weg rum und habe die Midi Clockbox entwickelt, die das ganze Gerümpel synchronisert. Und manchmal bringe ich Bier mit. Deswegen werde ich geduldet.

Mein Zeug steht in der Mitte vom Bild.

Continue reading

Therapy

Content Warning: Gleich geht es nicht um Technik, Musik oder MIDI, sondern um geistige Gesundheit, Trauer, Tod und Angst. Nichts überdimensional Wildes – Dinge, die das Leben so mit sich bringt, aber wenn Du empfindlich bei solchen Themen bist, lies diesen Post einfach nicht weiter.

Continue reading

Misch-Mischpult-Pult

Es gibt bereits einige Ansätze dafür, allen gemein ist aber, dass sie nie erfolgreich waren: Ich suche schon sehr lange ein absolutes Mini-Mischpult mit Headphone-Cue. Gibt es nicht für schmales Geld und in der benötigten Größe. Also los, dieses Mal muss es klappen.

Die Basis dafür sind zwei identische Stereo-Mixer-Module von Aliexpress, Einzelpreis ca 8€.

Continue reading

Unattended installation of openFrameworks 0.12.0 on Raspberry PI 4

These are the instructions to get openFrameworks 0.12.0 on a Raspberry Pi 4 with Raspberry Pi OS 64 bit. These commands are based on a completely new system; meaning: your RPI just booted into an x-desktop for the first time from a freshly written sd-card or USB-stick. The process of downloading and building openFrameworks will take ~35 minutes. It’s completely unattended. At the end of the process you will be greeted with a running example-app.

sudo apt-get clean -y
sudo apt-get update
sudo apt-get upgrade -y

URL=https://github.com/openframeworks/openFrameworks/releases/download/0.12.0/of_v0.12.0_linuxaarch64_release.tar.gz
curl -L -o ofx.tar.gz $URL
tar -xf ofx.tar.gz
rm ofx.tar.gz
mv of_* openFrameworks
cd openFrameworks
export OF_ROOT=$(pwd)
cd $OF_ROOT/scripts/linux/debian/
yes y| sudo ./install_dependencies.sh
pkill yes
# add jack for compiling midistuff
cd $OF_ROOT/libs/openFrameworksCompiled/project/makefileCommon/
sed -i 's/PLATFORM_PKG_CONFIG_LIBRARIES += libcurl/PLATFORM_PKG_CONFIG_LIBRARIES += libcurl\nPLATFORM_PKG_CONFIG_LIBRARIES += jack/' config.linux.common.mk
# make Release -C $OF_ROOT/libs/openFrameworksCompiled/project
cd $OF_ROOT/examples/3d/3DPrimitivesExample/
#for ssh:
export DISPLAY=:0
make && make RunRelease

AMEOS Osnabrück, Station G2 – eine Rezension

Das ist eine Kopie und Erweiterung meiner Google-Rezension zur Station G2 des AMEOS Klinikums in Osnabrück. Die Betreiber versuchen seit mehr als 2 Jahren, meine Rezension auf Google zu blockieren. So weit so normal. Meine Erlebnisse halte ich dennoch für erzählenswert. Vielleicht hilft es anderen Angehörigen. Es folgt der Text aus der Rezension mit Ergänzungen und Korrekturen Ich werde mir Mühe geben, das nachvollziehbar zu gestalten.

Continue reading

Terrasse / Plattform

Nach dem Einzug ins Haus und den ersten Wochen der Neuorganisation wurde klar, dass wir unser Grundstück irgendwie nutzen wollen. Der Garten war noch eine komplette Mondlandschaft und es war völlig unrealistisch, irgendetwas anzugehen, dass mehr als ein Provisorium darstellen würde. Aber ich wollte un-be-dingt soetwas wie eine Terrasse haben. Deswegen flugs zum Baumarkt und Holz geholt. Kann ja nicht so schwer sein.

War auch nicht schwer. Nur anstrengend. Und ein Wochenende später hatten wir eine Terrasse Platform.

Continue reading