




Doc is the nickname/handle Hubert gave me. (Pipeband related)

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.)
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:
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.)
Some experiments
Getting sick
Linux tools to play with:
Hugin
and
http://www.fmwconcepts.com/imagemagick/pano2fisheye/index.php
Got bored, and challenged myself …
How about a quess the picture from our photo collection??
(123580 photos .. )
So i show a random picture, and when i press ESC it will show some information about the picture …
Quess the year and the event
Well i gave myself 15 minutes to program something ..
I was watching a tv show meanwhile .. but i managed to come up with this …
This script is showing a picture, when you press ESC it wil show some details.After that it will select another random picture.
Improvements : reading tags and other metadata from my photo database, to give more information.
#!/bin/bash while true ; do shuf -n 1 allpix > /tmp/randompix pix=$(cat /tmp/randompix | cut -f2 -d\> | cut -f1 -d\<) dir=$(cat /tmp/randompix | cut -f4 -d\> | cut -f1 -d\< |cut -f3 -d\; | sed 's#\\#/#g') displaypath=/mnt/${dir}/${pix} info=$(cat /tmp/randompix | rev | cut -f-4 -d\\ | rev | cut -f1 -d \<) convert -background black -fill white -size 1920x1080 -pointsize 24 label:"$info" info.jpg pqiv -i --fullscreen "$displaypath" pqiv -i --fullscreen info.jpg done
Which gave me … this
Welllll .. it toke 20 minutes .. so i lost
(Must have been the wine)
I was using zevv’s bucklespring way back since he was beta testing.
https://github.com/zevv/bucklespring
Also cool-retro-term, i used whenever i felt nostalgic.
But both at the same time, how much fun is that!
(Both newly installed on my laptop, which i had to reinstall, because i f*cked it up beyond repair. installing openxr stuff. OpenXR is an open, royalty-free standard for access to virtual reality and augmented reality platforms and devices.Β )
The lost ancient art of wire wrapping.
{funny story]
In 2019 i wanted to make a simple probe, which could detect 0 or 1 or a pulse. I wanted to make this on a little print using wirewrap wires and IC sockets. (I still have the tool which i used in the 90s.)
When going to a well-known electronics shop in Den Hague. A great shop to get all kinds of oldskool electronics. But i’m getting ahead of the story.
This shop has a lot of components for all kinds of electronics. New and what it looked like de-soldered component from boards or bought from old going-out-of-business shops or factories. Stuff you needed for 60s equipment.
Well i was at the counter, asking a old guy.
“Do you have wire-wrap wire”
He said: ” No that’s old skool” ….
{/funny story]
The wirewrap tool has a cable stripper. After stripping you would put a short part in the tool, place the tool over a IC pin and turning would wrap the wire on the pins.
You could stack multiple connections on one pin.
Removing could be done by turning the tool counterclockwise.
Sometimes you had to remove the one closest to the print, replacing all wires. (Or cut the wrong/not needed wire and leave it in place … )
I’m thinking of moving my breadboard 6502 to a wirewrapped version.
All my old boards are gone .. before i got a digital camera .. π
Example from a 8031 setup of a friend of mine
One of my first encounters with English Humour was when my wonderful teacher Mrs Walraven rolled in the old VCR-on-cart when i was going to technical secondary school (MTS)
She showed us Monty Python, Faulty Towers and Black Adder. THIS is the humour i like, this is for me!
So from that point on i wanted to see English Humour.
There are standup comedians i like, Billy Connolly (seen him live), Eddie Izzard (seen him live), Michael McIntyre and Jimmy Carr (tickets!!!) to name a few.
Life stories, wierd confronting idea’s and realisations of things , Real life observations and Dark humour. (in that order)
But i wanted to tell about TV shows (i try to place them in order):
Monty Python
One of the first things i saw, great stuff. Liked the movies also.
Black Adder
Loved the way it was the character Rowan Atkinson played got smarter every ‘season’, and Tony Robinson (Baldrick) was getting dumber.
The last ‘season’ WWI was when all things where exactly right.
(Yearly rewatch)
Not the nine o’clock news
This one i need to review
The Young Ones
A series that broke boundaries like Monty Python.
First time i notished the perfect duo, Rik Mayall and Ade Edmonson
Fawlty Towers
To few episodes, but each a brilliant piece of work.
Superb characters! (Yearly rewatch)
Red dwarf
Great stuff, loved the characters. And the space setting
Mr Bean
Great (silent) performance of Rowan Atkinson.
Liked his One man show more i think.
Bottom
Then i learned about Bottom. It was the genius jokes and performances.
The 5 liveshows where even more amazing. (Yearly rewatch)
Also i have to mention the movie : Guest House Paradiso
So i went looking for more:
Filthy Rich & Catflap
Secret Policeman’s Ball (not really a TV series)
Then i came across a oldie …
At last the 1948 show
A predecessor of Monty Python with Marty Feldman
Do not adjust your set
Also with guys who did Monty Python later on.
Today i was in Uist on holiday in Scotland, talking about these show.
The B&B owner said “Do you know – Ripping Yarns???”
So that’s the next to find and view!
Others i have to mention:
Alas Smith and Jones
The Bleak Old Shop of Stuff
Allo allo
Do i have some media of below Bofh stuff?
The Bastard Operator From Hell (BOFH) is a fictional rogue computer operator created by Simon Travaglia, who takes out his anger on users (who are “lusers” to him) and others who pester him with their computer problems, uses his expertise against his enemies and manipulates his employer.
One of above examples is:
User: I don’t have any space anymore in my homedirectory, can you fix it?
Operator: Sure,
.. logging in, deleting everything in users directory
.. “fixed”
User: Oh, thats fast, thanks (Unaware of empty directory)
Stuff i did
Β left Alt key + left Shift key + Print screen
We needed to clean up the mess in the serverroom.