Tag Archives: funny

Tiny animator for stop-motion

I was working on a RP2040 HID project, but I needed some components I didn’t have … right now .. again ..

So I made something else ..

A tiny animator for stop motion animations using my webcam, python and OpenCV.

For claymotion or lego or whatever.

The program displays your webcam with the previous snapshot overlayed, so you can position everything relative to your previous snapshot.

Difference between two shots.

Press B to take a frame.

Just a proof of concept using a (BAD) webcam. (Don’t look at my hand )

CODE (short but you need OpenCV)

import  cv2
from datetime import datetime
# black is just a start empty image .. 
img=cv2.imread("black.png");
cap = cv2.VideoCapture(0)

while True: 

    ret,vid=cap.read()
    dim = (800,600)
    img1 = cv2.resize(img, dim, interpolation = cv2.INTER_AREA)
    vid1 = cv2.resize(vid, dim, interpolation = cv2.INTER_AREA)

    result=cv2.addWeighted(img1,0.5,vid1,0.5,0)
    cv2.imshow('overlay', result)
    if(cv2.waitKey(10) & 0xFF == ord('b')):
            now = datetime.now()
            current_time = now.strftime("%d_%m_%Y_%H_%M_%S")
            filename = '%s.png' % current_time
            if not cv2.imwrite(filename, vid1):
                raise Exception("Could not write image")
            img=cv2.imread(filename);

Pressing B fills your directory with PNG’s
like 24_10_2023_00_01_01.png (date formatted)

convert to GIF

convert -delay 10 -loop 0 24*.png animation.gif

Raspberry PI and Arduino black hole

This is NOT a post about the pi-hole project. Of which I apparantly never posted my setup.

I needed an extra PI for a project, and I always try to keep one spare.
But they are always gone, in use, missing .. whatever.

So I can´t work on this project right now, so lets rant about disappearing stuff

Like they are being sucked up in another dimension .. gone. WHERE ARE THEY?!?

How to keep track of them?

Any suggestions?


I used to have a sheet, but I often forget to keep track.
Do I use a MAC address scan on my switches?
First 3 parts of the Mac address are vendor specific.

So far i’ve found : Octopi, Beerbrew computer, Retro Arcade, Picore, Nodered, Domoticz 433toMqtt, Ledserver, Lasercutter-etch-a-sketch, mobile LMS music server, Pressure Lab AP, Escape Game AP (3 of them), one unused Raspberry zero (without Wifi), One at my old work, one broke, Kodi+Netflix,Ansible project, found another one .. Jumanji/Dashticz/NoderedDashboard demo (with screen)
WHERE THE F are the rest of them?
(Sdcards with temporary projects on them 29, I need to combine project on those cards. I’ve got a 64Gb card holding a Rpi OS and only a 1K python script!)

And Arduino’s are even worse … they are all over the place.
Those are probably 100+
(ESP32, 8266, Nano’s, Mega, M5Stack and alikes)

I know i have many temporary projects, but I keep most things organized in my projects containers.

One of the rows with Ikea containers, a few for bigger projects and now i’m using the plastic boxes you get when you order chinese or thai.

Comedians and standup comedy

I previously wrote about English Humour, now generic standup comedy.

I’ll write what I know and like, can you help me add to my list??!?
Only a few worth mentioning posted below.

I’m having a hard time to distinguish between One man shows, Standup comedians and alike.

Dutch/Belgium

English/Scottish/American

  • Billy Connolly – (Nothing I didn´t like about this guy’s humour)
  • Johnny “Bagpipes” Johnston – A comedian piper! (Got a dvd of his show)
  • Rowan Atkinson – His one man show
  • Eddie Izzard – History/general knowledge fantasy comedy
  • George Carlin

Other

  • Ismo Leikola – Finnish/American mostly word jokes
  • Ari Eldjárn – Icelandic language jokes

Oneliner cannons – ( Funny as hell, no long stories )

  • Stephen Wright
  • Mitch Hedberg

Music comedians

  • Johnny “Bagpipes” Johnston
  • Hans Liberg (NL)
  • Victor Borge ( Hans Liberg got a lot of his material from him )
  • Bill Bailey

Naughty

  • Ali Wong
  • Nikki Glaser
  • Jimmy Carr

Shaders using Bonzomagic

Saw some demo-scene shader showdowns on YT the other day.

