12 November 2020

PFAFF 7570/1475CD Serial Cable for the 21st century.

The victim resting in its natural habitat.

My mother wanted to be able to update some of the stitches on her PFAFF 1475CD using her PC. As the process of programming on the machine itself is tedious and does not lend it self to corrections. I had two problems to solve off the bat. First the cable is a D-Sub 25pin Serial RS232. No computer in the last 20 years has been made with this connector.

"Made for PFAFF in West Germany"
 
I had a DB25 to DB9 adapter, but modern computers, laptops even more so, don't have 9 pin serial ports... So i grab a USB to serial adapter. Unfortunately the manufacture, Prolific, intentionally didn't support Windows 7 or 10. bummer. 

DB25/DB9 adapter

I found in an old "Random Electronics Junk Box" a Keyspan serial adapter. Great! the Drivers work with Windows 10, ComPort33. OK but what about the software?

Keyspan serial USB adapter.

The software is from 1990. Meaning MSDOS. Well i happen to be a vintage video game enthusiast and run many old dos games using the wonderful DOSBOX program. But could it handle a physical serial port? The manual, you guys/gals read the manual don't you? The manual says YES!

Cool! so following some configuration and more near swearing than I'd like to admit... 

I was able to read to contents of the machine's memory using the PFAFF Creative Designer software from within DOSBOX using the many adapters to talk to the machine. The solutions was ugly and unwieldy. It risked being broken. 

Big ugly complex fragile cable.
So I searched for a better solution. Enter Limor "Ladyada" Fried and her crew at Adafruit Industries. They make a cable that will work perfectly for this application and it's low cost. USB to TTL Serial Cable.

All I need now is a connector for the PFAFF 1475CD machine, a 7pin DIN. Thanks Amazon! http://amzn.com/B07XCSX3JP

With a two part count and my soldering iron I'm ready to improve the situation!

A clean a elegant solution. Isn't that neater?

PC-Designer Software V1.3 (c) 1991 running in DOSBOX
 
Now for a bit more background and the technical details of how I pulled it off:

The original PFAFF cable (made in West Germany by the way) was a DB25 to 7 pin DIN connector. Inside the D shaped 25pin connector (DB25) is a circuit, depicted far below, that converts and inverts RS232, 25 Volt Direct Current differential signal to 5vdc TTL signal. PFAFF used a 5vdc supply from the machine to power and reference this circuit. We won't need the circuit as the TTL-USB adapter makes the circuit unnecessary. 

We won't be using PFAFF +5v supply and will leave the pin unconnected. The TTL-USB adapter has a +5v supply as well. I used heat shrink to cap it off safely as we won't be using it either. 

Red +5vdc -/- no connection
PFAFF +5vdc DIN7 Pin 3 -/- no connection

Now we connect a common signal reference and grounding wire (GND, black, to pin 4 on the DIN7 connector).
Black gnd -- DIN pin 4

Connect the TTL-USB Transmit to PFAFF receive and vise versa:
Green tx -> DIN pin 1
White rx <- DIN pin 7

Adafruit TTL-USB -- DIN7 connector summary:
Green tx -> DIN pin 1
White rx <- DIN pin 7
Black gnd -- DIN pin 4
Red +5vdc -/- no connection

My USB-TTL to DIN7 pin out


Ok, I know my soldering isn't pretty in these images. I did it quick. After testing and confirming everything works, I redid this and used matching color heat shrink.

TTL adapter soldered to DIN7 connector

TTL adapter soldered to DIN7 connector

Inside the adafruit USB-TTL adaptor


Thanks to Rudolf of achatina.de . They depict the circuit in the DB25 (the black rectangular connector).
Rudolf's pinout diagram of the PFAFF serial cable.

Original: Standard 232 (DB9/DB25) Pin -- PFAFF 7pin DIN connector
PC TX serial pin 3 -> brown PFAFF RX (pin 1)
PC RX serial pin 2 <- yellow PFAFF TX (pin 7)
Ground serial pin 7 -- green gnd (pin 4)
No connection* -/- white vcc (pin 3)

