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!

P1S 3D print tricks and troubleshooting

Mattermost notification thingy (Using Wemos)

Stuck filament fix

Follow this:

  • Open at the back by pressing together (back 1)
  • left part stuck? (into ams) pull ams (ams picture)
  • right part to printer stuck? (release bowden tube from back2 picture )
  • Stuck in print head/hot-end? (press here – head picture)
    Lift and extract.
  • Still stuck? Heat head 250 degrees and try to remove.
  • Still stuck? Remove hot-end (2 screws)

My own C64 tools cartridge printed

Wi-Fi QR Code printed with space for RFID

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!

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
## 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
## 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
## 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	

Minimal socket test server, client and arduino

Socket connect to server, enter number and get reply test.

server.py

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
import socket
import threading
# Define the host and port
HOST = '0.0.0.0' # Localhost (change as needed)
PORT = 65432 # Port to listen on (non-privileged ports are > 1023)
# Function to handle each client connection
def handle_client(conn, addr):
print(f"Connected by {addr}")
# Send a thank you message to the client upon connection
thank_you_message = "Thank you for connecting! Please enter a number:\n"
conn.sendall(thank_you_message.encode('utf-8'))
while True:
try:
data = conn.recv(1024)
if not data:
break
# Decode the received data
received_number = data.decode('utf-8').strip()
print(f"Received from {addr}: {received_number}")
# Try to convert the received data to an integer
try:
number = int(received_number)
response = f"The double of {number} is {number * 2}\n"
except ValueError:
response = "Please enter a valid number.\n"
# Send the response back to the client
conn.sendall(response.encode('utf-8'))
except ConnectionResetError:
print(f"Connection with {addr} lost.")
break
conn.close()
print(f"Connection with {addr} closed.")
# Function to start the server and listen for connections
def start_server():
# Create a socket object
server = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
# Bind the socket to the host and port
server.bind((HOST, PORT))
# Start listening with a maximum backlog of 5 connections
server.listen(5)
print(f"Server listening on {HOST}:{PORT}")
while True:
# Accept a new connection
conn, addr = server.accept()
# Create a new thread to handle the client connection
client_thread = threading.Thread(target=handle_client, args=(conn, addr))
client_thread.start()
# Run the server
if __name__ == "__main__":
start_server()
import socket import threading # Define the host and port HOST = '0.0.0.0' # Localhost (change as needed) PORT = 65432 # Port to listen on (non-privileged ports are > 1023) # Function to handle each client connection def handle_client(conn, addr): print(f"Connected by {addr}") # Send a thank you message to the client upon connection thank_you_message = "Thank you for connecting! Please enter a number:\n" conn.sendall(thank_you_message.encode('utf-8')) while True: try: data = conn.recv(1024) if not data: break # Decode the received data received_number = data.decode('utf-8').strip() print(f"Received from {addr}: {received_number}") # Try to convert the received data to an integer try: number = int(received_number) response = f"The double of {number} is {number * 2}\n" except ValueError: response = "Please enter a valid number.\n" # Send the response back to the client conn.sendall(response.encode('utf-8')) except ConnectionResetError: print(f"Connection with {addr} lost.") break conn.close() print(f"Connection with {addr} closed.") # Function to start the server and listen for connections def start_server(): # Create a socket object server = socket.socket(socket.AF_INET, socket.SOCK_STREAM) # Bind the socket to the host and port server.bind((HOST, PORT)) # Start listening with a maximum backlog of 5 connections server.listen(5) print(f"Server listening on {HOST}:{PORT}") while True: # Accept a new connection conn, addr = server.accept() # Create a new thread to handle the client connection client_thread = threading.Thread(target=handle_client, args=(conn, addr)) client_thread.start() # Run the server if __name__ == "__main__": start_server()
import socket
import threading

# Define the host and port
HOST = '0.0.0.0'  # Localhost (change as needed)
PORT = 65432        # Port to listen on (non-privileged ports are > 1023)

