Action LSC Alarm/Siren

Update 20221208 – removed internals

I’ve modded several LSC devices, most of them i could flash with esp-easy or tasmota.
Why mod it? Because it uses the cloud .. i’d like to keep control myself.
Just connect/solder a USB to TTL Converter UART Module like below.
(See other posts)

But this alarm was different, i ended up removing the chip and replace it with a ESP12.

Warning .. loud! .. Yes almost xmas
A WR3 is almost like a ESP-12

So now i had to figure out which GPIO pins and how to control them.

#1/bin/bash
# Flashed ESP Easy on this one
# When i did this, 2019, you needed version 2.1-beta1 
# GPIO 4 controls LED
sleep 10
curl http://10.1.1.251/control?cmd=GPIO,4,1
sleep 1
curl http://10.1.1.251/control?cmd=GPIO,4,0
sleep 1
curl http://10.1.1.251/control?cmd=GPIO,4,1
sleep 2
curl http://10.1.1.251/control?cmd=GPIO,4,0
sleep 5
# Sending rtttl ringtone
curl "http://10.1.1.251/control?cmd=rtttl,5:d=4,o=5,b=112:8a,8a,a,8a,8a,a,8a,8c6,8f.,16g,2a,8a-,8a-,8a-.,16a-,8a-,8a,8a.,16a,8a,8g,8g,8a,g,c6"



alarm sound
 curl "http://10.1.1.251/control?cmd=rtttl,5:d=4,o=5,b=160:2g,2c6,2g,2c6,2g,2c6,2g,2c6"
pager
 curl "http://10.1.1.251/control?cmd=rtttl,5:d=4,o=5,b=160:8d6,16p,2d6,16p,8d6,16p,2d6,16p,8d6,16p,2d6"

Update 20221208 – removed internals

Removed my old hack and replaced it with a Wemos D1.
Added a LED
Next to do .. add a amplifier using a LM356/358

Cocktail pictures and notebook

I like mixology

Some pictures of the drinks i’ve made, in the last years.

Most are in my notebook, i can perfect the drink now individually for a person.

I really have to put the names of the drinks on this page.
(And the tasting notes!)

Lidar POC for Vincent

Using Python, Raspberry, a lidar module, a servo, display .. and a 3Dprinted holder.

Proof of concept was to see if it was easy to implement a lidar radar for boat navigation.

#!/usr/bin/env python
import math
import random
import pygame
from pygame.locals import *
import time
import serial
import pigpio

GPIO = 18
ser = serial.Serial("/dev/ttyUSB0", 115200)

pi = pigpio.pi()
distance = 0
pygame.init()
screen = pygame.display.set_mode((480, 320))
while True:
        screen.fill((0,0,0))
        pygame.draw.circle(screen, (0,128,0), (240,320), 100,1)
        pygame.draw.circle(screen, (0,128,0), (240,320), 200,1)
        pygame.draw.circle(screen, (0,128,0), (240,320), 300,1)
        for deze in range(10,170,5):
            count = ser.in_waiting
            if count > 8:
                    recv = ser.read(9)
                    ser.reset_input_buffer()
                    if recv[0] == 'Y' and recv[1] == 'Y': # 0x59 is 'Y'
                        low = int(recv[2].encode('hex'), 16)
                        high = int(recv[3].encode('hex'), 16)
                        global distance
                        distance = low + high * 256
            res = distance
            #print res
            x =  res * math.cos(math.radians(deze))
            y =  res * math.sin(math.radians(deze))
            xreal = x + 240
            yreal = 320 - y
            pygame.draw.line(screen, (0, 255, 0), (240, 320), (xreal, yreal))

            pygame.time.wait(15)
            pygame.display.flip()
            #print(res)
            pi.set_servo_pulsewidth(GPIO, deze * 11 + 500)
            time.sleep(0.2)
        screen.fill((0,0,0))
        pygame.draw.circle(screen, (0,128,0), (240,320), 100,1)
        pygame.draw.circle(screen, (0,128,0), (240,320), 200,1)
        pygame.draw.circle(screen, (0,128,0), (240,320), 300,1)
        for deze in range(170,10,-5):
            count = ser.in_waiting
            if count > 8:
                    #print count
                    recv = ser.read(9)
                    ser.reset_input_buffer()
                    if recv[0] == 'Y' and recv[1] == 'Y': # 0x59 is 'Y'
                        low = int(recv[2].encode('hex'), 16)
                        high = int(recv[3].encode('hex'), 16)
                        global distance
                        distance = low + high * 256
            res = distance
            x =  res * math.cos(math.radians(deze))
            y =  res * math.sin(math.radians(deze))
            xreal = x + 240
            yreal = 320 - y
            pygame.draw.line(screen, (0, 255, 0), (240, 320), (xreal, yreal))
            pygame.time.wait(15)
            pygame.display.flip()
            pi.set_servo_pulsewidth(GPIO, deze * 11 + 500)
            time.sleep(0.2)
