Category Archives: Computer

Divers …

Running into some Ubuntu machines with keyboard mouse problems after upgrading to 24.04

fix:

apt get install xserver-xorg-input-synaptics
apt get install xserver-xorg-input-all

3D printing some test models generated with AI from a photo to make some boardgame pieces.

Meanwhile, I am testing big motor controllers for a new client.

Last week I was at a friend’s place, time to make a launcher creator in bash

#!/bin/bash
#
if [ $# -lt 2 ]; then
	echo "createlauncher.sh name (path/bin) path/name"
    exit 1
fi


cat << EOF > /tmp/$1
[Desktop Entry]
Type=Application
Terminal=false
Name=$1
Icon=~/bin/icon/$1.png
Exec=$2 $3
EOF

cp /tmp/$1  ~/.local/share/applications/$1.desktop
update-desktop-database

Made a cable holder in my lab (Already modded)
Can be folded upwards.

Did a lot of work in my new lab/workshop.

Got some cool new tools in. Post later

Also working on a new arrangement for a bagpipe tune.

Mega PC tower and Book

I’ve printed two books using the Lulu service. (One for Tyrone)
When they arrived, I noticed some faults.
Lucky Lulu will be printing them again for me.

The book has over 500 pages and has a nice hardcover.

And I’ve been busy building a Mega Tower with 4 Motherboards.
This will have a superb processing power! .. not.
It houses some old motherboards for hardcore machine coding on real old hardware.

From top to bottom: 8088, 8086, 80386, 80484

Todo:

  • Rework on the cables
  • 3D print an information plaque on the front of each board
  • Add a control panel on each board
  • Maybe some dust cover would be nice

I can remove the boards, and place them on a table.
I’ve made some custom feet for them. Twist and lock by my own design.

Padded feet

The openscad files:

The locking is done by making the cylinder slightly oval by 0.5mm

difference(){
	difference(){
		difference(){
			difference(){
				rotate([90,30,0])
				cylinder(r=30, h=10, $fn=3);
				translate([-20,-20,0])
				cube([40,40,40]);
				}
			rotate([90,0,0])
			translate([0,0,-10])
			cylinder(r=5, h=30, $fn=200);
			translate([0,-5,-10])
			cylinder(r=7, h=30, $fn=200);
			}
		translate([18,-5,-12])
		cylinder(r=4, h=30, $fn=200);
		translate([18,-5,-22])
		cylinder(r=2.2, h=30, $fn=200);
		translate([-18,-5,-12])
		cylinder(r=4, h=30, $fn=200);

		translate([-18,-5,-22])
		cylinder(r=2.2, h=30, $fn=200);
		}
	translate([9,-20,-20])
	cube([40,40,40]);
}

Note the resize for the oval effect

resize([14,14.5,10])
cylinder(r=7, h=10, $fn=200);
translate([0,0,0])
cylinder(r=9, h=3, $fn=200);

When designing above, I also made new knobs for our stove.
Using the white dot, you can see which burner has which knob.

Busy building my new workspace but meanwhile I am playing with machine learning

I needed more space for my business, so I moved to my big workshop space where our music studio was.

I’ve installed Yolo (v8) and generated an image using ChatGPT with many objects.

Installing Yolo:
See https://docs.ultralytics.com/quickstart/#install-ultralytics

Generated image

Using below python script I get a text file with hits and an image with objectboxes.

import cv2
import random
from ultralytics import YOLO
# Load YOLOv8 model
model = YOLO('yolov8n.pt')  
input_image_path = 'input.jpg'
image = cv2.imread(input_image_path)
def get_random_color():
    return [random.randint(0, 255) for _ in range(3)]
class_colors = {i: get_random_color() for i in range(len(model.names))}
results = model(input_image_path)
output_txt_path = 'output.txt'
with open(output_txt_path, 'w') as f:
    for result in results:
        for box in result.boxes:
            cls = int(box.cls[0])  
            confidence = box.conf[0].item() 
            bbox = box.xyxy[0].cpu().numpy()
            class_name = model.names[cls]
            # Write text file
            f.write(f"Class: {class_name}, Confidence: {confidence:.2f}, BBox: {bbox}\n")
            color = class_colors[cls]
            cv2.rectangle(image, 
                          (int(bbox[0]), int(bbox[1])), 
                          (int(bbox[2]), int(bbox[3])), 
                          color, 3)  # Thicker rectangle
            label = f'{class_name} {confidence:.2f}'
            font_scale = 1.0  # Larger font size
            font_thickness = 2  # Thicker font
            cv2.putText(image, 
                        label, 
                        (int(bbox[0]), int(bbox[1]) - 10), 
                        cv2.FONT_HERSHEY_SIMPLEX, 
                        font_scale, color, font_thickness)
output_image_path = 'output_with_boxes.jpg'
cv2.imwrite(output_image_path, image)
print(f"Detected objects saved to {output_txt_path}")
print(f"Output image with boxes saved to {output_image_path}"

Text file

Class: car, Confidence: 0.91
Class: car, Confidence: 0.90
Class: giraffe, Confidence: 0.90
Class: car, Confidence: 0.87
Class: bicycle, Confidence: 0.85
Class: person, Confidence: 0.77
Class: person, Confidence: 0.68
Class: bus, Confidence: 0.66
Class: sheep, Confidence: 0.64
Class: zebra, Confidence: 0.62
Class: umbrella, Confidence: 0.60
Class: bicycle, Confidence: 0.56
Class: umbrella, Confidence: 0.54
Class: airplane, Confidence: 0.52
Class: person, Confidence: 0.51
Class: person, Confidence: 0.48
Class: bicycle, Confidence: 0.44
Class: person, Confidence: 0.43
Class: stop sign, Confidence: 0.40
Class: umbrella, Confidence: 0.39
Class: motorcycle, Confidence: 0.39
Class: bicycle, Confidence: 0.38
Class: person, Confidence: 0.37
Class: person, Confidence: 0.35
Class: teddy bear, Confidence: 0.29
Class: truck, Confidence: 0.27
Class: airplane, Confidence: 0.26
Class: bus, Confidence: 0.25
Class: person, Confidence: 0.25

Code for real-time detection using a webcam.

from ultralytics import YOLO
import cv2
import math 
# start webcam
cap = cv2.VideoCapture(0)
cap.set(3, 640)
cap.set(4, 480)
# model
model = YOLO("yolo-Weights/yolov8n.pt")
# object classes
classNames = ["person", "bicycle", "car", "motorbike", "aeroplane", "bus", "train", "truck", "boat",
              "traffic light", "fire hydrant", "stop sign", "parking meter", "bench", "bird", "cat",
              "dog", "horse", "sheep", "cow", "elephant", "bear", "zebra", "giraffe", "backpack", "umbrella",
              "handbag", "tie", "suitcase", "frisbee", "skis", "snowboard", "sports ball", "kite", "baseball bat",
              "baseball glove", "skateboard", "surfboard", "tennis racket", "bottle", "wine glass", "cup",
              "fork", "knife", "spoon", "bowl", "banana", "apple", "sandwich", "orange", "broccoli",
              "carrot", "hot dog", "pizza", "donut", "cake", "chair", "sofa", "pottedplant", "bed",
              "diningtable", "toilet", "tvmonitor", "laptop", "mouse", "remote", "keyboard", "cell phone",
              "microwave", "oven", "toaster", "sink", "refrigerator", "book", "clock", "vase", "scissors",
              "teddy bear", "hair drier", "toothbrush"
              ]
while True:
    success, img = cap.read()
    results = model(img, stream=True)
    # coordinates
    for r in results:
        boxes = r.boxes
        for box in boxes:
            # bounding box
            x1, y1, x2, y2 = box.xyxy[0]
            x1, y1, x2, y2 = int(x1), int(y1), int(x2), int(y2) # convert to int values
            # put box in cam
            cv2.rectangle(img, (x1, y1), (x2, y2), (255, 0, 255), 3)
            # confidence
            confidence = math.ceil((box.conf[0]*100))/100
            print("Confidence --->",confidence)
            # class name
            cls = int(box.cls[0])
            print("Class name -->", classNames[cls])
            # object details
            org = [x1, y1]
            font = cv2.FONT_HERSHEY_SIMPLEX
            fontScale = 1
            color = (255, 0, 0)
            thickness = 2
            cv2.putText(img, classNames[cls], org, font, fontScale, color, thickness)
    cv2.imshow('Webcam', img)
    if cv2.waitKey(1) == ord('q'):
        break
cap.release()
cv2.destroyAllWindows()

Note: generated picture is not perfect. See zebra. AI output is affected by this.

2D on a 3D printer, moving lab and designing

Not a lot to tell, but much going on.

Having my own business means having a more professional electronics lab is a must.
So I’m moving from the attic to our outside workshop. That also means I have to make our Music Studio smaller.

So moving, printing a lot on my new 3D printer and designing EuroCards.

Part of the Address decoding eurocard with din41612.

Above card will hold two address decodes parts, selectable using jumpers. ( Old skool TTL using 74xx and a new solution using ATF22V10.

We like Low Poly models, so I printed one using marble PLA.

In the back my 100yr old highhat from my Grandfather (moleskin)

I’ve cleaned my old 3D printer, and I am planning to convert this printer to a 2D plotter and a CNC machine.

I’ve already printed a pen holder and a dremel holder.
(The filament head will be removed)

I’m working on a Gcode writer to plot drawings using a pen, or using a Gyro-cut knife to cut paper.
And the biggest project using this old 3D printer, a CNC machine!

Test Code:

import time
import serial

arduino = serial.Serial('/dev/ttyUSB0', 115200, timeout=.1)

# Motor stuff
arduino.write(str.encode("M84 X Y Z S12000\r\n"))
arduino.write(str.encode("M92 X160 Y160 Z800\r\n"))
# Extrude fix
arduino.write(str.encode("G92 E0\r\n"))
# Go home
arduino.write(str.encode("G28\r\n"))
# Move to x,y,z
arduino.write(str.encode("G1 Z90 X50 Y50\r\n"))
# Wait
arduino.write(str.encode("M400\r\n"))

Sin wave fun:

import time
import serial
import math
from time import sleep

arduino = serial.Serial('/dev/ttyUSB0', 115200, timeout=.1)

arduino.write(str.encode("M84 X Y Z S12000\r\n")) 
arduino.write(str.encode("M92 X160 Y160 Z800\r\n")) 
arduino.write(str.encode("G92 E0\r\n")) 
arduino.write(str.encode("G28\r\n")) 
arduino.write(str.encode("M220 S100\r\n")) 
arduino.write(str.encode("G1 Z10 X60 Y60\r\n"))
arduino.write(str.encode("M400\r\n"))
sleep(10)
count = 0
while True:
	newx=(math.sin(math.radians(count))*50)+60
	newy=(math.cos(math.radians(count))*50)+60
	newz=(math.cos(math.radians(count))*10)+20
	count = count + 1
	mystring="G1 Z" + str(newz) + " X" + str(newx) + " Y" + str(newy) + "\r\n" 
	print(mystring) 
	arduino.write(str.encode(mystring)) 
	arduino.write(str.encode("M400\r\n")) 
        # Not waiting for answer yet
	print(newx) 
	sleep(0.1)	
X,Y and Z movement (4x speed)

Old and new chips SMD or THT?

I’ve got two friends who make old retro computers.

They like to use old chips and use only THT.

What is my take on this?

I like to use THT when possible. Exceptions are:

  • Size constrains
  • No THT parts available
  • New gadgets

Old versus new chip solutions

  • CPU : never a new alternative
    (I’m not going to replace a 6502 using Arduino emulation, for example)
  • Yes, I’m using static ram instead of dynamic
  • Address decoder using 74xx ? Yes, I want to test at least once.
    But using a ATF22v10 has my preference. (Not using GALs anymore)

I only replace with newer alternatives when it does NOT interfere with how a system is performing. CPU has its own quirks, also chips like the SID. I never emulate when it can be avoided.
Address decoding, RAM or ROM yes please 🙂
Old untrusted UV Eproms are sh*t. Give me the new flash-able alternatives any time

I can emulate everything, but I need real hardware.

  • Real 6502
  • Real 68000
  • Real 8088
  • Real 8086
  • Real 80386

I still want a real VGA monitor because I used to write VGA manipulation programs which only work on CRTs.

68000 Progress

UPDATE 20240927 PCBs are in

While testing on a breadboard is fast, I still want my 68000 on PCBs.

Breadboards are nice for testing, and I use them in the design stage.
But they will fail in the end.
Loose wires, oxidated contacts and alike.

So when I was testing using breadboard, I drew the schematics in KiCad.

I wanted to use Eurocards for this one. If I divide the whole system in system blocks, I can exchange and experiment parts.
(My 6502 uses another method to connect different cards)

  • CPU and Clock (Plus power-on reset and step mode)
  • Memory and ROM
  • Storage
  • Address decoding
  • Sound
  • IRQ Handlers
  • Led Blinkenlights 🙂

I wrote about Eurocards in the past.

So I’m using the VMEbus standard for my new design.
(Using the recently bought book I mentioned)

Backplane design is done. And currently being autorouted.

PowerLeds for 5 and 12V. On/Off switch and MOLEX power connector.

Kicad sources will be uploaded

Freerouter with in the background a part of the CPU Card I am redesigning.

In the past, I dumped my old eurocards and even a nice case I had.

UPDATE 20240927 PCBs are in

Weekend work

Weekend of music, BBQ, designing and more.

I was making a re-arrangement of a bagpipe tune. Designing a blender 3D printed light box. Cooking a Mexican BBQ dinner. Visiting a textile place with old and new weaving looms. (Which gave me some great ideas). And working on my 68000 computer.

A great weekend.

No embellishments yet, and no lights in de blender logo.

My little record player project is also in the picture, I need to re-print the parts using my new printer!

New old book and new 3D printer

I bought a hardcopy of a book I used to design my 68000 computer.
In the US 130 dollars, in UK 8 pounds. (895 pages) (1992)

Search in pdf, flip through pages in hardcopy book!

New 3D printer

1956 days ago I’ve bought my previous printer. Time for a new one.

This one is very good in quality prints, but it is scary cloud connected by default. (And Chinese company)
See stuff like

So, LAN mode only.
And firewalled to internet.

Lets look at the Linux Bambu Lab source!

## Interesting

src/slic3r/GUI/MediaPlayCtrl.cpp:            url = "bambu:///rtsps___" + m_lan_user + ":" + m_lan_passwd + "@" + m_lan_ip + "/streaming/live/1?proto=rtsps";
src/slic3r/GUI/MediaPlayCtrl.cpp:            url = "bambu:///rtsp___" + m_lan_user + ":" + m_lan_passwd + "@" + m_lan_ip + "/streaming/live/1?proto=rtsp";
src/slic3r/GUI/MediaPlayCtrl.cpp:            url = "bambu:///rtsps___" + m_lan_user + ":" + m_lan_passwd + "@" + m_lan_ip + "/streaming/live/1?proto=rtsps";
src/slic3r/GUI/MediaPlayCtrl.cpp:            url = "bambu:///rtsp___" + m_lan_user + ":" + m_lan_passwd + "@" + m_lan_ip + "/streaming/live/1?proto=rtsp";

src/slic3r/GUI/MediaFilePanel.cpp:        std::string url = "bambu:///local/" + m_lan_ip + ".?port=6000&user=" + m_lan_user + "&passwd=" + m_lan_passwd;

src/slic3r/GUI/MediaPlayCtrl.cpp:    m_lan_user = "bblp";
src/slic3r/GUI/MediaPlayCtrl.cpp:    m_lan_passwd = "bblp";

# Code
grep -iR code ~/.config/BambuStudio/*conf
     "user_access_code": {
     "01P00A4331XXXXX": "331XXXXX"

# NMAP 
Host is up (0.0084s latency).
Not shown: 998 closed ports
PORT     STATE SERVICE
990/tcp  open  ftps
6000/tcp open  X11

Made a Meatloaf device for C64

Awesome opensource project

https://github.com/idolpx/meatloaf-specialty/tree/main

  • Emulates a floppy drive: Meatloaf plugs into the Commodore 64’s IEC serial port and acts like a virtual floppy drive. This allows you to load software and data stored on its internal flash memory, sd card, or stream it via WiFi using various protocols from servers all over the world.
  • Supports multiple virtual drives: Unlike a single floppy drive, Meatloaf can be configured to emulate up to 26 virtual drives (IDs 4-30). Each virtual drive can have a different disk image loaded, essentially offering the equivalent of having thousands of floppies connected to your C64.
  • Supports additional virtual device types: Printers, a network interface, and more.
  • Connects to the internet: Meatloaf also functions as a WiFi modem, enabling your Commodore 64 to connect to Telnet BBS (bulletin board systems) for communication and sharing information.

https://meatloaf.cc/sc/s/shortcodes.php

Load a prg using a url

LOAD"HTTP://C64.ORG/GAMES_AZ/H/H.E.R.O.PRG",8

Or from a D64 image on your own Windows/Samba server (all known CBM image formats supported):

LOAD"SMB://STORAGE/C64/FAVORITES/PIRATES_A.D64/*",8

Load a random game from the internet

LOAD"ML:ARCADE*",8