Categories: 3d printing (14) arcade cabinet (6) arduino (2) backup (4) blogofile (4) dns (8) mailbox alert (62) making (12) projects (116) RAID (4) rants (24) raspberry pi (2) site (26) ultimaker (4)

Networked Ultimaker with Raspberry Pi (on linux)

2012-08-04 | Permalink

I got my Raspberry Pi yesterday!

Installation of the provided Debian image is a breeze (just make sure you have an SD card and a micro-USB cable lying around). And I am happily playing with it right now.

I didn’t have a real Plan to use it yet, so in the meantime I’m using it to control my Ultimaker over a network; Due to physical constraints, I have my printer in the same room as my main desktop system, but out of reach for any sane USB cable. I have a laptop sitting right next to it to control it now, and I am thinking of getting an [Ulticontroller](https://shop.ultimaker.com/en/parts-and-upgrades/ulticontroll er-ultipanel.html).

But the laptop is slow, and I want to at least be able to send prints from my main machine to the Ultimaker. Also, should I get rid of the laptop, I have more room to stuff tools and prints. It’s getting a bit messy.

So, Use 1 for the Raspberry Pi was born!

Originally I was thinking of writing a fake serial driver, that passed on all data to a fake serial client, running on the Pi, but it turns out that isn’t even necessary; we can use the socat tool.

I have not fully fleshed out all details yet, and there are some current problems, but I thought I’d share.

Basic steps:

  1. Install socat on client and on raspberry pi
  2. Connect Raspberry to network
  3. Connect Raspberry to Ultimaker
  4. On raspberry, run:
  1. On client machine, run:

(I used port 12346 for no reason at all)

Go to your controller tool (e.g. PrintRun), and set the port to ~/ttyACM1.

And start printing!

Well, not exactly. While the above works with PrintRun, it does not with Cura.

Cura appears to have a fixed set of possible ports (I can’t edit the field), so we’ll have to use one of the standard names. This presents us with a problem, since in order to use, for instance /dev/ttyACM0, we’ll need to run socat as root. And if we run socat as root, our client (which we will certainly not run as root), can’t connect.

A quick workaround is to change ownership of /dev/ttyACM0 once socat is running;

sudo socat -d PTY,link=/dev/ttyACM0,raw,echo=1,wait-slave tcp:192.168.8.24:12346
chown <your username> /dev/ttyACM0

I suspect there may be some option within socat for this, but I have not looked for it yet.

Obviously, this also ‘opens’ your printer to your entire network. You can also do it without the listening side, though, but you probably want to set up ssh-keys first, so you do not need to enter a password every time. Once you have, you can use something like:

 socat PTY,link=~/ttyACM0,raw,echo=1,wait-slave EXEC:'"ssh \
 pi@<IP address of raspberry> socat - /dev/ttyACM0,nonblock,raw,echo=0,\
 b<your Ultimaker firmware baudrate>"'

There are more issues:

  • The socat instances can quit, in which case you need to run them again, so at this point it is not a fire-and-forget kind of initialization.
  • I have no idea what will happen if you plug in something that might initialize a serial port itself. I hope socat is nice in registering itself (so the tty will not be assigned to something else), but I have not tried this out.
  • You may not want to do this over a flaky WiFi connection.

Anyway, I’m using this to print out a case for my raspberry right now. Let’s see how it goes!

Ultimaker

2012-08-04 | Permalink

So a while ago, I got myself an Ultimaker

And while I do not want to degrade the usefullness by calling it a toy, I would like to say

Ultimaker

Best. Toy. Ever.

It uses a printing technique called FFF, which I guess is just another term for FDM, which builds an object by depositing plastic one layer at a time.

It is sold as a kit, and it took me two evenings (and part of a night) to build. Ever since then I have been happily making little things with it.

You do have to realize that it is quite the DIY project; for the Ultimaker kit you do not need to do any soldering, but don’t expect perfect prints straightaway; 3d-printing itself has a learning curve, and you’ll be tweaking and playing around with your machine to improve it as well.

I’d estimate that I spend about half the time fixing, calibrating, and improving the machine itself, and half the time actually printing other things. I love it, but before you go out and get one for yourself, you do have to realize this.

But that is one of the great things about these 3d-printers; you can print improvements for your printer as well. Or even entire new printers (without the electronics, obviously).

For instance, I’ve printed

  • several forms of belt tensioners
  • a tube holder for the hot-end
  • a handle to carry the Ultimaker around
  • a new fan duct for the hot-end

But also a lot of non-ultimaker things;

  • the infamous geared heart
  • a nice little decorative dragon
  • a dock for my phone
  • presents for people :)

