Ein Beispiel reparierbarer Elektronik

Hier ist ein Beispiel fuer reparierbare Elektronik das am Wochenende entstanden sind. Wir schauen mal in beide Geraete rein und reissen dann am Ende die Oekobilanz an.

Teardown "Buffalito"

Die "Buffalito" Powerbank kommt aus einem Projekt das Powerbaenke fuer unterversorgte Regionen bereit stellen will. Da geht es um Fluechtslingscamps oder Gemeinschaften die immer wieder zeitweise ohne Strom auskommen muessen (laendliches Indien z.B.). Reparierbarkeit, auch im Sinne von "aus zwei mach eins", ist hier wichtig. Dazu kommt die relativ robuste Ausstattung. Die Powerbank dient gleichzeitig als Lampe, z.B. mit der mitgelieferten Halterung fuer das Fahrrad.

Powerbank Vollansicht

Im grossen Gehaeuseteil sieht man zwei Abteile. Im grossen Abteil finden sich normalerweile die Elektronik und der Lithium Akku. Im kleineren Teil befindet sich nur die kleine Platine mit den externen Anschluessen. Das grosse Abteil ist komplett versiegelt. Der grosse Silikonbutton in diesem Abteil ist verklebt.

Die Trennwand zum kleinen Abteil, sorgt dafuer, dass es schwieriger wird einen Wasserschaden zu erleiden. Das kleine Abteil hat mehrere Oeffnungen die durch Silikonstoepsel gesichert werden, wenn sie nicht im Betrieb sind. Zwei Torx T5 Schrauben befestigen die Frontplatte am Hauptgehaeuse. Ausser einem Torx T5 wird kein Werkzeug benoetigt, um die Powerbank zu zerlegen.

Die Silikondichtungen zwischen Hauptgehaeuse und Frontplatte sind nicht verklebt und abnehmbar. Die Oeffnungen fuer die Gehauseschrauben werden mit eigenen PE-Dichtungen vor Feuchtigkeit geschuetzt.

Powerbank Gehaeuse

Bei dem Lithium Akku handelt es sich vermutlich um eine Standard 18650 Zelle mit 65mm Laenge. Die Zelle hat ausserdem ein aufgeklebtes Schaumstoffpolster und einen 2-poligen Stecker (vermutlich JST) bekommen.

Ein kleiner Streifen Kapton mit Waermeleitpaste fixiert den NTC Sensor der Ladeelektronik am Akku.

Powerbank Gehaeuse

Die Elektronik selber ist auf einer ordentlich verarbeiteten Platine. Nur die Oberseite ist bestueckt. Auf der Rueckseite befindet sich lediglich ein Anschluss fuer den NTC Sensor. Ohne die Bauteile im Detail durchzugehen, vermute ich, dass es sich um Standardteile handelt.

Powerbank Gehaeuse

Reparierbarkeit EN 45554

Ich liste hier kurz meine Version des Scorings nach EN 45554 aus, dazu weiter unten Bemerkungen:

  • Fasteners: A, reusable
  • Tools: A, feasible (using only basic tools as listed in Table A.3 of the standard DIN EN 45554)
  • Working environment: A, use environment
  • Skill level: A, layman
  • Diagnostic support and interfaces: n/a
  • Availability of spare parts by target group: A, publicly available; E, No spare parts available
  • Availability of spare parts by spare part interfaces: A, Standard part
  • Availability of spare parts by duration of availability: A, Long-term availability
  • Types and availability of information by comprehensiveness: B, Basic information available
  • Types and availability of information by target groups: n/a
  • Return models: B, Basic return model existing
  • Data transfer and deletion: n/a
  • Password and factory reset for reuse: n/a

(Liste entnommen dieser Uebersichtspublikation des UBA link)

Das Scoring entstand unter der Annahme, dass wir im wesentlichen von drei Baugruppen reden: Elektronik, Batterie, Gehaeuse. Plus zusaetzlich kleinere Teile wie Schrauben und Dichtungen. Reparaturen direkt an Elektronik-Baugruppen sind auch weitestgehend, z.B. in den TCO Kriterien, nicht vorgesehen. Selbst wenn wir die beiden Platinen als zwei unterschiedliche Baugruppen ansieht und die dann geloetet werden muessen, muesste dann nur die "Working environment" (evtl.) und das Skill Level (sicher) einen schlechteren Score bekommen. Die EN 45554 sieht Loeten vom Prinzip her als loesbaren, wiederverwendbaren Befestiger an.

Die Verfuegbarkeit von Ersatzteilen fuer den Buffalito ist nicht mehr gegeben, da das Projekt nach einer initialen Phase untergegangen ist. Stromlaufplaene fuer die Elektronik oder CAD Dateien fuer Gehaeuse oder Dichtungen sind nicht veroeffentlicht worden.