*while the PFAFF white (DIN7 pin3) does not have a pinout on the DB25, it does supply power and a voltage reference to the circuit housed in the DB25 connector.
 
This circuit converts and inverts RS232 signal to TTL signal.
Rudolf's circuit diagram of the original PFAFF serial cable.
 
DOSBOX conf (windows, you may have to adjust the com-port number):
serial1=directserial realport:COM33
 
DOSBOX conf (linux/mac, you may have to adjust the USB tty number):
serial1=directserial realport:ttyUSB
 
DOSBOX conf (all systems)
[autoexec]
#mount c ~/dos/PFAFF
mount c c:\users\USER\PFAFF\
C:
PCD.EXE
exit

for the software create a PFAFF directory (case sensitive) and copy the PCD program files to it. adjust the [autoexec] section of dosbox.conf to mount the PFAFF directory. upon running dosbox the PCD program should automatically launch.

Parts: 

Software:

Thanks to: 

24 July 2017

Debian Fluxbox Setup (November 2020 update)

Biggest change from 2017 and 2019 updates is WICD is now really dead. I've switched to network-manager and network-manager-gnome (for the applet) there is a fair amount of package and space overhead for this but there isn't really a better alternative. Also network-manger is likely to be the first to have WPA3 support, which I plan to implement in my networks as soon as they are available. From here out I plan to keep a change log of this post.


autologin w/ systemd:

/etc/systemd/system/getty@tty1.service.d/autologin.conf:
[Service]
ExecStart=
ExecStart=-/sbin/agetty --autologin $USERNAME %I


Wifi:
$lspci
...
00:14.3 Network controller: Intel Corporation Comet Lake PCH CNVi WiFi
...

$sudo apt-get install firmware-iwlwifi

$ip addr show
1: lo ...
2: enp1s0: ...
    link/ether XX:XX:XX:XX:XX:XX...
3: wlp2s0: ...
    link/ether XX:XX:XX:XX:XX:XX...

As we are using network manager now we have tow choices:
   1: Remove interfaces from /etc/network/interfaces so NM will automatically manage them -or-
   2: Force NM to namage=true in /etc/NetworkManager/NetworkManager.conf
I have chosen to use option 1.
for more information see https://wiki.debian.org/NetworkManager