The ultimaker is pretty actively worked on, both by Ultimaking inc. itself, and by its community; for instance, recently a lot of work has been put into improving the filament feed mechanism, and currently people are looking at better ways to build the hot-end.

For things to print, Thingiverse is a great resource. I regularly check it to see what to print next.

Small script to create Blogofile posts

2012-08-04 | Permalink

I’ve written a very small Python 3 script to initialize Blogofile posts;

It generates a post number, prompts for a title, automatically sets the date, and adds an empty categories field.

It uses the basic simple-blog conventions, but the script should be easy enough to change to your setup.

Not very useful (yet?), but it makes starting a post just that tiny bit easier.

#!/usr/bin/python3

#
# Simple helper tool to create blog entries.
#

import datetime
import os
import re

EDITOR='<editor here>' # I use 'geany -l7'
BLOG_ENTRY_PATH='<(sub)directory of _posts here>'

def find_next_number(path):
    '''Reads the directory, and returns the first available post number'''
    all_post_numbers = []
    all_files = os.listdir(path)
    p = re.compile('^([0-9]+)\s+')
    for filename in all_files:
        match = p.match(filename)
        if match:
            all_post_numbers.append(int(match.group(1)))
    all_post_numbers.sort()
    return all_post_numbers[-1] + 1;

def prompt_for_title():
    return input('Post title: ')

def get_new_date():
    now = datetime.datetime.now()
    return now.strftime('%Y/%m/%d %H:%M:%S')

class Post:
    def __init__(self, path, number, title, date_str):
        self.path = path
        self.number = number
        self.title = title
        self.date_str = date_str

    def get_filename(self):
        filename = '%03d - %s.markdown' % (self.number, self.title)
        return os.path.join(self.path, filename)

    def create_file(self):
        with open(self.get_filename(), 'w') as out_f:
            out_f.write('---\n')
            out_f.write('title: ' + self.title + '\n')
            out_f.write('date: ' + self.date_str + '\n')
            out_f.write('categories: \n')
            out_f.write('---\n')
            out_f.write('\n')

number = find_next_number(BLOG_ENTRY_PATH)
title = prompt_for_title()
date = get_new_date()
post = Post(BLOG_ENTRY_PATH, number, title, date)
print(post.get_filename())
post.create_file()
os.system('%s "%s"&' % (EDITOR, post.get_filename()))

Updated RRType List

2012-07-31 | Permalink

Today, the page with DNS RR types got a little bit of attention, and made a short round on twitter. Which of course reminded me that I had not updated it for quite some time now.

There were some nice ideas from @digdns and @Habbie, most importantly a way to automatically match it to the official IANA page, and a more parseable page (in, for instance, xml) for others to use (Thanks btw :)).

I had originally just made the list directly in HTML, which is of course no way to go, and I’m almost ashamed to admit it.

But now I have written a nice little script that reads a csv file and generates the page. It also matches entries on the official IANA registry to see if it is missing any. It does not (yet?) see if the data is correct, since I’m storing different data in my list.

This script also has the potential to output something parseable, but I have not gotten to that yet, I first want to do the checking better.

Anyway, I did update the list, fixed a few entries, and added missing ones.

Happy, er, rrtyping!

Moving tjeb.nl to Blogofile

2012-07-29 | Permalink

clcms has served me well for the past 6 years, but it is time to move on. I wanted to do some things that it didn’t really support, to make my site more, well, ‘bloggy’, and had almost started an entire new project for it, but I figured there are just too many static site generators available.

