Blacksmithing For The Uninitiated: What is a Forge?

Blacksmiths were the high technologists of fabrication up until the industrial revolution gained momentum. At its core, this is the art and science of making any needed tool or mechanism out of metal. Are you using the correct metal? Is the tool strong where it needs to be? And how can you finish a project quickly, efficiently, and beautifully? These are lessons Blacksmiths feel in their bones and it’s well worth exploring the field yourself to appreciate the knowledge base that exists at any well-used forge.

I had an unexpected experience a few days ago at the Hacker Hotel weekend hacker camp in the Netherlands. At the side of the hotel our friends at RevSpace in The Hague had set up a portable forge. There was the evocative coal fire smell of burning coke from the hearth, an anvil, and the sound of hammering. This is intensely familiar to me, because I grew up around it. He may be retired now, but my dad is a blacksmith whose work lay mostly in high-end architectural ironwork.

Working the RevSpace forge at Hacker Hotel, in not the most appropriate clothing for the job.
Working the RevSpace forge at Hacker Hotel, in not the most appropriate clothing for the job.

The trouble is, despite all that upbringing, I don’t consider myself to be a blacksmith. Sure, I am very familiar with forge work and can bash metal with the best of them, but I know blacksmiths. I can’t do everything my dad could, and there are people we’d encounter who are artists with metal. They can bend and shape it to their will in the way I can mould words or casually solder a tiny surface-mount component, and produce beautiful things in doing so. My enthusiastic metal-bashing may bear the mark of some experience at the anvil but I am not one of them.

It was a bit of a surprise then to see the RevSpace forge, and I found myself borrowing a blacksmith’s apron to protect my smart officewear and grabbing a bit of rebar. I set to and made a pretty simple standard of the dilletante blacksmith, a poker with a ring on one end. Hammer one end of the rebar down to a point, square off the other end for just over 3 times the diameter of the ring, then bend a right angle and form the ring on the pointy end of the anvil. Ten minutes or so of fun in the Dutch sunshine. Working a forge unexpectedly brought with it a bit of a revelation. I may not be a smith of a high standard, but I have a set of skills by virtue of my upbringing that I had to some extent ignored.

Where others might have put effort into learning them, they’re things I just know. It had perhaps never occurred to me that maybe all my friends in this community didn’t learn how to do this by hanging round the forge next to the house they grew up in. If I have this knowledge merely by virtue of my upbringing, perhaps I should share some of it in a series of articles for those in our community who’ve always fancied a go at a forge but have no idea where to start.

Continue reading “Blacksmithing For The Uninitiated: What is a Forge?”

Yes, You Can Put IoT on the Blockchain using Python and the ESP8266

Last year, we saw quite a bit of media attention paid to blockchain startups. They raised money from the public, then most of them vanished without a trace (or product). Ethics and legality of their fundraising model aside, a few of the ideas they presented might be worth revisiting one day.

One idea in particular that I’ve struggled with is the synthesis of IoT and blockchain technology. Usually when presented with a product or technology, I can comprehend how and/or why someone would use it – in this case I understand neither, and it’s been nagging at me from some quiet but irrepressible corner of my mind.

The typical IoT networks I’ve seen collect data using cheap and low-power devices, and transmit it to a central service without more effort spent on security than needed (and sometimes much less). On the other hand, blockchains tend to be an expensive way to store data, require a fair amount of local storage and processing power to fully interact with them, and generally involve the careful use of public-private key encryption.

I can see some edge cases where it would be useful, for example securely setting the state of some large network of state machines – sort of like a more complex version of this system that controls a single LED via Ethereum smart contract.

What I believe isn’t important though, perhaps I just lack imagination – so lets build it anyway.

Continue reading “Yes, You Can Put IoT on the Blockchain using Python and the ESP8266”

Threading 3D Printed Parts: How to Use Heat-Set Inserts

We can make our 3D-printed parts even more capable when we start mixing them with some essential “mechanical vitamins.” By combining prints with screws, nuts, fasteners, and pins, we get a rich ecosystem for mechanism-making with capabilities beyond what we could simply print alone.

Today I’d like to share some tips on one of my favorite functional 3D-printing techniques: adding heat-set inserts. As someone who’s been installing them into plastic parts for years manually, I think many guides overlook some process details crucial to getting consistent results.

Make no mistake; there are a handful of insert guides already out there [1, 2]. (In fact, I encourage you to look there first for a good jump-start.) Over the years though, I’ve added my own finishing move (nothing exotic or difficult) which I call the Plate-Press Technique that gives me a major boost in consistency.

Join me below as I fill in the knowledge gaps (and some literal ones too) to send you back to the lab equipped with a technique that will give you perfectly-seated inserts every time.

Continue reading “Threading 3D Printed Parts: How to Use Heat-Set Inserts”

Drops of Jupyter Notebooks: How to Keep Notes in the Information Age

Our digital world is so much more interactive than the paper one it has been replacing. That becomes very obvious in the features of Jupyter Notebooks. The point is to make your data beautiful, organized, interactive, and shareable. And you can do all of this with just a bit of simple coding.