Two guys live programming shaders in less than a hour!

Fun to play with .. bonzomagic.
This shader program is realtime being compiled and the effect is shown on the background.

Below version I made using a example is changing to the music being played. (Fast Fourier transform function, see my other post about this)

Quotes and slips of the tongue

Some cheesy stuff I found on my fileserver.
Mine/Friends or heared in the wild.

Hey kaas met ketchup? Of rasp ik nu te ver? (dutch)
(cheese with ketchup? Or am I grating too far?)

Coline in chat: I’m planning to go to sleep, but i was mentally ordering things in my head
My reply: cat /dev/head | sort -n > /dev/null && sleep $((8 * 2600))

Russisch routeren (dutch)
(Russian Routing) (Network joke about misconfiguring a router – like roulette)

Dashboard of my room kamer (windowsill)

Howmuch is that in beers?

me: I’ve seen better code
me also: But not written by me

Due to the recent coffee panic here, i think i need to prepare for the worst.. and go get a UPS for my backup coffee machine. (and bury cans of coffee in the garden)

Have you you seen the papers yet? Or are you waiting for the movie?

There are 1/12 problems according to the program
No problem at leas not 1 out of 0 !

We have no fruit left, only a sick banana

Take it easy, take it easy.
You can break things also slowly

Windows 95 – A world is closing for you.

Kapot gechmod (dutch and it rhymes)
Break something using linux chmod command

I don’t have a smart TV, I need to be smart myself

A beautiful mind is about a misunderstood genius
Happens to me also sometimes

Worldwide standard .. in Enschede

That dude was so drunk, he spoke encrypted

How long a drive was it?
About 1 liter

Will you rewind the CD after using it please?

Better to have 10 beers in you, than 1 on the street

if microsoft is the answer you didn’t understand the question

The release date of windows 2000 will be delayed, the new releasedate will be 14-04-1901

That whisky bottle is square!
Nice, no wet circles on the table

That trashcan bag is too big!
Maybe it is supposed to be on the outside

Sparkling water = water with holes

Many orgasms in the water .. organism

Sollution for everything, apply some glue and some pressure

I have to go, I have to catch the bike in 5 minutes

I heared some fireworks, mid year.
And said “maybe they are marsians”, we have to check if they lighting fireworks over 687 days again.

Weird comix, doodles and drawings i did

Blind parents often think their children are blind due to genetics.
Miffy learns DNS (Domain Name resolving)
Biological fly fly swatter trap

Here comes the plane!! ..
Fear for flying learned at a young age
More realistic spiderman

Postman, please drop some catfood in the mailbox every day?
Stopcontact = powersocket, spijkers = nails, aquariumslang met water = hose with water, lampje = lamp and using a clothespin to turn light off or dimming it
If you know .. you know
Waldorf and Statler (Vincent and me)
A friend and I having both backpains, mixing pills and alcohol will do the trick? Made a blender image to post in our Mattermost channel

Radar module RCWL-0516 with MQTT

RCWL-0516 module (radar)

Last year i was playing with this radar module also, but today i made a version with MQTT and a linux client.
(There is a project on the internet which uses a HC-SR04, and a arduino connected to the Laptop. This setup is more sensitive and no need for a usb thinghy.)

HC-SR04 module (ultrasound)

Last years version, using a micro transformer and a ESP-12

When using MQTT i can integrate this in HomeAssistant, Domoticz, NodeRed and more.
But i’ve written a python script which runs on my Laptop.
For example i can: Kill vlc, change to my work desktop, stop sound output and lock the screen. (everything you can script)

I wanted to have a “mobile” version of the sensor so i can place it anywhere. (Frontdoor, gardengate, candydrawer 🙂 )

These modules are very cheap, but do their job well!

I’ve used a Wroom ESP32 and a BattBorg together with the module, that’s it.

Simplified schematic (without the battborg)

I’m using PIN34 as an analog input.

Radar module pins:

  • CDS not used
  • VIN 5V power
  • OUT 0-3.3V signal (analog)
  • GND
  • 3v3 not used

Arduino sketch

#include <WiFi.h>
#include <PubSubClient.h>
#include <Wire.h>

const char* ssid = "MYSSID";
const char* password = "MYPASS";
const char* mqtt_server = "IP-MQTT-SERVER";
const char* mqtt_username = "";
const char* mqtt_password = "";
const char* clientID = "radar";

