Hacklet 31 – Software Tools

For every computer error, there are two human errors, and one of them is blaming the computer. Whenever a human blames a computer for something, there are two tools, and one of them is the computer.

Not all of your nifty tools need to be fancy robots, CNC machines, or nifty Robertson screwdrivers; a computer is equally capable of being a fantastic tool, provided it has the right software. For this week’s Hacklet, we’re going through some of the best software tools on hackaday.io.

6653681421957570397[Alan] was inspired to build a software tool for making sewing patterns. Sewing patterns are usually designed for the ‘average’ person, but if you’re making custom wearables, you should end up with a piece of clothing that fits perfectly.

The first project [Alan] is using this tool for is a fleece cap that fits the contour of his head. He captured a 3D mesh of his head, imported the mesh into Blender, and unwrapped the resulting mesh. The two halves of the hat were then plotted with a Silhouette Cameo, cut out of fleece, and sewn together. The result is a beanie that fits perfectly around [Alan]’s head. It’s an extremely cool and novel application of 3D modeling, and if you ever need to wrap a 3D object with a 2D material, this is the project you want to check out.

5869061407871295021 And you thought the autorouter in Eagle was bad.

[Anderson] built a tool called Pyrite that will take a schematic and build a layout in three-dimensional space. He calls them Volumetric Circuits, and it’s basically the point-to-point wiring found in old radios and amplifiers taken to the next level. We featured this project before, and there haven’t been many updates since then. Maybe giving [Anderson]’s project a few skulls will help motivate him to get back to the project.

133031421839442989 Not satisfied with the existing free and open source CAM programs, [Snegovick] started work on his own.

[Snegovick] calls his project BCAM, and it’s exactly what you need to mill holes in PCBs, cut gears with a CNC router, engrave plastic, and anything else a 2.5 axis CNC machine can do. The project is written in Python, and yes, the source is available. Supported operations include drilling, path following, offset path following, and pocketing.

Write enough microcontroller projects, and you’ll eventually come up with your own library of common code that does one thing and one thing well. If you’re smart, you’ll reuse that code in future projects. [ericwazhung] is cutting through the hard part of developing all this code and released some things that are useful in a whole lot of projects.

Included in the commonCode library are the usual ‘heartbeat LED’, non-blocking input, a standard interface for AVR timers, bitmaps of text characters, DC motor control, and a whole bunch more. Extremely useful in any event.

That’s it for this round of the Hacklet, bringing you the best hackaday.io has to offer.

Making Mittens For A Smartphone

For those of us in the slightly inhospitable parts of the northern hemisphere, it’s freaking cold outside. Spring can’t come sooner, and smartphones won’t work if you’re wearing normal gloves. Smartphones will work if you sew a few bits of conductive thread into your gloves, but if you prefer mittens, you’re out of luck. That’s alright, because [Becky] at Adafruit has great guide for knitting your own smart phone mittens.

Intellectually, the concept of weaving fabric is fairly simple – it’s just interlaced threads that form a flexible sheet. Sewing, too, is fairly straightforward. Knitting, on the other hand, is weird. It’s a single string tied to itself that forms a 3D shell. If you’ve ever picked up a pair of knitting needles, you’ll soon realize whoever invented knitting is perhaps the greatest forgotten genius in all of human history. Lucky, then, that [Becky] has a lot of links that go through how to knit, and how to turn yarn into a pair of mittens with this pattern.

To make these mittens work with a smartphone, [Becky] is using a stainless conductive yarn stitched into the thumb and fingertips of the mitten. It works, and now you can use your touchscreen device no matter how cold it is.

Continue reading “Making Mittens For A Smartphone”

An Adjustable Sit/Stand Desk for Under $100

[Cornel Masson] is a 46-year-old computer programmer. He’s been working on his computer for the last 30 years. Computer work can be good for the wallet but it can be bad for our health, particularly the neck and back. You can purchase adjustable desks to allow you to change positions from sitting to standing, but unfortunately these desks are often expensive. [Cornel] took matters into his own hands and build his own adjustable riser for under $100.