Prinzipiell sind der Lithium Akku, Schrauben und Verschleissteile wie Buchsen einfach durch Standardtteile austauschbar. Defekte Dichtungen lassen sich wahrscheinlich sehr einfach entweder durch Silikon oder ein andere - zur Not handgeschnittene - Folie ersetzen.

Die Silikon-Stoepsel in der Frontplatte liessen sich wahrscheinlich durch selbstgegossene Silikonteile (3D gedruckte Form mit Standard 2K Silikon) ersetzen.

Der Plastik-Typ ist nicht bekannt (kein Aufdruck). Wahrscheinlich laesst sich ein gebrochenes Gehaeuse kleben. Dass ein Gehaeuse durch einen 3D-Druck gleichwertig ersetzt werden kann, halte ich fuer moeglich. Dazu muss der 3D-Druck abgedichtet werden, da FDM gedruckte Teile meistens nicht wasserdicht sind.

Obwohl der Hersteller in den ewigen Jagdgruenden verschwunden ist, ist die Ausgangslage fuer eine Reparatur ausgezeichnet. Dazu kommt noch, dass grundlegende Reparaturen (aus zwei mach eins) auch von kompletten Laien mit Standardwerkzeug durchgefuehrt werden koennen.

Anriss Oekobilanz

Speziell ausgelassen sind hier Distributionskosten, z.B. von Asien nach Westeuropa.

Lithium Akku

Das UBA hat hier eine Oekobilanz eines Laptop-Akkus vorliegen.

Die 18650 ist weltweit die meistverkaufte Lithium Zelle. Anhand der Leistungsdaten des Laptop-Akkus gehe ich davon aus, dass dieser Akku aus vier 18650 Zellen besteht, oder mit diesen Zellen grob vergleichbar ist.

Ich entnehme die Wirkungsbilanz dem UBA Dossier, in dem ich die Wirkungsbilanz S.103 auf eine Zelle skaliere:

  • Global Warming Potential: 1,5 kg CO2e
  • Human Toxicity Potential: 0.88 kg DCB-Äqv.

Elektronik

Laut BetaLayout (link) erzeugt ein Quadratmeter Leiterplatte ca. 300kg CO2e. Die Leiterplatte in der Powerbank ist ca. 10cm x 2,5cm gross.

Das entspricht 0,75 kg CO2e. Umd die Komponenten auf der Leiterplatte abzudecken, verdoppel wir den Wert.

  • Global Warming Potential: 1,5 kg CO2e

Plastikkomponenten

Basierend auf OpenLCA/ProBas Daten fuer den Grundstoff PP veranschlage ich:

  • Global Warming Potential: 0,066 kg CO2e
  • Ecotoxicity: 0,074 CTUe

Waere das Gehaeuse aus glasfaserverstaerktem Polyamid, fiele ungefaehr die doppelte Zahl CO2e an.

Moegliche Fehler & GWP Einsparung

Fehler an folgenden Teilen sind denkbar. Jeweils hinter dem Semikolon findet sich die Ersparnis, gemessen in % des Urpsrungsaufwandes, wenn nur jeweils die defekte Baugruppe ausgetauscht wird:

  • beschaedigungen an Gehaeuse, Dichtungen; Ersparnis: 97,8%
  • defekter Lithium Akku; Ersparnis: 51%
  • defekte Elektronik; Ersparnis: 51%

Diese sehr hemdsaermelige, angerissene Oekobilanz steckt einen ungefaehren Rahmen fuer die Einsparung des GWP ab.

Next up: Social Impact

Comfortably virtualized control software

At Welcome Werkstatt, our open workshop in Hamburg, Barmbek, someone donated an old circuit board router to us. This is an LPKF S62. The software is technically still available for modern Windows systems, but the old uEye industrial camera is incompatible with any recent version of Windows and requires Windows XP.

From our perspective this is a fairly common occurance. The previous solution was to use some fairly old hardware that is supported by WinXP, but there are better options, like virtualization. In this case we're using a vanilla Ubuntu host.

The big picture

Virtualization has some unique advantages and some drawbacks:

  • WinXP has not seen updates for quite some time, hence the guest should run with the highest amount of network isolation possible. At the same time it's desirable that the host has continuous network access and consequently a supported software base.
  • CAM and board layout software need to run at reasonable speed.
  • Both the uEye camera and the Prolific serial adapter need to be supported. These are USB2 devices.
  • We need a reasonable way to move data in and out of the guest OS. A USB stick will not work.

The diagram below gives you some idea of how everything fits together. The gist:

  • We'll share files via Samba
  • We'll use virt-viewer/Spice for KVM
  • We implement USB hotplug for every device that connects to a designated USB hub

This will give us a host system with all the current Linux software you would expect and at the same time seamless access to the old machine control software.