const int tiltPin = 34;
int tiltState = 0;    
int previousState = 0;   

WiFiClient espClient;

PubSubClient client(espClient);

String translateEncryptionType(wifi_auth_mode_t encryptionType) {
 
  switch (encryptionType) {
    case (WIFI_AUTH_OPEN):
      return "Open";
    case (WIFI_AUTH_WEP):
      return "WEP";
    case (WIFI_AUTH_WPA_PSK):
      return "WPA_PSK";
    case (WIFI_AUTH_WPA2_PSK):
      return "WPA2_PSK";
    case (WIFI_AUTH_WPA_WPA2_PSK):
      return "WPA_WPA2_PSK";
    case (WIFI_AUTH_WPA2_ENTERPRISE):
      return "WPA2_ENTERPRISE";
  }
}
 
void scanNetworks() {
   int numberOfNetworks = WiFi.scanNetworks();
   Serial.print("Number of networks found: ");
  Serial.println(numberOfNetworks);
   for (int i = 0; i < numberOfNetworks; i++) {
 
    Serial.print("Network name: ");
    Serial.println(WiFi.SSID(i));
 
    Serial.print("Signal strength: ");
    Serial.println(WiFi.RSSI(i));
 
    Serial.print("MAC address: ");
    Serial.println(WiFi.BSSIDstr(i));
 
    Serial.print("Encryption type: ");
    String encryptionTypeDescription = translateEncryptionType(WiFi.encryptionType(i));
    Serial.println(encryptionTypeDescription);
    Serial.println("-----------------------");
 
  }
}
 
void connectToNetwork() {
  WiFi.begin(ssid, password);
   while (WiFi.status() != WL_CONNECTED) {
    delay(1000);
    Serial.println("Establishing connection to WiFi..");
  }
   Serial.println("Connected to network");
 }

void reconnect() {
  while (!client.connected()) {
    if (client.connect(clientID, mqtt_username, mqtt_password)) {
    } else {
      delay(2000);
    }
  }
}
void setup()
{
  {
    Serial.begin(115200);
    scanNetworks();
    connectToNetwork();
    Serial.println(WiFi.macAddress());
    Serial.println(WiFi.localIP());
    client.setServer(mqtt_server, 1883);
    pinMode(tiltPin, INPUT);
  }
}
void loop() {
  tiltState = analogRead(tiltPin);
    if (tiltState < 3048) {
      client.publish("radar/state", "0"); //
    } else {
      client.publish("radar/state", "1"); //
    }
     delay(100);
   {
    if (!client.connected()) {
      reconnect();
    }
    client.loop();
  }
}

Lockscreen!

Below shows the speed of detection, and sending though the network

Python script which does a lock-screen using XDOTOOL

from paho.mqtt import client as mqtt_client
import subprocess
import time

broker = 'MQTT-SERVER'
port = 1883
topic = "radar/state"
client_id = "radarclient"

def connect_mqtt() -> mqtt_client:
    def on_connect(client, userdata, flags, rc):
        if rc == 0:
            print("Connected to MQTT Broker!")
        else:
            print("Failed to connect, return code %d\n", rc)

    client = mqtt_client.Client(client_id)
    client.on_connect = on_connect
    client.connect(broker, port)
    return client

def subscribe(client: mqtt_client):
    def on_message(client, userdata, msg):
        state = msg.payload.decode()
        print (state)
        if state == "1":
            subprocess.Popen(["xdotool","key","Super_L+l"])
            time.sleep(30)


    client.subscribe(topic)
    client.on_message = on_message

def run():
    client = connect_mqtt()
    subscribe(client)
    client.loop_forever()

if __name__ == '__main__':
    run()

change
subprocess.Popen([“xdotool”,”key”,”Super_L+l”])
into
subprocess.Popen([“switchdesktop”])
to run a script named switchdesktop

#!/bin/bash
# This is the switchdesktop script, it goes to the next screen using winows-page-down combo
xdotool key "Super_L+Page_Down"

Todo:

3D print a case
Make a version which becomes a Access Point.
Then make another arduino setup which controls my Nikon.
So it can act like a wildcam (offline)

Something like below, using a optocoupler ( i still got some leftovers from my doorbell to gpio-pin project.)