#pi.set_servo_pulsewidth(GPIO, 0)

Music Page Turner

UPDATE: 20230320 new version

My first version of the Bluetooth page turner.

This was made using an Arduino and some buttons.
I’m using Fbreader and Ebookdroid on the tablet.

Code:

Note: Volume buttons work for both apps, if you want to use other keys, you need to put a keymap.xml file in your fbreader books directory on your android device to remap those!

#include <BleKeyboard.h>

#define RIGHT_TURN 4
#define LEFT_TURN 5

BleKeyboard bleKeyboard("fashpageturner", "Bluetooth Device Manufacturer", 100);

void setup() {
  bleKeyboard.begin();
  
  pinMode(LEFT_TURN, INPUT_PULLUP);
  pinMode(RIGHT_TURN, INPUT_PULLUP);
}

void loop() {
  if (bleKeyboard.isConnected() && !digitalRead(RIGHT_TURN)) {
    bleKeyboard.press(KEY_MEDIA_VOLUME_UP);
    delay (100);
    bleKeyboard.releaseAll();
  }
  if (bleKeyboard.isConnected() && !digitalRead(LEFT_TURN)) {
    bleKeyboard.press(KEY_MEDIA_VOLUME_DOWN);
    delay (100);
    bleKeyboard.releaseAll();
  }

}

NEW Version

Arpscanner

Changed stuff in my arpscanner

I want to know whats on my network, and be informed when a alien device connects.
This also helps me gathering all devices and macaddresses for a cmdb.

I’ve got below in my crontab

5 * * * * root /usr/local/bin/arpscanner

And the script:

#!/bin/bash
# Using a scanner on a specific vlan/interface
arp-scan -l -g  -I p1p1.10 | grep ^10 | grep -vi packets > /var/log/arpscanner
cat /var/log/arpscanner | awk '{ print $2 }'| while read ; do
grep $REPLY /var/local/arpscanner.lst >/dev/null || echo $REPLY | mail -s arpscanner henri@henriaanstoot.nl
done

New and checked devices i put in the file mentioned above:
/var/local/arpscanner.lst

                00:21:5d:gg:gg:7a       Description
                ac:67:b2:gg:gg:a0       Liligo Twatch
                b8:27:eb:gg:dd:fd       Nieuwe octoprint
                d8:f1:5b:gg:gg:4a       WLAN Dungeon
                48:3f:da:gg:gg:fe       Uboot ESP
                8e:93:79:gg:gg:5d       Tablet Monique
                d8:f1:5b:gg:gg:06       ESP Radar
                dc:a6:32:gg:gg:fb       RPI4
                00:1e:ec:gg:gg:ab       laptop
                68:05:ca:gg:gg:68       storage bak

        etcetera

Machine Learning

Today i started with Coursera’s Machine Learning course.

My friend aloha is doing interesting stuff with ML, but recently i’ve been interested in a work related ML project.

Besides this course i’m following a spotify Podcast called “Machine Learning Guide”, i listen to this on my way to work and back.