Let's go.

General preparation

I used a vanilla Ubuntu 24.4 with literally zero customization, and applied the most recent patches.

You need to install a couple of things:

VM preparation & networking

First we'll let libvirt create a so called routed network. All the required information can be found over on the virsh site (e.g. https://wiki.libvirt.org/VirtualNetworking.html#xml-format). We'll create a routed network on virbr1 with a private IP space, that is unused in my bubble, and after that we'll enable Ubuntus UFW firewall.

cat > lpkf-net.xml <<EOF
<network>
 <name>lpkf-net</name>
 <bridge name='virbr1' stp='on' delay='0' />
 <ip address="192.168.110.1" netmask="255.255.255.0">
 <dhcp>
  <range start="192.168.110.100" end="192.168.110.254" />
 </dhcp>
</ip>
EOF

virsh net-create lpkf-net.xml

sudo ufw enable
sudo ufw status verbose

Technically this network is called a "routed" network in the virsh docs, but it is not routed. The reason is given by the last command and its output: UFW blocks all communication by default, routed or not (with the exception of DNS).

Installing WinXP is not horribly complex. You open virt-manager, click the button for creating a new VM and point it to the WinXP CD image and it will automatically mount it and start the installer. I will name this VM lpkf-life-extension. I create a VM with 20GB storage and 2GB of RAM. When you create the VM, make sure that the network is not set to default, but to lpkf-net.

Now, the next step will involve adding more software to the guest, but first, let's create some easy way to move data around. For this one we'll use a Samba with horrible security configuration. That's another reason for the firewall config we did previously.