To start, [Cornel] used a typical computer desk. He didn’t want to build the entire thing from scratch. Instead he focused on building a riser that sits on top of the desk, allowing him to change the height of both the monitor and keyboard. His design used mostly wood, aluminum stock, threaded rods, and drawer slides.

The main component is the monitor stand and riser. The riser is able to slide up and down thanks to four drawer slides mounted vertically. [Cornel] wanted his monitor to move up and down with ease, which meant he needed some kind of counter weight. He ended up using a gas strut from the trunk of a Nissan, which acts as a sort of spring. The way in which it is mounted makes for a very close approximation of his monitor’s weight. The result is a monitor that can be raised or lowered very easily. The stand also includes a locking mechanism to keep it secured in the top position.

The keyboard stand is also mounted to drawer slides, only these are in the horizontal position. When the monitor is lowered for sitting, the keyboard tray is removed from the keyboard stand. The stand can then be pushed backwards, overlapping the monitor stand and taking up much less space. The keyboard stand has small rollers underneath to help with the sliding. The video below contains a slideshow of images that do a great job explaining how it all works.

Of course if replacing the entire desk is an option go nuts.

Continue reading “An Adjustable Sit/Stand Desk for Under $100″

Bipolar bot for drawing spirals

[Bart Dring] is well known around these parts for Makerslide, the buildlog.net laser cutter, and a collaboration with Inventables for the Carvey CNC machine. They’re all popular projects and all very useful. This one, not so much. It’s a bipolar bot that doesn’t take itself too seriously, and this year’s build for [Bart]’s usual gonzo CNC machine for ORD Camp.

The Bipolar Bot – yes, that’s its name – is pretty much a SCARA bot. There are two NEMA 14 steppers in the joint of two arms, each of which are bolted to a bearing on a base plate with the other end holding a pen. That’s it as far as the mechanics go, but the software is extremely interesting.

The steppers are driven by an Arduino with the help of a tool that converts Cartesian Gcode to the bipolar Gcode the machine requires. There’s a bit of math involved, but nothing of note if you can code some trig functions

Right now the bipolar bot is busy drawing stuff that looks like it came right off a spirograph. You can see a video of that below.

Continue reading “Bipolar bot for drawing spirals”

Security Problems with Gas Station Automated Tank Gauges

[HD Moore] recently posted an article on Rapid 7’s blog about an interesting security problem. They’ve been doing some research into the security of automated tank gauges (ATGs). These devices are used at gas stations and perform various functions including monitoring fuel levels, tracking deliveries, or raising alarms. [Moore] says that ATGs are used at nearly every fueling station in the United States, but they are also used internationally. It turns out these things are often not secured properly.

Many ATG’s have a built-in serial port for programming and monitoring. Some systems also have a TCP/IP card, or even a serial to TCP/IP adapter. These cards allow technicians to monitor the system remotely. The most common TCP port used in these systems is port 10001. Some of these systems have the ability to be password protected, but Rapid 7’s findings indicate that many of them are left wide open.

The vulnerability was initial reported to Rapid 7 by [Jack Chadowitz]. He discovered the problem due to his work within the industry and developed his own web portal to help people test their own systems. [Jack] approached Rapid 7 for assistance in investigating the issue on a much larger scale.

Rapid 7 then scanned every IPv4 address looking for systems with an open port 10001. Each live system discovered was then sent a “Get In-Tank Inventory Report” request. Any system vulnerable to attack would respond with the station name, address, number of tanks, and fuel types. The scan found approximately 5,800 systems online with no password set. Over 5,300 of these stations are in the United States.

Rapid 7 believes that attackers may be able to perform such functions as to reconfigure alarm thresholds, reset the system, or otherwise disrupt operation of the fuel tank. An attacker might be able to simulate false conditions that would shut down the fuel tank, making it unavailable for use. Rapid 7 does not believe this vulnerability is actively being exploited in the wild, but they caution that it would be difficult to tell the difference between an attack and a system failure. They recommend companies hide their systems behind a VPN for an additional layer of security.

[Thanks Ellery]

DIY USB Stereo Headphone Amplifier

