Run a Linux Terminal on Cheap E-Ink Displays

If you haven’t kept up with the world of e-ink displays, here’s some good news: they are pretty cheap now. For as little as $15 you can get a small e-ink display that has good enough performance and contrast to actually do something useful. There’s only one problem: figuring out how to drive them in your project.

Tired of seeing nothing but wiring diagrams and sample code when it came to actually putting these e-ink modules to use, [Jouko Strömmer] decided to try his hand at creating a turn-key application for these gorgeous little displays. The result is PaperTTY, a Python program that allows the user to open up a fully functional Linux virtual terminal on an e-ink display.

Of course, there are some caveats. For one, this all assumes you’re using a Waveshare display (specifically their 2.13 inch HAT) connected to a Raspberry Pi over SPI. Not to say that’s the only hardware combination that will work, but it’s the only one that [Jouko] has done any testing on at this point. If you want to try to shake things up in terms of hardware, you might need to get your hands dirty.

The advantage of being able to open a Linux VT on one of these e-ink displays is pretty simple: you can run basically any piece of software you want on it. Rather than having to come up with software that specifically features support for the display, you can just use (or write) standard Linux console programs. [Jouko] mentions a number of popular programs such as vim and irssi, but you could just as easily write a Bash script to dump whatever data you like to the screen.

In the video after the break [Jouko] shows PaperTTY in action for the doubters who think these sorts of displays are no good for interactive use. The display is very crisp and readable, with no signs of flickering. Overall he says the experience is not unlike using a slow SSH connection. It might not be how we’d like to use a computer full time, but we can definitely see the potential.

With the recent progress with Kindle hacking, it seems that interest in e-ink is as high as ever. Despite what the haters might claim, it’s a useful niche tech that still holds plenty of promise.

Continue reading “Run a Linux Terminal on Cheap E-Ink Displays”

Python Resurrects Dot Matrix Printing

These days a printer — especially one at home — is likely to spray ink out of nozzles. It is getting harder to find home laser printers, and earlier printer technologies such as dot matrix are almost gone from people’s homes even if you’ll still see a few printing multipart forms in some offices.

[Thomas Winningham] bought an old Commodore dot matrix printer in a fast food parking lot for $20. How hard could it be to get it working? How hard, indeed. Check out the video below to see the whole adventure. The principle behind the printer is simple enough. The head has one or two rows of pins each controlled by a solenoid. The head moves across the paper and your job — should you decide to accept it — is to make the pins push out at the right spot. An ink ribbon like a typewriter uses — oh yeah, more vanishing tech — leaves ink on the paper where it gets punched by the pin.

Continue reading “Python Resurrects Dot Matrix Printing”

Linux Fu: Scripting for Binary Files

If you ever need to write a binary file from a traditional language like C, it isn’t all that hard to do. About the worst thing you might have to deal with is attempts to fake line endings across Windows and Linux, but there’s usually a way to turn that off if it is on by default. However, if you are using some type of scripting language, binary file support might be a bit more difficult. One answer is to use a tool like xxd or t2b (text-to-binary) to handle the details. You can find the code for t2b on GitHub including prebuilt binaries for many platforms. You should be able to install xxd from your system repository.

These tools take very different approaches. You might be familiar with tools like od or hexdump for producing readable representations of binary files. The xxd tool can actually do the same thing — although it is not as flexible. What xxd can even reverse itself so that it can rebuild a binary file from a hex dump it creates (something other tools can’t do). The t2b tool takes a much different approach. You issue commands to it that causes it to write an original hex file.

Both of these approaches have some merit. If you are editing a binary file in a scripting language, xxd makes perfect sense. You can convert the file to text, process it, and then roll it back to binary using one program. On the other hand, if you are creating a binary file from scratch, the t2b program has some advantages, too.

I decided to write a few test scripts using bash to show how it all works. These aren’t production scripts so they won’t be as hardened as they could be, but there is no reason they couldn’t be made as robust as you were willing to make them.

Continue reading “Linux Fu: Scripting for Binary Files”

E-Dermis: Feeling At Your (Prosthetic) Fingertips