Install Samba as per Ubuntus docs (https://ubuntu.com/tutorials/install-and-configure-samba#1-overview). I changed the share config from the docs to the following, this should be placed at the end of the samba config (/etc/samba/smb.conf).

[lpkf-inter]
    comment = LPKF Interchange
    path = /home/mark/lpkf-inter
    read only = no
    browsable = yes

Now, this will not be accessible by WinXP, because this particular guest OS expects an early version of CIFS and working NTLM auth. Both of these are deeply flawed and should not leave the virtual network on this machine. Make the following additions to the [global] section of the same file and restart the Samba server.

server min protocol = NT1
ntlm auth = yes

Our firewall is still blocking all requests to the Samba server, so we need to open the NetBIOS ports for incoming traffic from the LPKF network, and this network only.

sudo ufw allow from 192.168.110.0/24 to 192.168.110.1 port 137
sudo ufw allow from 192.168.110.0/24 to 192.168.110.1 port 138
sudo ufw allow from 192.168.110.0/24 to 192.168.110.1 port 139

sudo ufw status verbose

At this point you can mount the interchange share from WinXP. So open a command prompt on WinXP and enter the following command to mount the network share.

net use z: \\192.168.110.1\lpkf-inter

Add some Spice

The Spice tools support convenient desktop integration, aka KVM. The Spice installer contains:

  • QXL video drivers, these will make the screen resize dynamically to whatever your virt-viewer window allows
  • The Spice agent proper for some convenience.

Get the Spice tools over at the project web site (https://www.spice-space.org/download.html), copy them to the lpkf-inter directory, open the guest OS in virt-manager and install them in the local machine.

Before you reboot WinXP, let's check two things. In the virt-manager config pane, check that you have a spice channel for KVM. The hardware type should be "Channel" in the overview pane. After that check that the network adapter type is set to "virtio" (not "e1000") and that the Graphics card type is set to "QXL".

After you reboot WinXP, you will be able to fire up virt-viewer and you'll have a reasonably working virtualization experience.

Virtual USB hotplug sans suck

I'll remind you here of our setting: We have a CNC router standing in our workshop, this is a small to medium sized machine tool. For most uses you will want to be able to attach some device to the guest OS and "just have it work". People should not care much about the underlying host OS, if the only thing they want to do is route some boards. With the Spice integration and seemless file sharing we've achieved a good level of convenience, now let's match that for the experience of "plugging in a USB device and have it show up directly on the guest OS". This affects both our router hardware interface and ad-hoc connections, say to a USB stick.

The way we will achieve this, is via some very arcane hardware device, called a USB hub. The machine in place already has a (fairly old) USB hub attached, and all parts for machine control are attached here. The USB bus is a structured bus and it's fairly easy to map out the topology on Linux systems. From the host perspective the USB topology looks vaguely like the following diagram. Sample USB Topology What we need is a small script that does the following:

  • The script runs for every attached USB device
  • It will inspect the USB topology until it arrives at a root controller
  • If the device that was just attached is situated below a designated hub, the device should be hot-plugged into the VM and the host OS should not bother with the device at all

In other words: We look up the vendor ID and device ID from our hub and whenever someone attaches something to this hub, the device gets passed straight through to the guest OS.

The following is a small script to accomplish just this within the Linux udev framework. If this script criteria are met and it has plugged in the device to the VM, it reports success and udev resolution stops at this point. If the script criteria don't match or it fails to plug in the device, the rule resolution will continue and the host OS will do its thing, e.g. mount a USB stick.

This is a modified version of this piece: https://github.com/olavmrk/usb-libvirt-hotplug My changes add topology awareness, the original script would plug in just a specific device at a specific device path. Since device pathes are somewhat unpredictable on Linux, the original script is not ideal either way.

If you adapt the script in question, make sure to change the vendor id and product id to the ids of your hub or controller. See top of script.

[

usb-libvirt-hotplug

Topology aware VM hotplug

usb-libvirt-hotplug.sh

3 KB

.a{fill:none;stroke:currentColor;stroke-linecap:round;stroke-linejoin:round;stroke-width:1.5px;}download-circle ](/files/2025/02/usb-libvirt-hotplug.sh)

In addition to place a udev rule at the right place and reload the udev system. On Ubuntu the right place is /dev/udev/rules.d and the command to reload the rules is sudo udevadm control --reload-rules && sudo udevadm trigger.

For the rule, I used the following snippet. The RUN command in the rule needs to point to an executable version of the script above and include the VMs name as the first argument.

SUBSYSTEM=="usb",DEVPATH=="*",RUN+="/opt/usb-libvirt-hotplug/usb-libvirt-hotplug.sh lpkf-life-extension"

Summary

Things that need to be checked again:

  • My tests showed that the VM had almost no connection to the internet. The VM can resolve DNS and run DHCP (the latter only locally), everything else should be disallowed. As part of this the actual iptables entries that ufw generates need to be cross checked (ufw show raw).
  • WinXP might need some weird activation after 30 days.
  • virsh might want to increment port numbers for all attached devices. According to the internet the QEMU EHCI implementation has 4 ports and when virsh arrives at number 4, it will add an emulated USB UHCI controller (USB 1.1) and attach the device to the new controller.
  • You might want to mount USB mass storage into lpkf-inter even if they are supported by WinXP. According to my research, WinXP handles FAT32 fairly well, but nothing that came later.

Drawbacks observed:

  • If you start the guest OS after the USB hub has been attached, the devices will not be connected to the guest OS. Simply unplugging the hub and plugging it back in will fix this.
  • The device topology in the guest OS may be different at every attachment. The reason for this is the fairly unpredictable order in which devices get attached to the guest VM. This can mean that the COM port numbers of the Prolific converter change and it can also mean that you will be prompted to re-install the uEye drivers on boot. This is a quirk with WinXP USB. The fix for this is fairly simple and can be done in the script.

This session was primarily to verify that this way of virtualizing the control software is sound. And I think this is the case.

Installing the CAD/CAM software is left as an exercise to the reader.

Rejected alternatives

Some things that don't work:

  • virtio filesystem: This only works from Windows 8 onwards. This is the best way to achieve a good level of isolation of the Windows guest. Guest OS support for the virtio filesystem drivers means that you can run your guest OS without an attached network card, without any concern for accidental network connections.
  • spice shared folders: The most recent webdav proxy version (2.4) for this does not work on WinXP any longer. The previous to last version (2.2) does work. The startup of the proxy does however fail and will not recover, when the guest OS boots and there is no Spice viewer attached to the VM. This leads to a stream of errors in the event log and requires a normal user to restart the Spice webdav service in the guest OS, whenever they connect to the guest OS.
  • attaching a usb hub directly: Many modern virtualization technologies support direct mappings of hardware devices into the guest OS. This can be done with PCI devices (graphics cards &c). For our use case, it might have been possible to map a USB root controller into the guest. This doesn't work, because WinXP is limited to the USB EHCI controller standard and any modern system will provide an xHCI controller in Hardware. The former one was part of USB 2.0, while the latter was introduced with the advent of USB 3. Under the hood, our solution uses an emulated EHCI controller and the USB payload is forwarded from the host USB stack. It's still efficient and adequate for our use case.

Aus der Kampagne

Im Bundestagswahlkampf 2021 sind so einige Sachen passiert. Nicht nur unsere Schilder sind ramponiert worden. Das Beispiel stammt vom ersten Tag an dem Plakatieren erlaubt war. Morgens hängt die SPD ihr Plakat auf, zwischenzeitlich tritt es jemand ab, und am selben Tag hängt die CDU ihr Plakat an derselben Stelle auf. Nebenbei wurde der Park am Biedermannplatz inklusive der Spielgeräte großflächig mit "Team Todenhöfer" plakatiert. Wahlplakat CDU über abgetretenem SPD Plakat Auf dem Dulsberg sind in einer Nacht 20 unserer Schilder abgetreten worden. Am Ende des Wahlkampfes waren auch unsere Schilder in Barmbek-Süd und in Uhlenhorst abgetreten, nachdem sie eine Weile hingen.

Erfreulich waren unsere Brottüten-Kampagne. Eigepackt in ein kleines Tütchen mit "DIE LINKE. Barmbek"-Aufkleber war Wahlkampfmaterial und ein Müsliriegel/Apfel o.ä.

"Kann ich ihnen einen Apfel anbieten?", kam gut an. Brottütchen mit Wahlkampfmaterial und Müsliriegel Wir sind insgesamt vier Mal im Bezirk an die Haustüren gegangen. Das war neu für uns und wir haben dabei gelernt. Die Leute waren aufgeschlossen, aber etwas kurz angebunden. Insgesamt merken die Leute schon das sie jetzt von der Get-out-the-vote-Kampagne angesprochen werden. Aber das ist auch in der letzten Wahlkampf-Phase das einzige Ziel: die eigenen Wähler zur Wahlurne zu bringen. Genosse bei der Zigarettenpause Der letzte Tag vor der Wahl war dann reserviert für einen Spaziergang an der Alster. Zu dem Zeitpunkt waren die Wahlprognosen noch gut, wir haben darüber geredet wie sich unsere Kandidaten wohl im Parlament schlagen würden. Blick auf die Innenstadt vom anderen Ende der Alster Trotz katastrophalem Ausgang, hatten wir einen guten Wahlkampf. Im Sommer macht die ganze Nummer deutlich mehr Spaß als im Winter. Leider sind die Leute manchmal schwer zu erreichen, wenn die Alternative zum politischen Gespräch lautet, den Tag am See zu verbringen.

Das Fazit ist für mich persönlich ist, dass wir teils leidenschaftlich unterstützt werden, aber noch weitgehend isoliert sind. Insbesondere mangelt es an Vertrauen, so dass sich die guten Umfragewerte für unsere Themen sich nicht in nennenswerte Stimmanteile während der Wahl übersetzt.

Hello Peeps!

Hi there, I'm trying out some stuff, to see if I can mail you just a single article without it being publicly visible.

Thank you for subscribing ❤️

Elsewhere

I've written some articles that are not on this site.

Custom Sphinx workflows (2018)

How to build custom Sphinx workflows. This led to some interesting discussion in the aftermath. The article might be a bit outdated. The sample code made it into the official Sphinx documentation at some point. [

Building custom documentation workflows with Sphinx

Create documentation the way that works best for you.

Opensource.comMark Meyer

](https://opensource.com/article/18/11/building-custom-workflows-sphinx)

How to run a vaccination campaign/event with volunteers (2022, German)

I was part of the organizational team for a vaccination event in early 2022 in Hamburg for my party DIE LINKE. This article documents a bit of what happened there. Written to convey an uplifting spirit in the sense that the reader should have both an impetus to run their own campaign and general know-how about the scope of the undertaking. [

DIE LINKE impft, DIE LINKE wirkt!

Es kommt außerhalb des Wahlkampfs nicht oft vor, dass Bürger*innen Schlange stehen, wenn DIE LINKE ruft. Im Norden Hamburgs ist genau das passiert: Bei der „DIE LINKE impft“- Aktion standen bereits 160 Leute an, bevor es überhaupt losging. Mark Meyer von der Stadtteilgruppe Barmbek-Süd stellt das Re…

Links bewegt – Das Online-Magazin der LINKEN.Mark Meyer

](https://www.links-bewegt.de/de/article/479.die-linke-impft-die-linke-wirkt.html) Title photo by Denny Müller on Unsplash

The First French Polish

Starting a French polish can be daunting. I'll show you what ingredients and tools needed to complete a piece, what the process is like, and how long it will take. First, let's talk about the ingredients. Here's a list of all the things I got for the polish:

  • pumice, I bought a 500g pack, that'll last forever
  • shellac flakes, again a 500g bag will last for a while
  • ethyl alcohol 99+ vol-%, for dissolving and diluting
  • several small glass or plastic jars
  • some linen, some cotton, and some wool pieces
  • polishing oil, a clear mineral oil
  • styrax resin (benzoin) solution
  • measuring device, I use a micropipette
  • 400 grit sanding paper
  • a scale

The shellac coating happens in a four-step process. First, sand the object to 320 grit. The next step will use pumice and a thin shellac dilution to fill the pores. The piece will look slightly shiny, but the polish proper happens after that in the next step. The final step will clear all the rough places and marks of the polish. This last step is the styrax resin polish.

Preparing the Ingredients

I started by dissolving shellac flakes in ethanol, in a dilution of one part shellac on three parts alcohol by weight. Let this mixture sit for two to three days, shake it once per day, to make sure the shellac is well dissolved. Some people at this point recommend to filter the solution through an old sock to remove particulate matter from it, I didn't do this though. This solution is called the stem solution.

With the shellac dissolved, you're ready for the next step.

Cutting the Fad

The picture below shows two 'fads' in their jars. A fad is a three-piece bale of cloth that is used to apply shellac to the wood surface. The innermost piece is composed of wool (lambswool); this will act as a reservoir of shellac. The second layer is a sturdy piece of cotton. The outermost layer, in direct contact with the wood, is made out of coarse linen. This composition of the fad is a tradition. I think it works well. My fads weigh approximately 25g, when not filled. Look at your hand and size the fad accordingly. The important thing about its size is that it fits your hand well.

Prepare three fads. The micropipette, for measuring and filling

Filling the pores

In this step, we'll fill the wood's pores. Some wood species have larger pores than other species, so the process will vary by wood species. If you're refinishing an old piece of wood, the time it takes could be short, because the pores have already been closed. We'll use a fad with dilute shellac solution and pumice. The pumice is abrasive and combined with the shellac; this results in abrasion products that fill up the pores.

Make sure that the room you're polishing it in is reasonably heated. Anything from 20 to 24 degrees Celsius will work. If it's hotter, you'll experience problems, because the alcohol evaporates too quickly.

There are various recommendations on how to fill the shellac into the fad. I settled for a micropipette. The pipette allows me to put the same small amount of shellac solution in a quick and repeatable manner. But a syringe will easily do.

With the stem solution ready to go, we still need to dilute it further. For the pore filling, mix a 1:6 v/v dilution of stem solution and alcohol. That is 10ml of stem solution to 60ml of ethanol. Grab the first fad, fill it with shellac solution. The fad should always be cool to touch. It should not drip with the shellac solution. You can apply some pumice to the sanded surface, or you can dip the fad in pumice. Use circles and figure of eight movements to move the fad across the piece's surface. Use pressure to push the fad against the wood. You will notice when the fad is empty because it tends to stick to the wood. Refill it when this happens.

I did three pore fillings on three consecutive days. The pore-filling takes, depending on the size of your object, 15 to 30 minutes. After you're finished with the first pass, you need to let the piece dry for at least 24 hours. I usually start the next pore filling right on the next day. Before I do that, I give the object a quick touch with 400 grit sandpaper. Don't overdo it. It just needs a short pass with sandpaper. You might need to do more than three pore fillings, depending on the wood you're using.

The Main Polish

Now with the pores filled, it's time for the main polish. Prepare another shellac solution. This time it needs to be 1:3 v/v of stem solution in alcohol. That is 30ml of stem solution on 90ml of ethanol. Fill another fresh fad. This time, don't sand and don't use pumice. The surface should already be slightly shiny. Use the same process you used for the pore filling. Apply pressure and move the fad in a figure of eight patterns across the surface. Whatever you do, don't stop the fad on the wood. Always try to slide it off the surface. If you're in contact with the surface, keep the fad moving. You can use a drop or two of polishing oil to aid in moving the fad. Remove the oil later with the styrax resin polish.

I did three main polishes on three consecutive days. After every pass, the surface needs 24 hours to dry. You may want to do more than three passes, depending on the quality you want to reach. For the main polish, make sure you have a well-lit room, ideally with some light shining on the surface. You should be able to see the slight streaking the fad produces as it runs across the wood's surface.

The Styrax Resin Polish

I polished the wood, so I was sure that it now has a sufficient shellac cover, but it was not super shiny. Partly this was due to the polishing oil I used. The styrax resin polish at the end is optional but recommended as a finishing pass. Use the third fad and wet it with the styrax resin solution. Then with pressure, polish any streaks and smudges left on the surface until it has a high gloss look.

You should be left with a warm, high gloss surface that can last for a long time. But don't forget that this surface will be very delicate for a couple of months. Don't put it in direct sunlight and store it in a dry room. If you can stick to this, the finished object can last for a century. The finished box Clean your shellac surfaces with a moist cloth or a specially designated high gloss polish. Old shellac surfaces can be resurfaced with a thinned shellac solution.

Building a Spherebot

In this article I will give you some up-to-date instructions on how to build your own Eggbot/Spherebot derivative. This is still rough and not fully fleshed out, because I'm still in the process of tuning the build.

I hope these instructions are useful for future Spherebot builders.

Construction

I started out with the Spherebot files by Glasswalker on Thingiverse. Print all the files. This was not that easy. I'm using Cura to slice and I'm getting very bad results for the end plate. But in the end it worked out.

With all the parts printed, make sure that the threaded rods go easily into the end plates. Take your time and make them easily slide through the holes in the end plates. At first I didn't do that and I had some parts break because of that. So be careful.

In general I had problems with the printed parts. Many holes are just too tight to fit rods and axles through them. Spehrebot Shaft Coupler I'm still fighting with pen arm shaft coupler to properly fit onto the shaft of one of the stepper motors. It fits badly and sometimes just falls off.

I used NEMA17 stepper motors for the two axes, they fit perfectly. For the servo I used this product from Amazon. They fit but it's pretty hard to tighten them. I need to glue them with proper glue. Despite the motors and servos you need a couple of small metric screws. Fortunately the Welcome Werkstatt had all of these in stock, so I did not order anything for that part.

Electronics

When everything is assembled as per the directions given by Glasswalker, you're ready to start working on the electronics side of things. I used an Arduino Uno for the controller and A4988 DMOS stepper drivers to drive the motors. With this setup, don't use the old Arduino sketch you find linked on Glasswalkers Thingiverse site, instead use thunderbug1's Arduino sketch that is part of his Github repo for the Spherebot Host GUI. Spherebot Arduino Electronics If you use the Spherebot Firmware from thunderbug1 you'll have to set the stepper drivers to 16-step microstepping. Also, note that the connections for this firmware and the original Spherebot firmware are different. ArduinoStepper DriverD5rotation, enable stepperD6rotation, stepD7rotation, directionD11pen arm, enable stepperD12pen arm, stepD13pen arm, direction You will also need to connect the following pins of the A4988 breakout board. PinConnectionRESET``SLEEP``SLEEP``RESETMS1Logic+MS2Logic+MS3Logic+ There's a direct connection between RESET and SLEEP, this allows the driver to function. The connections between MS1, MS2, and MS3 to the positive logic supply voltage will set the driver into 16-step microstepping mode.

Besides the stepper breakout boards, you will need some 100uF capacitors to buffer the input for the motors. And there's one step you definitely have to take: calibrating the stepper drivers to deliver the right amount of current to the stepper motors.

You want the motors to be driven at their rated current. This means you need to find the current sense resistor (R_{sense}) on the A4988 breakout board. This determines the (V_{ref}) according to the following formula.

[V_{ref} = I_{motor} * 8 * R_{sense}]

With your motors not connected, adjust the current settings of the motors.

On the A4988 boards you will find a small metal potentiometer, connect your multimeter negative terminal to ground and the positive terminal to the potentiometer. Measure the voltage. Adjust the potentiometer so the voltage you read is equal to to the (V_{ref}) calculated earlier.

For me the current sense resistor was 0.1 Ohm, and the rated current of the motors was 1.2A, so I adjusted the voltage to (1.2A * 8 * 0.1Ohm = 0.96V). But these values can vary substantially from vendor to vendor.

Think about the power supply. I had problems with a weak power supply. When the board would drive just one motor, motion was super smooth and controlled. When I switched on the second motor, motion would become shaky and the motors would loose a lot of steps and generally not perform.

I'm currently in the process of replacing the weak lab supply with an old ThinkPad power adapter, to make sure the motors can draw enough current.

Software

With the hardware ready to go, flash the Arduino sketch you find in thunderbug1's Github repository to the Arduino. You should now have a working Spherebot.

thunderbug1 has a host controller in this Github repository. Try using this controller, it's by far the best option I have seen to control your Spherebot.

A digital tally list for hackerspaces

I'm a member of an open workshop in my hometown. Last week we started joking around about getting a drink vending machine. Still half joking, I started searching on eBay for used vending machines. While on my way to a pub, I pictured having a vending machine for the workshop: cashless, probably driven by Stripe.

While at the pub, my idea was quickly voted down. Instead the idea that gained traction was a digital tally list. We started sketching out this plan. It would be driven by the same RFID tokens that give you access to the workshop. We were unsure about having a prepaid or a postpaid model.

This problem looked like it was sized in a way that we could clear out the major road blocks during my vacation last week. The pub appointment was on Tuesday, I started work on Wednesday and had some basic demo running by the end of the day. I continued on Thursday and had more features and a more streamlined UI by the end of the day.

On Friday I slapped a license on it and evaluated our RFID options. Basically the RFID token we use as a key supports the MIFARE protocol, so we can go with the cheapest reader hardware that is available at 5 Eur a piece. Right now we're still in a state where we enter a UID on the command line, when prompted, instead of running with the actual reader. But the prompt is already running in its own thread and I'm pretty sure we can just connect the RFID reader in this way.

On Sunday a very talented friend joined in and he re-styled the entire app with the workshop's corporate design. Simplifying stuff on his way.

Overall our plan is to write a digital tally list in two weeks, going from idea to running prototype. This tally list should support donations with a variable amount, drinks with set price, as well as assorted items like the workshop fee. It also needs to support rudimentary user management and some kind of admin interface. All users will be verified by RFID.

Currently consumption is logged into a monthly log-file, so we can easily handle the payments. Users are managed by the UI itself, we just have to put the initial UID into a json file. Drink prices are read from JSON and a price update requires a restart of the app. The app itself will run on a Raspberry PI with an attached 7" display and an RFID reader attached via the serial port.

The entire app is written in Python with a QML frontend.

I'm ordering the RFID hardware and the display this week, so we have a full weekend of hacking ahead of us.

Here we go. Screenshot after the first week. Let's see if we make this.

Code lives here

Sphinx Docs Topics

I've a set of Sphinx topics online

Themes and customization

Workflow issues

Image credit: https://commons.wikimedia.org/wiki/File:Great_Sphinx_of_Giza_-_20080716a.jpg Wikipedia user Barcex

A tour of the Read the Docs Sphinx theme

Today I want to take you on a tour of the Read the Docs theme for Sphinx. We'll look into what goes into it and then look at what web technologies are being used to make this theme happen. In a different take from the theme's own documentation, our journey will take us through the internals of the theme, not its use.

The Read the Docs theme is a good starting point for looking into the anatomy of custom Sphinx themes. It is widely used and has a large feature set. Additionally it is permissively licensed free software, so you can go ahead and base customizations on it.

Have a look at the top-level folder of the theme here https://github.com/rtfd/sphinx_rtd_theme You'll find the top-level folders sass, js, and fonts. There is also a bower.json and a Gruntfile.js.

The build process

Sphinx themes are mostly static assets, but to get to that state the RTD theme will compile the basic elements from a set of inputs. Bower (https://bower.io/) is used to pull the requirements for the build process into the build environment. After this is complete, you will call Grunt (https://gruntjs.com/) to run the build process.

The primary part of the Grunt build consists of running the SASS CSS pre-processor to compile the SASS templates into proper CSS. After this is done, JavaScript and CSS get some polish so they'll be more easily delivered to users. Then static files like fonts are copied into place and off we go. After the build process is finished, you will have an install-ready Sphinx theme.

The core templates

The core of the theme is formed by a set of Jinja template files. These files live in a Python package, in the same way the Sphinx theming documentation recommends (http://www.sphinx-doc.org/en/master/theming.html). When the package's setup function gets called, it will add its own directory to the list of template directories.

Of the templates you'll find in the sphinx_rtd_theme folder, only layout.html (yes this is a template) is a full fledged template in the sense that it can render a complete HTML page. This file includes a DOCTYPE declaration to indicate that this is HTML5.

The basic page template has to include all the required JavaScript. It does this, by including Modernizr (https://modernizr.com/) which is used to detect browser features. It then adds all the elements of the script_files array to the page and completes the process by including its own theme.js.

To complete the prerequisites for page rendering, template.html adds its own CSS file to the header and continues with the vanilla Pygments CSS (http://pygments.org/), finishing up with any files that were put into extra_css_files.

Navigation and search

The theme has three main navigation aids. There is the well known Sphinx toctree that gets rendered into every page. There are the breadcrumbs in breadcrumbs.html, which provide a way for the user to visualize their position in the document collection and a way to jump to central points. And finally there is the footer which provides "next" and "previous" buttons.

Search in Sphinx is a bit special, because it is implemented on the client-side of the browser. The RTD theme has support for this feature of Sphinx, and it also customizes the feature in a visual way.

The CSS code

One of the major parts of the theme (at least by lines of code) is the CSS set of rules that lead to a nice looking page.

The major entry point into the theme is theme.sass, which then ties all the other files in this directory together and also includes external definitions.

The SASS definitions use Wyrm (http://wyrmsass.org/) for a lot of boilerplate functionality as well as Neat (https://neat.bourbon.io/) to create a base grid. Additionally FontAwesome is used to clue in the user with icons.

In addition to supporting the features the theme brings to the table (like breadcrumbs), it will style MathJax code. But the core of the RST element formatting resides in _theme_rst.sass, which has all the details on how to handle the different RST markup elements.

Testing

Finally there are some tests for this theme. These are real tests, they can run automatically, and can serve as a kind of smoke-test, to alert when something is seriously wrong with the theme.

The test are located in tests in the file test_builders.py. They will essentially render a documentation project and then do some sanity checks on the HTML output.

Summary

The Sphinx has a big feature set and is a good candidate for basing your own themes on. This theme is heavy on JavaScript and modern web frameworks. In my opinion it could be a little bit more Python oriented, but you can avoid JavaScript only for so long if you want to produce a modern looking web page as the output.

This post serves a bit as a personal memory aid, and a nudge to get familiar with some front-end technologies, which I have been avoiding in the past.

Title image: Labyrinth 28, etching, aquatint, soft-ground etching, mm.180x330, Engraved and designed by Toni Pecoraro 2007. http://www.tonipecoraro.it/labyrinth28.html