/etc/network/interfaces:
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).
source /etc/network/interfaces.d/*
# The loopback network interface
auto lo
iface lo inet loopback
# The primary network interface
#allow-hotplug enp1s0
#iface enp1s0 inet dhcp
# wifi
#allow-hotplug wlp2s0
#iface wlp2s0 inet dhcp


Sound:
apt-get install alsa-utils pulsemixer pulseaudio-utils pulseaudio-module-bluetooth


Backlight:
#Screen Brightness.  Will lower or raise brightness by 5%.
# had to install xbacklight and add the following to /etc/X11/xorg.conf:
Section "Device"
        Identifier  "Card0"
        Driver      "intel"
        Option      "Backlight"  "/sys/devices/pci0000:00/0000:00:02.0/drm/card0/card0-LVDS-1/intel_backlight/"
EndSection


Thunar:
apt-get install thunar thunar-volman
remove "Set as wallpaper" context menu item:
https://forums.bunsenlabs.org/viewtopic.php?id=1533
"The Thunar wallpaper plugin is compiled into the Debian standard Thunar (EDIT: libthunarx-2-0 in fact), and we don't want to have to compile our own version, just for a little thing like this. There is a fix though. Rename /usr/lib/{i386-linux-gnu,x86_64-linux-gnu}/thunarx-2/thunar-wallpaper-plugin.so and restart Thunar."


~/.fluxobx/keys:
Mod1 Tab :NextWindow (workspace=[current]) !! FBCV13 !!
Mod1 Shift Tab :PrevWindow (workspace=[current]) !! FBCV13 !!
#
#Volume.  Will lower or raise volume by 5%.  The third key binding will toggle mute.
XF86AudioLowerVolume : Exec amixer sset Master,0 5%-
XF86AudioRaiseVolume : Exec amixer sset Master,0 5%+
XF86AudioMute : Exec amixer sset Master,0 toggle
#
XF86MonBrightnessUp : exec /usr/bin/xbacklight -inc 5
XF86MonBrightnessDown : exec /usr/bin/xbacklight -dec 5
#
Mod1 F4 :Close
Mod1 z :RootMenu
Mod1 Shift z :HideMenus
Mod1 x :exec /usr/bin/xterm
Control Shift n : exec /usr/bin/google-chrome --incognito


~/.fluxbox/startup:
# fluxbox startup-script:
#
# Lines starting with a '#' are ignored.
#
# You can set your favourite wallpaper here if you don't want
# to do it from your style.
#
# This sets a black background
# /usr/bin/fbsetroot -solid black
# /usr/bin/fbsetbg -l
# /usr/bin/fbsetbg -f -r ~/.fluxbox/backgrounds/
# Now set by .fluxbox/init rootCommand
#
# This shows the fluxbox-splash-screen
# fbsetbg -C /usr/share/fluxbox/splash.jpg
#
# Other examples. Check man xset for details.
#
# Turn off beeps:
xset -b
#
# Increase the keyboard repeat-rate:
# xset r rate 195 35
#
# Your own fonts-dir:
# xset +fp "~/.fonts"
#
# Your favourite mouse cursor:
# xsetroot -cursor_name right_ptr
#
# Change your keymap:
# xmodmap "~/.Xmodmap"
#
#
#
# Applications you want to run with fluxbox.
# MAKE SURE THAT APPS THAT KEEP RUNNING HAVE AN ''&'' AT THE END.
#
# unclutter -idle 2 &
# wmnd &
# wmsmixer -w &
# idesk &
#/usr/bin/xscreensaver -no-splash &
#/usr/bin/wicd-client -t &
/usr/bin/numlockx on &
/usr/bin/nm-applet &
/usr/bin/blueman-applet &
#/usr/bin/volumeicon &
/usr/bin/pasystray &
~/sbin/cbatticon -i symbolic &
#/usr/local/bin/wmbattery &
#/usr/bin/wmnd -i wlan0 -I wlan0,eth0 &
#/usr/bin/unclutter -idle 2 &
#/usr/bin/chromium --no-startup-window &
/usr/bin/xterm -geometry 120x55+0+0 &
#/usr/bin/xterm -geometry 80x55+725+0 &
#/usr/bin/xterm -geometry 120x55+485+0 &
#/usr/bin/xterm -geometry 80x24+0+403 &
#/usr/bin/xterm -geometry 80x29+0+0 &
#/usr/bin/dropbox start &
#/usr/bin/xtrlock -f -b
/usr/bin/fbsetbg -l &
~/.screenlayout/dual.sh &
#
# And last but not least we start fluxbox.
# Because it is the last app you have to run it with ''exec'' before it.
#
exec /usr/bin/fluxbox
# or if you want to keep a log:
# exec /usr/bin/fluxbox -log "~/.fluxbox/log"


~/.fluxbox/keys (my additions not the entire file):
XF86MonBrightnessUp : exec /usr/bin/xbacklight -inc 5 XF86MonBrightnessDown : exec /usr/bin/xbacklight -dec 5 XF86Calculator : exec ~/sbin/touchpadtoggle.sh Mod1 F4 :Close Mod1 z :RootMenu Mod1 Shift z :HideMenus Mod1 x :exec /usr/bin/xterm Control Shift n : exec /usr/bin/google-chromqe --incognito Mod4 l :xtrlock -b #Mod4 T :ToggleDecor

~/sbin/touchpadtoggle.sh:
#!/bin/dash device="CUST0001:00 04F3:3147 Touchpad" #find the device you wish to toggle using /usr/bin/xinput state=$(xinput list-props "$device" | grep "Device Enabled" | grep -o "[01]$") if [ $state = '1' ]; then /usr/bin/xinput --disable "$device" else /usr/bin/xinput --enable "$device" fi

Other software installed:
sigil
eye of mate (eom)
simple-scan
dropbox
chrome
network-manager
network-manager-gnome
calibre
evince
libreoffice
moneydance
xfburn
xtrlock
arandr
rhythmbox
soundjuicer
vlc
thunar

01 March 2015

IMG 2 SVG

IMG 2 SVG: Converting raster images to scalable vector graphics using the GNU Image Manipulation Program (GIMP) and Inkscape

Note: This tutorial assumes the user has a basic knowledge of computers. Including but not limited to image processing software (Photoshop, GIMP, etc.), the internet, downloading and handling files, installing software, and using a mouse. It is also assumed that GIMP, Inkscape and a web browser are already installed. A functional internet connection will be useful. Versions used include GIMP 2.8.14 and Inkscape 0.48.5 r10040 both from the Debian Linux testing repository, pulled on 01 March 2015. Ubuntu, Fedora, Centos, OpenSUSE, Redhat, OSX, and Windows all have packages/installers for GIMP and Inkscape. Your mileage may vary.
In this example I used a PNG from the wikipedia article on the Futurama character Bender, http://en.wikipedia.org/wiki/Bender_(Futurama)

Launch GIMP:
  1. File > Open [Figure 1]
  2. Colors > Desaturate (I typically use lightness, but use what works best for you)
    Note: GIMP only operates on the selected area. Using a selection area may be useful for getting different thresholds in various places in the image
  3. Colors > Threshold (you’ll have to play around to find the best values but auto does a good job of getting close most of the time) [Figure 2, Figure3]
  4. Image > Mode > Indexed (select “Black and White 1-bit palette” ) and “Remove unused colors” (default) [Figure 4]
  5. Remove any signature and unwanted artifacts (speckles, etc.). SVG conversion is difficult with such things or speckles in the image. You will see I have left some under Bender's cigar because they are intentional. [Figure 5, Figure 6]
  6. Ensure you have permission or legal right to remove signatures/watermarks or ensure they get placed in the final image after conversion. You may wish to cut and paste the signature into a new image for use later.
  7. Image > Zealous Crop ( I forgot this when making the walkthrough so my canvas sizes are a bit bigger, with more white space)
  8. Save in gimp xcf format (for easy changes later) and export to png format (File > Export As). I change the name so as not to overwrite the original “bender.png” becomes bender.xcf and “bender_clean.png”. When exporting there is no need to save background color, creation time, or transparent pixel color values. [Figure 7]
Launch InkScape:
  1. Open your file (File > Open > “Bender_clean.png”)
  2. Using the arrow tool select your object
  3. Path > Trace Bitmap
  4. On the Options tab [Figure 8]
    1. Disable suppress speckles
    2. Enable smooth corners @ 1.00
    3. Enable optimize paths @ 5.00
  5. On the Mode Tab [Figure 9]
    1. Select the colors radio button
    2. Set scans to 2
    3. Disable Smooth
    4. Enable Stack Scans
    5. Disable remove background
    6. Press Update on the Mode Tab
  6. Press OK. You now have a Vector Object on top of a Raster Object.
  7. Move the Vector Object aside (use the select tool if needed) [Figure 10] 
  8. Delete the Raster Object [Figure 11]
  9. Select the Vector Object
  10. Move the Vector Object to the home position using the X,Y coordinates in the toolbar [Figure 12]
  11. Save as an SVG (I typically save as a “Plane SVG (.SVG)” rather than an InkScape SVG if I’m going to be using this image anywhere other than in Inkscape (e.g. webpages, Adobe Illustrator, etc.)
  12. You can cut and paste the signature raster object from gimp directly into Inkscape if you need to. I copied the signature after desaturating but before converting from RGB to Black and White. [Figure 13]
  13. Don’t forget to save again if needed.
  14. ADVANCED TOPIC: ::INCOMPLETE:: If your going to color the image after word, The Inkscape fill bucket works similar to that of raster image programs but may leave a white ring between your outline and colors. The easiest (read maybe not the best) way to fix this is to break apart the vector paths.
    1. Select the Edit Node Tool
    2. Click on the outline vector object
    3. Path > Break Apart
    4. Select fill bucket tool
    5. Select fill color
    6. Click on empty area to fill

image/svg+xml
Figure 2 Figure 1 Figure 3 Figure 4 Figure 5 Figure 7 Figure 9 Figure 10 Figure 11 Figure 12 Figure 13