Not much new

Last days .. welllll doing al kinds of stuff.

Composite video print designed and ordered from china.

Changed some vlans in my network.
I need to think of a way to extract/migrate domoticz 433 info into a new instance.
For example .. i’ve got some instances in my device list which are only being controlled by domoticz, there is no remote i can reuse.

Tried welding again, because i could not do it for a long time, i noticed i have to practice again after 2 years.
(I’ve got a dedicated power outlet outside now .. 🙂

Last 8mm films work done. (Converted all of my dad’s old 8mm reels)

Designed a hidden remote cabinet, holding remotes out of sight for the occasions when automation doesn’t work.

Designed also a wooden wall with hidden cabinets in our bedroom.

Repaired a Gardena Leafblower .. again!

An afternoon music with Irmgard

Missing playing music with our Folkband.
So i drove to Irmgard (our Harp player) to practice playing Concertina together!

Playing songs like:

  • Ă“rĂł SĂ© do Bheatha Bhaile
  • The Rathlin Bog
  • Donegal Mazurka
  • Lucy Farr’s Barndance
  • Primrose Lass
  • Planxty Irwin

Talked about methods of music notations for Concertina.
In ireland most folk is being taught by ear.

Some examples of notation

Most of these we learn using lessons from CaitlĂ­n Nic Gabhann

At the end of the afternoon i replaced some strings on her harp.
Made someone happy again.

Playing with my private search engine

Searx is a free and open-source metasearch engine, available under the GNU Affero General Public License version 3, with the aim of protecting the privacy of its users. To this end, Searx does not share users’ IP addresses or search history with the search engines from which it gathers results.

It’s easy to install using docker, but i wanted to add my own mysql server data. ( pipetune search engine data in below example )
There are many search plugins and quite hackable.
But there was a missing python module in a docker image.

ModuleNotFoundError: No module named ‘mysql’

So i build a new docker image based on the original

# Install docker and docker-compose

cd /usr/local
git clone https://github.com/searxng/searxng-docker.git
cd searxng-docker
Edit the .env file to set the hostname 
Generate the secret key sed -i "s|ultrasecretkey|$(openssl rand -hex 32)|g" searxng/settings.yml
Edit the searxng/settings.yml file according to your need
Check everything is working: docker-compose up
Run SearXNG in the background: docker-compose up -d

I’ve changed the docker-compose.yaml

Changed
<     image: searxng/searxng:latest

into 
>     build: .

And
changed the listen address
<      - "127.0.0.1:8080:8080"
into
>      - "8080:8080"

Created a Dockerfile

FROM searxng/searxng:latest
RUN pip install mysql-connector-python

Changed searxng/settings.yml

engines:
  - name: tunesdb
    engine: mysql_server
    host: 10.12.0.xx
    database: pipetunesearch
    username: xxxxxxx
    password: xxxxxxx
    limit: 50
    query_str: 'SELECT * from tunes WHERE tunename=%(query)s'

I could not use a like statement in de sql query .. have to look into that

    query_str: 'SELECT * from tunes WHERE tunename like %(query)%' .. doesn´t work

Example showing own data

To complete this post the reverse proxy info ..

<VirtualHost *:443>
   SSLEngine on
   SSLProxyEngine On

   SSLProtocol all -SSLv2 -SSLv3 +TLSv1
   SSLCipherSuite ALL:!ADH:!EXPORT:!SSLv2:!RC4+RSA:+HIGH:+MEDIUM

   SSLCertificateFile wildcard.cer
   SSLCertificateKeyFile my.key
   SSLCertificateChainFile GlobalSignRootCA.cer
   SSLCertificateChainFile AlphaSSLCA-SHA256-G2.cer

   CustomLog /var/log/httpd/search_ssl_request_log "%t %h %{SSL_PROTOCOL}x %{SSL_CIPHER}x \"%r\" %b"

    ServerAdmin webmaster@henriaanstoot.nl
    ServerName search.henriaanstoot.nl

ProxyRequests Off
ProxyPreserveHost On
SSLProxyVerify none
SSLProxyCheckPeerCN off
SSLProxyCheckPeerName off

<Location />
ProxyPass  http://dockerhostip:8080/
ProxyPassReverse  http://dockerhostip:8080/
</Location>

    ErrorLog /var/log/httpd/search.henriaanstoot.nl-error.log
    CustomLog /var/log/httpd/search.henriaanstoot.nl-access.log combined
</VirtualHost>

Whisky galore

Wild whisky days, so i bought two new Whisky’s ..

When there is only a little left, i keep some for nosing and nipping.

The little ones .. stored in my cocktail cabinet.

Util recently i’ve been using a android application to keep track.

Hedgehog home webcam

A while ago i made a little hedgehog home, so i bought a little ipcam from china .. It should be able to run for a while on a little lipo battery.

And yes we’ve got one in our garden, sometimes he hides under our patio.

So lets see if this cam is useful.

Composite video with Atmega328p

I started to get some composite video generated with a arduino for my 6502 project.

UPDATE: 20221021

It is based on Grant Searle’s design, and yesterday I had some signals on my scope which looked like a screen with a character. But my monitor would not recognize a usable signal.

Today I tried a second version and another set of chips and crystals.

It looks like a signal, but I can’t see a clock pulse from the crystal?! So .. how?

Maybe I used a bad power supply. And killed something?

UPDATE: 20221021

After switching to another power supply, and checking the atmega328p fuses again (also wrong) .. at least SOME success!

Still a little sync problem, but i’ve got a blinking cursor!
Some minipro info
#Erase
minipro -p ATMEGA328P@DIP28 -E

#Flash hex code
minipro -p ATMEGA328P@DIP28 -w SBCVideo.hex

#Flash fuses
minipro -p ATMEGA328P@DIP28 -e -c config -w fuses

#Used fuses file
lfuse = 0xf7
hfuse = 0xd9
efuse = 0xfc
lock = 0xff
lfuse = 0xff
hfuse = 0xff
efuse = 0xff
user_id0 = 0xff
user_id1 = 0xff
user_id2 = 0xff
user_id3 = 0xff
user_id4 = 0x37
user_id5 = 0x37
user_id6 = 0x39
user_id7 = 0x36


#Dump all from atmega328p
minipro -p ATMEGA328P@DIP28 -r dump -f ihex


Some info about the fuses:
https://www.allaboutcircuits.com/projects/atmega328p-fuse-bits-and-an-external-crystal-oscillator

Shelly Flood Sensor

I’ve had this Shelly sensor for a long time. But never posted anything about this.
Last weekend we had a -situation- in our kitchen, so what better time to test this device again!

This little disc shaped device has three metal points on its bottom side, those are the flood (water) sensors.
It stay’s in sleep mode when all’s good.
It does several things when it detects water.

  • Emits a alarm signal
  • Wakes-up wifi
    • Sends a MQTT message (when not connected to the cloud like i have)
      MQTT is a alarm message AND it wil send the temperature of the device!
  • After a while (when dry) goes back to sleep

There are connection point on the print you can use .. happy hacking!

My node-red configuration

Above is the part where the mqtt messages gets processed by Node-Red
Sending it to PushOver and my little MqttLcdNotifier

Above is the MqttLcdNotifer .. there are several parts to this

  • Top line is from shelly flood and other notifications
  • Text input puts text from the NR GUI on my TV and the LCDDisplay
    • same parts are being used by my 3D printer when the print tool is getting TO hot, or printing is finished
  • Trigger at work WAS a notification for work .. nonfunc
  • mqttlcd-button is the mqtt message send from the display (the one that i was pushing) to stop the beeping and clears the display
  • Bash notify, is as previously posted a flow which i can control from my linux machines notify “compiling complete” for example.
    This is also being broadcast from my livingroom using speakers.
    (See separate post about this)

Wellll, put this in place 2 years ago, never looked at it again .. still works

Volume is low, due to alarm sounds 🙂

7 segment displays/keyboard decoders in SDK’s

There are a lot of old develop boards for all kinds for cpu’s.

These where build to learn machine code programming. Mostly made in the 80’s, and based on populair cpu’s at that time.

I own a some of these SDK’s (System Design Kits)

8085 – SDK85 i bought recently 8085 CPU
Microprofessor-1 (MPF-1) Z80 CPU
And my own 680x based computer

Most of these use a keyboard scanner which is also connected to 7 segment displays.

The way they work is practically the same. There is a VIA or PIA. Versitile interface adaptor, or Peripheral interface adaptor. These have two times 8 bits to control devices.
When using 4 bits and convert these to 16 lines by using a 75ls145 for example. If you put a counter on those 4 bits, you sequently activate 1 of 16 lines. These lines you can use to scan a keyboard matrix OR display a character on a 7 segment display. These display’s won’t hold the data (and show the character) when not activated. The trick is to update de display fast enough so you don’t see the flickering on/off.

Activate a line and read a byte with the VIA = Reading keyboard row
Activate a line and write a byte with the VIA = Display on a segment

These VIA/PIA’s where made with specific timings to match the CPU.
6522/6820/8255

Below you see some different implementations of these keyboard/display combo’s

Thaler 6502 kit
Microprofessor MPF-1 kit (ignore red circle)
SDK85 kit
Eltec 6800
My version using darlington arrays (ULN2003)

When looking at the 8085 version you see transistors being a ULN2003 is a chip with those transistors/amplification enclosed.
It doesn´t draw much current from the bus, and diodes protect the way the current flows.

Quick n easy media viewer in a browser

Februari 2021 i made a website to view images and movies in a browser to do some quick sorting. (borrowed some code from a codepen page i recall correctly)
At the time i didn´t have a good way to view webp webm media.
I wanted to view multiple files at the same time, and make it short and simple.

BTW no webserver needed, just open the file from a directory!
jpg’s png’s webm webp mp4 svg and animated gifs work. (maybe more, didn’t test more, whatever your browser supports)

With recent updates of the chrome browser the video attributes to mute is broken, i so made a workaround.
Also everything is in one file now.
Except for one issue .. i couldn´t create one file for images AND videos.

There is a piece of javascript i could not fix … yet
I have to do execute a document.createElement which is different for images and videos.
Also the attributes of video are mute,autoplay,loop,playinline

Examples:

index.html

<a href="video.html">Video version</a>
<div id="drop-area">
  <form class="my-form">
    <label class="button" for="fileElem">Drop some images</label>
  </form>
  <div id="gallery" /></div>
</div>
<style>
body {
  font-family: sans-serif;
}
#drop-area {
  border: 2px solid #ccc;
}
.my-form {
  margin-bottom: 10px;
}
#gallery {
  margin-top: 10px;
}
#gallery img {
  width: 300px;
}
}
#fileElem {
  display: none;
}
</style>
<script>
let dropArea = document.getElementById("drop-area")
;['dragenter', 'dragover', 'dragleave', 'drop'].forEach(eventName => {
  dropArea.addEventListener(eventName, preventDefaults, false)   
  document.body.addEventListener(eventName, preventDefaults, false)
})
;['dragenter', 'dragover'].forEach(eventName => {
  dropArea.addEventListener(eventName, highlight, false)
})
;['dragleave', 'drop'].forEach(eventName => {
  dropArea.addEventListener(eventName, unhighlight, false)
})
dropArea.addEventListener('drop', handleDrop, false)
function preventDefaults (e) {
  e.preventDefault()
  e.stopPropagation()
}
function highlight(e) {
  dropArea.classList.add('highlight')
}
function unhighlight(e) {
  dropArea.classList.remove('active')
}
function handleDrop(e) {
  var dt = e.dataTransfer
  var files = dt.files
  handleFiles(files)
}
function handleFiles(files) {
  files = [...files]
  files.forEach(previewFile)
}
function previewFile(file) {
  let reader = new FileReader()
  reader.readAsDataURL(file)
  reader.onloadend = function() {
    let img = document.createElement('img')
    img.src = reader.result
    document.getElementById('gallery').appendChild(img)
  }
}
</script>