The biggest and best audiophile projects are usually huge tube amps, monstrous speaker cab builds, or something else equally impressive. It doesn’t always have to be that way, though, as [lowderd] demonstrates with a tiny DIY USB DAC build that turns a USB port into a headphone output.

In the Bad Old Days™ putting a DAC on a USB bus would require some rather fancy hardware and a good amount of skill. These days, you can just buy a single chip USB stereo DAC that still has very good specs. [lowderd] used the TI PCM2707 USB DAC, a chip that identifies as a USB Audio Class 1.0 device, so no drivers are needed for it to work in either Windows or OS X.

The circuit fits on a tiny PCB with a USB port on one side, a headphone jack on the other, and the chip and all related components in between. There are some pins on the chip that allow for volume, play/pause. and skip, but these pins were left unconnected for sake of simplicity.

The board was fabbed up at OSH Park, and the second revision of the case laser cut out of bamboo and acrylic by Ponoko. It’s a great looking little box, and something that fits right inside [lowderd]’s headphone case.

Reprogramming Super Mario World from Inside The Game

[SethBling] recently set a world record speed run of the classic Super Nintendo game Super Mario World on the original SNES hardware. He managed to beat the game in five minutes and 59.6 seconds. How is this possible? He actually reprogrammed the game by moving specific objects to very specific places and then executing a glitch. This method of beating the game was originally discovered by Twitch user [Jeffw356] but it was performed on an emulator. [SethBling] was able to prove that this “credits warp” glitch works on the original hardware.

If you watch the video below, you’ll see [SethBling] visit one of the first available levels in the game. He then proceeds to move certain objects in the game to very specific places. What he’s doing here is manipulating the game’s X coordinate table for the sprites. By moving objects to specific places, he’s manipulating a section of the game’s memory to hold specific values and a specific order. It’s a meticulous process that likely took a lot of practice to get right.

Once the table was setup properly, [SethBling] needed a way to get the SNES to execute the X table as CPU instructions. In Super Mario World, there are special items that Mario can obtain that act as a power up. For example, the mushroom will make him grow in size. Each sprite in the game has a flag to tell the SNES that the item is able to act as a power up. Mario can either collect the power up by himself, or he can use his friendly dinosaur Yoshi to eat the power up, which will also apply the item’s effects to Mario.

The next part of the speed run involves something called the item swap glitch. In the game, Mario can collect coins himself, or Yoshi can also collect them by eating them. A glitch exists where Yoshi can start eating a coin, but Mario jumps off of Yoshi and collects the coin himself simultaneously. The result is that the game knows there is something inside of Yoshi’s mouth but it doesn’t know what. So he ends up holding an empty sprite with no properties. The game just knows that it’s whatever sprite is in sprite slot X.

Now comes the actual item swap. There is an enemy in the game called Chargin’ Chuck. This sprite happens to have the flag set as though it’s a power up. Normally this doesn’t matter because it also has a set flag to tell the game that it cannot be eaten by Yoshi. Also, Chuck is an enemy so it actually hurts Mario rather than act as a power up. So under normal circumstances, this sprite will never actually act as a power up. The developers never programmed the game to properly handle this scenario, because it was supposed to be impossible.

If the coin glitch is performed in a specific location within the level, a Chargin’ Chuck will spawn just after the coin is collected. When the Chuck spawns, it will take that empty sprite slot and suddenly the game believes that Yoshi is holding the Chuck in his mouth. This triggers the power up condition, which as we already know was never programmed into the game. The code ends up jumping to an area of memory that doesn’t contain normal game instructions.

The result of all of this manipulation and glitching is that all of the values in the sprite X coordinate table are executed as CPU instructions. [SethBling] setup this table to hold values that tell the game to jump to the end credits. The console executes them and does as commanded, and the game is over just a few minutes after it began. The video below shows the speed run but doesn’t get too far into the technical details, but you can read more about it here.

This isn’t the first time we’ve seen this type of hack. Speed runs have been performed on Pokemon with very similar techniques. Another hacker managed to program and execute a version of single player pong all from within Pokemon Blue. We can’t wait to see what these game hackers come up with next. Continue reading “Reprogramming Super Mario World from Inside The Game”