# Function to handle each client connection
def handle_client(conn, addr):
    print(f"Connected by {addr}")
    
    # Send a thank you message to the client upon connection
    thank_you_message = "Thank you for connecting! Please enter a number:\n"
    conn.sendall(thank_you_message.encode('utf-8'))
    
    while True:
        try:
            data = conn.recv(1024)
            if not data:
                break
            
            # Decode the received data
            received_number = data.decode('utf-8').strip()
            print(f"Received from {addr}: {received_number}")
            
            # Try to convert the received data to an integer
            try:
                number = int(received_number)
                response = f"The double of {number} is {number * 2}\n"
            except ValueError:
                response = "Please enter a valid number.\n"
            
            # Send the response back to the client
            conn.sendall(response.encode('utf-8'))
        except ConnectionResetError:
            print(f"Connection with {addr} lost.")
            break

    conn.close()
    print(f"Connection with {addr} closed.")

# Function to start the server and listen for connections
def start_server():
    # Create a socket object
    server = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
    
    # Bind the socket to the host and port
    server.bind((HOST, PORT))
    
    # Start listening with a maximum backlog of 5 connections
    server.listen(5)
    print(f"Server listening on {HOST}:{PORT}")
    
    while True:
        # Accept a new connection
        conn, addr = server.accept()
        
        # Create a new thread to handle the client connection
        client_thread = threading.Thread(target=handle_client, args=(conn, addr))
        client_thread.start()

# Run the server
if __name__ == "__main__":
    start_server()

python-client.py

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
import socket
# Define the server host and port
HOST = 'IPNUMBERSERVER' # The server's hostname or IP address
PORT = 65432 # The port used by the server
def start_client():
# Create a socket object
client = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
# Connect to the server
client.connect((HOST, PORT))
# Receive and print the welcome message from the server
welcome_message = client.recv(1024).decode('utf-8')
print(welcome_message)
while True:
# Enter a number and send it to the server
number = input("Enter a number (or type 'exit' to quit): ")
if number.lower() == 'exit':
print("Closing connection...")
break
client.sendall(number.encode('utf-8'))
# Receive the response from the server and print it
response = client.recv(1024).decode('utf-8')
print(response)
# Close the connection after the loop ends
client.close()
# Run the client
if __name__ == "__main__":
start_client()
import socket # Define the server host and port HOST = 'IPNUMBERSERVER' # The server's hostname or IP address PORT = 65432 # The port used by the server def start_client(): # Create a socket object client = socket.socket(socket.AF_INET, socket.SOCK_STREAM) # Connect to the server client.connect((HOST, PORT)) # Receive and print the welcome message from the server welcome_message = client.recv(1024).decode('utf-8') print(welcome_message) while True: # Enter a number and send it to the server number = input("Enter a number (or type 'exit' to quit): ") if number.lower() == 'exit': print("Closing connection...") break client.sendall(number.encode('utf-8')) # Receive the response from the server and print it response = client.recv(1024).decode('utf-8') print(response) # Close the connection after the loop ends client.close() # Run the client if __name__ == "__main__": start_client()
import socket

# Define the server host and port
HOST = 'IPNUMBERSERVER'  # The server's hostname or IP address
PORT = 65432        # The port used by the server

def start_client():
    # Create a socket object
    client = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
    
    # Connect to the server
    client.connect((HOST, PORT))
    
    # Receive and print the welcome message from the server
    welcome_message = client.recv(1024).decode('utf-8')
    print(welcome_message)
    
    while True:
        # Enter a number and send it to the server
        number = input("Enter a number (or type 'exit' to quit): ")
        
        if number.lower() == 'exit':
            print("Closing connection...")
            break
        
        client.sendall(number.encode('utf-8'))
        
        # Receive the response from the server and print it
        response = client.recv(1024).decode('utf-8')
        print(response)
    
    # Close the connection after the loop ends
    client.close()

# Run the client
if __name__ == "__main__":
    start_client()