video.html

<a href="index.php">Images version</a>
<div id="drop-area">
  <form class="my-form">
    <label class="button" for="fileElem">Drop some videos</label>
  </form>
  <div id="gallery" /></div>
</div>
<style>
body {
  font-family: sans-serif;
}
#drop-area {
  border: 2px solid #ccc;
}
.my-form {
  margin-bottom: 10px;
}
#gallery {
  margin-top: 10px;
}
#gallery video {
  width: 300px;
}
}
#fileElem {
  display: none;
}
</style>
<script>
let dropArea = document.getElementById("drop-area")
;['dragenter', 'dragover', 'dragleave', 'drop'].forEach(eventName => {
  dropArea.addEventListener(eventName, preventDefaults, false)   
  document.body.addEventListener(eventName, preventDefaults, false)
})
;['dragenter', 'dragover'].forEach(eventName => {
  dropArea.addEventListener(eventName, highlight, false)
})
;['dragleave', 'drop'].forEach(eventName => {
  dropArea.addEventListener(eventName, unhighlight, false)
})
dropArea.addEventListener('drop', handleDrop, false)
function preventDefaults (e) {
  e.preventDefault()
  e.stopPropagation()
}
function highlight(e) {
  dropArea.classList.add('highlight')
}
function unhighlight(e) {
  dropArea.classList.remove('active')
}
function handleDrop(e) {
  var dt = e.dataTransfer
  var files = dt.files
  handleFiles(files)
}
function handleFiles(files) {
  files = [...files]
  files.forEach(previewFile)
}
function previewFile(file) {
  let reader = new FileReader()
  reader.readAsDataURL(file)
  reader.onloadend = function() {
    let video = document.createElement('video')
    video.setAttribute('volume', '0');
    video.setAttribute('height', '300');
    video.setAttribute('autoplay', true);
    video.setAttribute('loop', true);
    video.setAttribute('playsinline', true);
    video.setAttribute('oncanplay', 'this.muted=true');
    video.src = reader.result
    document.getElementById('gallery').appendChild(video)
  }
}
</script>