So I scoured the wastelands of the Internet, and after a long and arduous journey, found Blogofile.

Or well, it was one of the 3 frameworks I considered, and this one had a quote from Spaceballs in its documentation. Score. It also happened to look and behave almost exactly like what I had in mind for clcms-v2.

Over the weekend I’ve been moving my site over, and I got to the point where I’m comfortable enough with it to make the switch. I did make some custom templates and hacked the blog controller in a few ways. I may even post about them shortly, now that I have an Official Blog (tm).

So as of now, this site is proudly powered by Blogofile! (applause, beer all around). You can enjoy the biggest new feature, an RSS feed, right away (see the bottom of the page).

During the move, I did remove some legacy pages (like clcms, which is now officially retired), and updated the looks a trivial amount, but nothing too big yet. If you want to see the difference, if you are missing something, or if something that used to work does no longer, I kept the old site around for now at http://old.tjeb.nl.

But if there’s anything wrong with the site, please let me know :)

I’m not entirely done yet; I want to create some filters for easier linking within posts and pages, and I need to go through all my old entries and add categories. And maybe, if I can stomach the CSS, I’ll even update the looks a bit more. And then there’s a lot of things I want to add, but we’ll get to that when we get to that.

For now I’m just gonna enjoy having a new framework to manage my site.

Happy browsing!

mailboxalert 0.16.1

2011-12-14 | Permalink

It is here! Mailbox Alert 0.16.1!

0.16 should already fix most (if not all) the ongoing problems with the cursed 0.15 release.

But as my previous post already said, not all woes were over, and I made a mistake when uploading the final release file. This update should correct those.

See the full changelog here:

Changelog

And get the addon itself if you are not using addons.mozilla.org here:

Direct download

Happy mailing

mailboxalert 0.16

2011-12-07 | Permalink

Mailbox Alert update; 0.16 has been released through addons.mozilla.org.

It contains fixes for a number of issues people had with 0.15 (the biggest one being that it didn’t work consistently with the internal messaging system across several thunderbird versions).

However, in my enthusiasm, I uploaded a wrong file to AMO, and it did not contain a few important fixes and cleanups.

Unfortunately, these weren’t considered important enough to hold off releasing it by the reviewer (since in most cases it does work). I immediately fixed the issues (by changing the version to 0.16.1 and uploading the version I should have sent in the first place), but I’m holding off the version here until that one has been reviewed.

I hope this will be done soon, and I hope this was just some fallout from the cursed 0.15 release, and 0.16 will be nothing but ponies and candysticks from now on.

mailboxalert 0.14.4

2011-02-13 | Permalink

And more fixes for Mailbox Alert:

  • Fixed a problem where the check if a command is executable failed on Windows, even though the command would run fine
  • Fixed a problem where the folder was not always correctly selected with the ‘Open in current window’ option

Changelog

Direct download

Yes I am still working on all those features you all requested. It’s a lot :p

Only some of them will make it to 0.15…

Happy mailing :)

mailboxalert 0.14.5

2011-02-13 | Permalink

And yet more fixes for Mailbox Alert:

  • Fixed an issue on Thunderbird 2 caused by a changed internal API, where alerts would not fire at all in some circumstances.
  • Fixed another issue with Thunderbird 2 where ’execute a command' did not work for some executables.

Changelog

Direct download

Happy mailing

mailboxalert 0.15.0

2011-02-13 | Permalink

Big update to Mailbox Alert!

Configuration has changed, and you can now set alerts as a Thunderbird filter action!

Changelog

Direct download

I also added a separate Manual. It needs some work, but it’s better than nothing :)

There are some open issues; I just discovered the global mute doesn’t work anymore, the reviewer had some good points, and I did not yet find a good way to pass around the full message body (a much requested feature). Another feature that did not make it yet is alert customization. The first two of these will be addressed in 0.15.1. I shall ponder on the bigger ones for 0.16 :)

Once again, happy mailing