arduino-client.ino

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
#include <ESP8266WiFi.h> // For ESP8266
//#include <WiFi.h> // For ESP32
// Replace with your network credentials
const char* ssid = "your_SSID"; // Replace with your network SSID (name)
const char* password = "your_PASSWORD"; // Replace with your network password
// Define the server's IP address and port
const char* host = "192.168.1.100"; // Replace with your server's IP address
const int port = 65432; // Server port
WiFiClient client;
void setup() {
Serial.begin(115200);
delay(10);
// Connect to WiFi
Serial.println();
Serial.print("Connecting to ");
Serial.println(ssid);
WiFi.begin(ssid, password);
while (WiFi.status() != WL_CONNECTED) {
delay(1000);
Serial.print(".");
}
Serial.println();
Serial.println("WiFi connected.");
Serial.println("IP address: ");
Serial.println(WiFi.localIP());
// Connect to the server
Serial.print("Connecting to server at ");
Serial.print(host);
Serial.print(":");
Serial.println(port);
if (client.connect(host, port)) {
Serial.println("Connected to server!");
// Wait for the welcome message from the server
while (client.available() == 0);
// Read and print the welcome message
while (client.available()) {
char c = client.read();
Serial.print(c);
}
} else {
Serial.println("Connection failed.");
}
}
void loop() {
// Check if connected to the server
if (client.connected()) {
// Check if there is any serial input from the user
if (Serial.available() > 0) {
String input = Serial.readStringUntil('\n');
input.trim();
if (input.equalsIgnoreCase("exit")) {
Serial.println("Closing connection...");
client.stop(); // Disconnect from the server
while (true); // Stop the loop
}
// Send the number to the server
client.println(input);
// Wait for the server's response
while (client.available() == 0);
// Read and print the server's response
while (client.available()) {
char c = client.read();
Serial.print(c);
}
}
} else {
Serial.println("Disconnected from server.");
while (true); // Stop the loop
}
}
#include <ESP8266WiFi.h> // For ESP8266 //#include <WiFi.h> // For ESP32 // Replace with your network credentials const char* ssid = "your_SSID"; // Replace with your network SSID (name) const char* password = "your_PASSWORD"; // Replace with your network password // Define the server's IP address and port const char* host = "192.168.1.100"; // Replace with your server's IP address const int port = 65432; // Server port WiFiClient client; void setup() { Serial.begin(115200); delay(10); // Connect to WiFi Serial.println(); Serial.print("Connecting to "); Serial.println(ssid); WiFi.begin(ssid, password); while (WiFi.status() != WL_CONNECTED) { delay(1000); Serial.print("."); } Serial.println(); Serial.println("WiFi connected."); Serial.println("IP address: "); Serial.println(WiFi.localIP()); // Connect to the server Serial.print("Connecting to server at "); Serial.print(host); Serial.print(":"); Serial.println(port); if (client.connect(host, port)) { Serial.println("Connected to server!"); // Wait for the welcome message from the server while (client.available() == 0); // Read and print the welcome message while (client.available()) { char c = client.read(); Serial.print(c); } } else { Serial.println("Connection failed."); } } void loop() { // Check if connected to the server if (client.connected()) { // Check if there is any serial input from the user if (Serial.available() > 0) { String input = Serial.readStringUntil('\n'); input.trim(); if (input.equalsIgnoreCase("exit")) { Serial.println("Closing connection..."); client.stop(); // Disconnect from the server while (true); // Stop the loop } // Send the number to the server client.println(input); // Wait for the server's response while (client.available() == 0); // Read and print the server's response while (client.available()) { char c = client.read(); Serial.print(c); } } } else { Serial.println("Disconnected from server."); while (true); // Stop the loop } }
#include <ESP8266WiFi.h> // For ESP8266
//#include <WiFi.h>       // For ESP32

// Replace with your network credentials
const char* ssid     = "your_SSID";     // Replace with your network SSID (name)
const char* password = "your_PASSWORD"; // Replace with your network password

// Define the server's IP address and port
const char* host = "192.168.1.100"; // Replace with your server's IP address
const int port = 65432;             // Server port

WiFiClient client;