Management on old ILO instances

We bought some servers a while ago, but these have old ILO versions (2).

To manage these servers via ILO was no problem until modern browsers refuse to connect to these web services, because of TLS 1.0 issues.

So what i did was using a second user account on my workstation with a old (downloaded from a ESR archive) version firefox. To administer the ILO

wget https://ftp.mozilla.org/pub/firefox/releases/50.0/linux-x86_64/en-US/firefox-50.0.tar.bz2
extract in other users homedir

usage:
# ssh with X forwarding and start old version
ssh -X otheruser@localhost firefox/oldfirefox

While this was working for me on a debian based machine it didn’t work for my friend who was using Fedora on Wayland.

So i made a more generic solution which would work always. Also when working from windows.

I downloaded a old Fedora version ISO.
https://archives.fedoraproject.org/pub/archive/fedora/linux/releases/15/Fedora/x86_64/iso/
Using the DVD iso i knew the old JAVA was present.

So i started virt-manager and created a new virtual machine

Select your downloaded Fedora 15 ISO

Where is the thin option?!??!

Create a disk image for the OS, don’t worry about the size we are going to shrink it to a minimum (thin provisioned)

Booting from ISO
Do not forget to tick Customize now

Disable all thats not needed! .. Only Gnome Graphical internet .. and JAVA

Create users, complete the install and reboot.
Test your installation.
Shutdown

sudo qemu-img info /var/lib/libvirt/images/fedora15.qcow2
When above gives you a RAW image, you need to convert from RAW to QCOW first.
Mine showed a 9G qcow2 image .. far to large

sudo apt install guestfs-tools
virt-sparsify -v fedora15.qcow2 fedora15spars.qcow2

9665380352 okt 10 13:05 fedora15.qcow2
2926444544 okt 10 13:21 fedora15spars.qcow2
From 9 down to 3GB
Browser works

Testing the Java applet console

Success!

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