We already leveraged computer power by moving from paper spreadsheets to digital spreadsheets, but they are limited. One thing I’ve seen over and over again — and occasionally been guilty of myself — is spreadsheet abuse. That is, using a spreadsheet program to do something I probably ought to write a program to do. For those times that you want something quick but want something more than a spreadsheet, you should check out Jupyter Notebooks. The system is most commonly associated with Python, but it isn’t Python-specific. There are over 100 languages supported — many community-developed. You can even install a C++ interpreter backend for it. Because of the client/server architecture, it is very simple to share notebooks with other users.

You can — in theory — use Jupyter for anything you could use Python for. In practice, it seems to get a lot of workout with people analyzing large data sets, doing machine learning, and similar tasks.

The Good: Simple, Powerful, Extensible

The idea is simple. Think of a Markdown-enabled web page that can connect to a backend (a kernel, in Jupyter-speak). The backend can run on your machine or remotely and will support some kind of language — often Python. The document has cells that line up vertically (like a single wide spreadsheet column). For example, here’s a simple notebook I created to explain how a bunch of sine waves add up to a square wave:

Continue reading “Drops of Jupyter Notebooks: How to Keep Notes in the Information Age”

Building A Simple Python API for Internet of Things Gadgets

It’s no secret that I rather enjoy connecting things to the Internet for fun and profit. One of the tricks I’ve learned along the way is to spin up simple APIs that can be used when prototyping a project. It’s easy to do, and simple to understand so I’m happy to share what has worked for me, using Web2Py as the example (with guest appearances from ESP8266 and NodeMCU).

Barring the times I’m just being silly, there are two reasons I might do this. Most commonly I’ll need to collect data from a device, typically to be stored for later analysis but occasionally to trigger some action on a server in the cloud. Less commonly, I’ll need a device to change its behavior based on instructions received via the Internet.

Etherscan is an example of an API that saves me a lot of work, letting me pull data from Ethereum using a variety of devices.

In the former case, my first option has always been to use IoT frameworks like Thingsboard or Ubidots to receive and display data. They have the advantage of being easy to use, and have rich features. They can even react to data and send instruction back to devices. In the latter case, I usually find myself using an application programming interface (API) – some service open on the Internet that my device can easily request data from, for example the weather, blockchain transactions, or new email notifications.

Occasionally, I end up with a type of data that requires processing or is not well structured for storage on these services, or else I need a device to request data that is private or that no one is presently offering. Most commonly, I need to change some parameter in a few connected devices without the trouble of finding them, opening all the cases, and reprogramming them all.

At these times it’s useful to be able to build simple, short-lived services that fill in these gaps during prototyping. Far from being a secure or consumer-ready product, we just need something we can try out to see if an idea is worth developing further. There are many valid ways to do this, but my first choice is Web2Py, a relatively easy to use open-source framework for developing web applications in Python. It supports both Python 2.7 and 3.0, although we’ll be using Python 3 today.

Continue reading “Building A Simple Python API for Internet of Things Gadgets”

Hack My House: Garage Door Cryptography Meets Raspberry Pi

Today’s story is one of victory and defeat, of mystery and adventure… It’s time to automate the garage door. Connecting the garage door to the internet was a must on my list of smart home features. Our opener has internet connection capabilities built-in. As you might guess, I’m very skeptical of connecting a device to the internet when I have no control over the software running on it.

The garage door is controlled by a button hung on the garage wall. There is only a pair of wires, so a simple relay should be all that is needed to simulate the button press from a Raspberry Pi. I wired a relay module to a GPIO on the Pi mounted in the garage ceiling, and wrote a quick and dirty test program in Python. Sure enough, the little relay was clicking happily– but the garage door wasn’t budging. Time to troubleshoot. Does the push button still work? *raises the garage door* yep. How about the relay now? *click…click* nope.

You may have figured out by now, but this garage door opener isn’t just a simple momentary contact push button. Yes, that’s a microcontroller, in a garage door button. This sort of scenario calls for forensic equipment more capable than a simple multimeter, and so I turned to Amazon for a USB oscilloscope that could do some limited signal analysis. A device with Linux support was a must, and Pico Technology fit the bill nicely.

Searching for a Secret We Don’t Actually Need

My 2 channel Picotech oscilloscope, the 2204A, finally arrived, and it was time to see what sort of alien technology was in this garage door opener. There are two leads to the button, a ground and a five volt line. When the button is pressed, the microcontroller sends data back over that line by pulling the 5 V line to ground. If this isn’t an implementation of Dallas 1-wire, it’s a very similar concept.

Continue reading “Hack My House: Garage Door Cryptography Meets Raspberry Pi”

Linux Fu: Easier File Watching

In an earlier installment of Linux Fu, I mentioned how you can use inotifywait to efficiently watch for file system changes. The comments had a lot of alternative ways to do the same job, which is great. But there was one very easy-to-use tool that didn’t show up, so I wanted to talk about it. That tool is entr. It isn’t as versatile, but it is easy to use and covers a lot of common use cases where you want some action to occur when a file changes.

Continue reading “Linux Fu: Easier File Watching”