void setup() {
  Serial.begin(115200);
  delay(10);

  // Connect to WiFi
  Serial.println();
  Serial.print("Connecting to ");
  Serial.println(ssid);

  WiFi.begin(ssid, password);

  while (WiFi.status() != WL_CONNECTED) {
    delay(1000);
    Serial.print(".");
  }

  Serial.println();
  Serial.println("WiFi connected.");
  Serial.println("IP address: ");
  Serial.println(WiFi.localIP());

  // Connect to the server
  Serial.print("Connecting to server at ");
  Serial.print(host);
  Serial.print(":");
  Serial.println(port);

  if (client.connect(host, port)) {
    Serial.println("Connected to server!");
    
    // Wait for the welcome message from the server
    while (client.available() == 0);

    // Read and print the welcome message
    while (client.available()) {
      char c = client.read();
      Serial.print(c);
    }
  } else {
    Serial.println("Connection failed.");
  }
}
void loop() {
  // Check if connected to the server
  if (client.connected()) {
    // Check if there is any serial input from the user
    if (Serial.available() > 0) {
      String input = Serial.readStringUntil('\n');
      input.trim(); 

      if (input.equalsIgnoreCase("exit")) {
        Serial.println("Closing connection...");
        client.stop(); // Disconnect from the server
        while (true);  // Stop the loop
      }

      // Send the number to the server
      client.println(input);

      // Wait for the server's response
      while (client.available() == 0);

      // Read and print the server's response
      while (client.available()) {
        char c = client.read();
        Serial.print(c);
      }
    }
  } else {
    Serial.println("Disconnected from server.");
    while (true); // Stop the loop
  }
}

Bash-completion, C64 Pico Amplifier and Laser cutting

Worked on bash autocompletion for QP

source below script to get
qp <tab><tab> shortcode

Not happy with both versions yet …

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
#/usr/bin/env bash
# Version 0.1
qpcompl()
{
COMPREPLY=($(compgen -W "$(qp | cut -f2 -d \' )" "${COMP_WORDS[1]}"))
}
complete -F qpcompl qp
--------------------------------------------------------------------------------------
# V 0.2
_qp_complete() {
local cur prev opts
COMPREPLY=()
cur="${COMP_WORDS[COMP_CWORD]}"
prev="${COMP_WORDS[COMP_CWORD-2]}"
opts="add del"
case "${prev}" in
add)
COMPREPLY=( $(compgen -d -- ${cur} ))
return 0
;;
del)
COMPREPLY=( $(compgen -f -- ${cur}) )
return 0
;;
*)
COMPREPLY=( $(compgen -W "$(echo add; echo del ;echo "" ; qp)" -- ${cur}) )
return 0
;;
esac
}
complete -F _qp_complete -o nospace qp
#/usr/bin/env bash # Version 0.1 qpcompl() { COMPREPLY=($(compgen -W "$(qp | cut -f2 -d \' )" "${COMP_WORDS[1]}")) } complete -F qpcompl qp -------------------------------------------------------------------------------------- # V 0.2 _qp_complete() { local cur prev opts COMPREPLY=() cur="${COMP_WORDS[COMP_CWORD]}" prev="${COMP_WORDS[COMP_CWORD-2]}" opts="add del" case "${prev}" in add) COMPREPLY=( $(compgen -d -- ${cur} )) return 0 ;; del) COMPREPLY=( $(compgen -f -- ${cur}) ) return 0 ;; *) COMPREPLY=( $(compgen -W "$(echo add; echo del ;echo "" ; qp)" -- ${cur}) ) return 0 ;; esac } complete -F _qp_complete -o nospace qp
#/usr/bin/env bash

# Version 0.1
qpcompl()
{
  COMPREPLY=($(compgen -W "$(qp | cut -f2 -d \' )" "${COMP_WORDS[1]}"))
}
complete -F qpcompl qp
--------------------------------------------------------------------------------------
# V 0.2
_qp_complete() {
    local cur prev opts
    COMPREPLY=()
    cur="${COMP_WORDS[COMP_CWORD]}"
    prev="${COMP_WORDS[COMP_CWORD-2]}"
    opts="add del"

    case "${prev}" in
        add)
            COMPREPLY=( $(compgen -d -- ${cur} ))
            return 0
            ;;
        del)
            COMPREPLY=( $(compgen -f -- ${cur}) )
            return 0
            ;;
        *)
            COMPREPLY=( $(compgen -W "$(echo add; echo del ;echo "" ; qp)" -- ${cur}) )
            return 0
            ;;
    esac
}

complete -F _qp_complete -o nospace qp

Game controllers : left into right setup

My Bus Manipulator

And a Jigsaw in progress (with our own made clock in the background)

C64 Pico Amplifier

My C64 had a problem with previous attached speaker.
It drew too much current to drive. And random characters where printed.
Choosing another speaker and a minimal amplifier solved the issue.
(Thanks to Bigred finding the problem at Bornhack 2024)

My minimal amplifier for:

Using below mini speaker:

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