I’ve been playing with a lot of code after that. Luckily there are many ebooks about this subject.

  • One of the first was a python program wich used the length of a person and shoesize to determine if it was a man or a woman
  • Another fun one was a program with could determine if a wine was red or white only based by a description
  • There are several graphic based programs i’ve tried. Deepfake, 8mm film enhancers, image classifiers, openface
  • For sound there was voice cloner to test. And audio to text (which i used to transcribe old cassette tapes and VHS tapes.

UPDATE: In 2022 i used what i have learned to enrich my photo metadata.
https://www.henriaanstoot.nl/2022/05/29/photo-manager-addition-using-ml/

Stupid bagpipe tricks

Playing two chanters at the same time.

Made a bagpipe octopus

I think it was Burns Night 2005. We took one pipebag, took the drones out. And added one blowpipe and three chanters.
We were struggling to play the damn beast with 4 people.

A picture should exist somewhere, add it when found.

Smallpipe adaptor for two chanters.

Xmas tree lights in the drones

I’ve seen some do this, but never with xmas balls also.

Playing the THX sound

Alternative playing

Above in the movie with two chanter you can see tape.
You can tape other notes, for accidentals.

I’ve started a set with our folkband with my hands reversed.
(Left on the bottom part of the chanter, right hand toppart)
After playing amazing grace, I switched hands every few bars.

Playing high A gracenote with tophand index finger.

Play a tune and slide bottomhand over your top hand down.

Tape or block the bottom sound holes.

A old old movie (2005?), when we lift our knees we close the bottom sound hole on the side of the chanter.

Playing with the holes on the inside

Best of Einaudi (lying down)

Music by Ludovico Einaudi, pianist Jeroen van Veen.
And you could lie down in the big “Werkspoorkathedraal” in Utrecht.

Ludovico Maria Enrico Einaudi (Italian: born 23 November 1955) is an Italian pianist and composer. Trained at the Conservatorio Verdi in Milan, Einaudi began his career as a classical composer, later incorporating other styles and genres such as pop, rock, folk, and world music.

Einaudi has composed the scores for a number of films and television productions, including This Is England, The Intouchables, I’m Still Here, the TV miniseries Doctor Zhivago, and Acquario (1996), Nomadland and The Father.

He has also released a number of solo albums for piano and other instruments, notably I Giorni in 2001, Nightbook in 2009, and In a Time Lapse in 2013.

Coline plays some of Einaudi on keyboard, and we play I Giorni with our Folkband.

Update 2023

Fermenting sauerkraut in a crock

We love fermenting!
Sometimes we ferment our own sauerkraut.

Depending on the volume it can take at least 2 weeks up to several months.

If you don’t have crock pot weights, use a plastic bag filled with water.
(See below)

Mixture: Salt, juniper berries, dill, celery seeds and caraway.

  • Rinse Cabbage and clean. Cut out and discard the hard white center.
  • Take the largest leaves from one cabbage and lay them out at the bottom of your clean and rinsed out crock pot.
  • Shred the rest of the cabbage.
  • Add a layer of shredded cabbage over the laid out leaves in the crock pot. Sprinkle some of above mixture over this layer. Compress by stomping down with the stomper.
  • Repeat the layering process until you used up all the cabbage, salt, and juniper berries. After each layer stomp it down.
  • Pour all the luke warm water over the cabbage. That will activate the fermentation process.
  • Place clean crock pot weights over the cabbage and close the crock pot with the lid. Pour water into the ring of your crock pot and make sure there is always water in that.
  • Wait several weeks until cabbage is done fermenting into Sauerkraut.

Some books about the subject we own

Little shared presentation thingy

This little script I made for work.
It allows for a webpage to being shared and updated semi realtime.

We made todo notes using it.

Extract below zip file in a subdirectory in your web accessible server.

https://media.henriaanstoot.nl/edit.tgz

Edit screen, note the little write me file button which is not visible in the movie below.
Example changing text (button press not visible)

It uses a jquery rich text editor javascript library.

"If something is worth doing, it's worth overdoing."