When we lose a limb, the brain is really none the wiser. It continues to send signals out, but since they no longer have a destination, the person is stuck with one-way communication and a phantom-limb feeling. The fact that the brain carries on has always been promising as far as prostheses are concerned, because it means the electrical signals could potentially be used to control new limbs and digits the natural way.

A diagram of the e-dermis via Science Robotics.

It’s also good news for adding a sense of touch to upper-limb prostheses. Researchers at Johns Hopkins university have spent the last year testing out their concept of an e-dermis—a multi-layer approach to expanding the utility of artificial limbs that can detect the curvature and sharpness of objects.

Like real skin, the e-dermis has an outer, epidermal layer and an inner, dermal layer. Both layers use conductive and piezoresistive textiles to transmit information about tangible objects back to the peripheral nerves in the limb. E-dermis does this non-invasively through the skin using transcutaneous electrical nerve stimulation, better known as TENS. Here’s a link to the full article published in Science Robotics.

First, the researchers made a neuromorphic model of all the nerves and receptors that relay signals to the nervous system. To test the e-dermis, they used 3-D printed objects designed to be grasped between thumb and forefinger, and monitored the subject’s brain activity via EEG.

For now, the e-dermis is confined to the fingertips. Ideally, it would cover the entire prosthesis and be able to detect temperature as well as curvature. Stay tuned, because it’s next on their list.

Speaking of tunes, here’s a prosthetic arm that uses a neural network to achieve individual finger control and allows its owner to play the piano again.

Thanks for the tip, [Qes].

Linux Fu: The Great Power of Make

Over the years, Linux (well, the operating system that is commonly known as Linux which is the Linux kernel and the GNU tools) has become much more complicated than its Unix roots. That’s inevitable, of course. However, it means old-timers get to slowly grow into new features while new people have to learn all in one gulp. A good example of this is how software is typically built on a Linux system. Fundamentally, most projects use make — a program that tries to be smart about running compiles. This was especially important when your 100 MHz CPU connected to a very slow disk drive would take a day to build a significant piece of software. On the face of it, make is pretty simple. But today, looking at a typical makefile will give you a headache, and many projects use an abstraction over make that further obscures things.

In this article, I want to show you how simple a makefile can be. If you can build a simple makefile, you’ll find they have more uses than you might think. I’m going to focus on C, but only because that’s sort of the least common denominator. A make file can build just about anything from a shell prompt.

Continue reading “Linux Fu: The Great Power of Make”

Linux Fu: Watch That Filesystem

The UNIX Way™ is to cobble together different, single-purpose programs to get the effect you want, for instance in a Bash script that you run by typing its name into the command line. But sometimes you want the system to react to changes in the system without your intervention. For example, you might like to watch a directory and kick off some program automatically when a file appears from a completed FTP transaction, without having to sit there and refresh the directory yourself.

The simple but ugly way to do this just scans the directory periodically. Here’s a really dumb shell script:

while true
   for I in `ls`
    do cat $I; rm $I
 sleep 10

Just for an example, I dump the file to the console and remove it, but in real life, you’d do something more interesting. This is really not a good script because it executes all the time and it just isn’t a very elegant solution. (If you think I should use for I in *, try doing that in an empty directory and you’ll see why I use the ls command instead.)

Continue reading “Linux Fu: Watch That Filesystem”

Linux Fu: Counter Rotate Keys!

If you’ve done anything with a modern Linux system — including most variants for the Raspberry Pi — you probably know about sudo. This typically allows an authorized user to elevate themselves to superuser status to do things.

However, there is a problem. If you have sudo access, you can do anything — at least, anything the sudoers file allows you to do. But what about extremely critical operations? We’ve all seen the movies where launching the nuclear missile requires two keys counter-rotated at the same time and third firing key. Is there an equivalent for Linux systems?

It isn’t exactly a counter-rotating key, but the sudo_pair project — a prelease open-source project from Square — gives you something similar. The project is a plugin for sudo that allows you to have another user authorize a sudo request. Not only do they authorize it, but they get to see what is happening, and even abort it if something bad is happening.

Continue reading “Linux Fu: Counter Rotate Keys!”