Sunday, 4 September 2016

Music Player for the Ability-Impaired

Most of the hacks we come across here at Hackaday don’t require much more than being “cool” to get our attention. But, every so often we find something that goes a step beyond that and does something truly good for the world. This is one such project, and its goal couldn’t be anymore altruistic: to allow the elderly to enjoy music, even when their declining vision and motor skills make traditional devices difficult to use.

It’s hard to overstate how important music is to people; there are few forms of art more emotionally effective. So, it was a major loss when an elderly relative of [DusteD] was no longer able to operate their CD player. Luckily, [DusteD] was there with an ingenious solution that uses RFID cards to play music from an always-on Raspberry Pi.

The operation is as simple as it possibly could be: the user places the RFID card onto the Raspberry Pi’s enclosure, an RFID reader tells the Pi which song is being requested, and it’s played. That’s it — there are no other controls at all. The song simply plays until it’s over (or another card is used), and the volume is preset.

Now, obviously the music library will be limited by the number of cards made. But, they’re large and easy to read, and there is no reason why a card couldn’t be used to trigger an album or a pre-made playlist. Remember, the goal here is ease of use, not to replace an iPod. This isn’t the first music player we’ve seen with a unique control method, but it’s by far the simplest.

 


Filed under: musical hacks, Raspberry Pi

from raspberry pi – Hackaday http://ift.tt/2czZRTY
via Hack a Day

Raspberry Pi Chiptune Player Rocks a Sound Chip from the 80’s

Sometimes it’s worth doing something in an inefficient way. For example, it might be worth it in order to learn something new, or just to use a particular part. [Deater] did just that with the Raspberry Pi AY-3-8910 Chiptune Player (with LED visualizers!)

The venerable General Instrument AY-3-8910 series sound chips were common in older hardware like home computers and game consoles as well as sound cards for the Apple II family. They were capable of generating three channels of square waves with various effects. Developers eventually squeezed every little bit of performance out with clever hacks. The Raspberry Pi has more than enough power to do all this in software, but as [Deater] puts it, it’s far more interesting to use an actual AY-3-8910 from the 80’s. Some LED bar graphs and matrices round out the whole system.

All the code for the Raspberry Pi AY-3-8910 chiptune player can be found on [deater]’s github repository for the project. A video of the player banging out some sounds is embedded after the break.

[deater] got interested in a sound chip from the 80’s used in sound cards for the Apple II family because of the work done on making a port of Kerbal Space Program for the Apple II. The AY-3-8910 had some contemporary equivalents, one of which (the Yamaha YMZ294) was used in this curious “8-bit” Harmonica.


Filed under: musical hacks, Raspberry Pi

from raspberry pi – Hackaday http://ift.tt/2c3NSvp
via Hack a Day

Bathroom Status Reporting Hack Eliminates Lines, Frustration

In a lot of ways, portable toilets are superior to standard indoor-plumbing-style toilets. This is mostly due to the fact that they have a status indicator on the door. It’s a shame that no indoor bathrooms have figured this out yet, especially in office buildings where your awkward coworkers bang on every door rather than just check for feet in the huge gap that for some reason exists between the floor and the stall door. Anyway, [Chris] and [Daniel] came up with a solution for this issue, which also eliminates wait time for bathrooms in their office.

Their system is an automated bathroom status indicator that reports information about the bathroom’s use over WiFi. Since the bathrooms at their facility are spread out, it was helpful to be able to look up which bathroom would be free at any given moment. Several Raspberry Pis form the nerves of the project. Custom sensors were attached to a variety of different door locks to detect status. Each Pi reports back over WiFi. This accomplishes their goal of being subtle and simple. They also point out that they had to write very little code for this project since there are so many Unix and embedded hardware tools available to them. Checking the status of the bathroom can be as simple as running netcat.

If you’re looking to roll out your own bathroom status monitor solution, [Chris] and [Daniel] have made their code available on GitHub. There are a number of other ways to automate your bathroom, too, like switching the exhaust fan on when it gets too smelly or humid, or even creating a device that dispenses your toilet paper for you.

 


Filed under: Raspberry Pi

from raspberry pi – Hackaday http://ift.tt/2bP0KW0
via Hack a Day

Thursday, 1 September 2016

How to Use Docker to Cross Compile for Raspberry Pi (and More)

It used to be tedious to set up a cross compile environment. Sure you can compile on the Raspberry Pi itself, but sometimes you want to use your big computer — and you can use it when your Pi is not on hand like when on an airplane with a laptop. It can be tricky to set up a cross compiler for any build tools, but if you go through one simple step, it becomes super easy regardless of what your real computer looks like. That one step is to install Docker.

Docker is available for Linux, Windows, and Mac OS. It allows developers to build images that are essentially preconfigured Linux environments that run some service. Like a virtual machine, these images can run together without interfering with each other. Unlike a virtual machine, Docker containers (the running software) are lightweight because they share the same underlying kernel and hardware of the computer.

The reality is, setting up the Raspberry Pi build environment isn’t any easier. It is just that with Docker, someone else has already done the work for you and you can automatically grab their setup and keep it up to date. If you are already running Linux, your package manager probably makes the process pretty easy too (see [Rud Merriam’s] post on that process). However, the nice thing about the images is it is a complete isolated environment that can move from machine to machine and from platform to platform (the Windows and Mac platforms use a variety of techniques to run the Linux software, but it is done transparently).

Installing Docker

If you are not using Linux, you’ll need to figure out how to install Docker. There are several ways to do it under Windows (depending on what version of Windows you use) and I don’t use the Mac. However, on Linux, you should be able to install what you need via your package manager.

In Ubuntu and other similar distributions, you might expect to install the Docker package. Makes sense, but no. That package is a system tray icon manager. What you want is docker.io:

sudo apt-get install docker.io

You’ll see some suggested packages, and you can consider adding the –install-suggests option to apt-get if you want them.

Docker is in two parts: a daemon (a server that runs in the background) and a client named docker. There are a variety of GUI tools to manage Docker if you don’t like the command line. I do like it, so that’s all I know about that.

Cross Compile

Docker maintains a repository of images on their website called the Hub. By default, if you don’t have an image locally, the client will look there for it. In this particular case, the image you want is sdthirlwall/raspberry-pi-cross-compiler:legacy-trusty. That’s a mouthful, and the developer provides a nice script for calling it under normal circumstances. How do you get the script? You use Docker, of course.

By the way, by default, you need to run the Docker client as root, although you can also create a special group (although using sudo works just as well). Here’s the command to run to get the rpxc script:

sudo docker run sdthirlwall/raspberry-pi-cross-compiler:legacy-trusty >rpxc

Since you probably don’t have that image on your hard drive, it will take a while for the client to download it and complete the task. Next time won’t take so long because Docker will have a local copy.

You can set the rpxc command to execute with this command:

chmod +x rpxc

Then move it somewhere on your path (or refer to it by full path like ./rpxc or ~/Downloads/rpxc, if you prefer). Although you can download the whole image from the Hub, if you want to look at the files, contribute, or follow development, you should have a look at the GitHub repo for the project.

In Use

The rpxc script generally runs any command you like in the new environment. Since it runs Docker, you need to be root or in the Docker group, of course. All the usual build tools are prefixed with rpxc, so:

rpxc rpxc-gcc -o hello-world hello-world.c

Or, if you have a Makefile:

rpxc make

The current directory you are in when you run rpxc, becomes the /build directory in the new environment and is the default current working directory.

If you are lazy, you might prefer to just run:

rpxc bash

Then you can issue commands and do what you like. Do an ls on /usr/local/bin/rpxc* to see all the tools available. You can also use the rpxc script to update the image and itself. Use the update command to do both, or you can specify update-image or update-script.

Docking

There are other images you might find interesting. You have to get a free account on the Hub, and once you do, you might think there is a very small number of images. However, try doing a search for Raspberry, for example. Or Arduino, which shows a lot of preconfigured Arduino environments. You might enjoy searching for ESP8266, too. There’s even a Docker image for Eagle PCB layout software. Let us know your favorite profiles in the comments below.


Filed under: Raspberry Pi

from raspberry pi – Hackaday http://ift.tt/2bVNiQy
via Hack a Day

Internet Of Things Woodworking

Woodworking is the fine art of building jigs. Even though we have Internet-connected toasters, thermostats, cars, and coffee makers, the Internet of Things hasn’t really appeared in the woodshop quite yet. That’s changing, though, and [Ben Brandt]’s Internet of Things box joint jig shows off exactly what cheap computers with a connection to the Internet can do. He’s fully automated the process of making box joints, all with the help of a stepper motor and a Raspberry Pi.

[Ben]’s electronic box joint jig is heavily inspired by [Matthias Wandel]’s fantastic screw advance box joint jig. [Matthias]’ build, which has become one of the ‘must build’ jigs in the modern woodshop, uses wooden gears to advance the carriage and stock across the kerf of a saw blade. It works fantastically, but to use this manual version correctly, you need to do a bit of math before hand, and in the worst-case scenario, cut another gear on the bandsaw.

[Ben]’s electronic box joint jig doesn’t use gears to move a piece of stock along a threaded rod. Stepper motors are cheap, after all, and with a Raspberry Pi, a stepper motor driver, a couple of limit switches, and a few LEDs, [Ben] built an Internet-enabled box joint jig that’s able to create perfect joints.

The build uses a Raspberry Pi 3 and Windows IoT Core to serve up a web page where different box joint profiles are stored. By lining the workpiece up with the blade and pressing start, this electronic box joint jig automatically advances the carriage to the next required cut. All [Ben] needs to do is watch the red and green LEDs and push the sled back and forth.

You can check out [Ben]’s video below. Thanks [Michael] for the tip.


Filed under: Raspberry Pi, tool hacks

from raspberry pi – Hackaday http://ift.tt/2bSKPbk
via Hack a Day

Wednesday, 31 August 2016

Pan and Tilt with Dual Controllers

It wasn’t long ago that faced with a controller project, you might shop for something with just the right features and try to minimize the cost. These days, if you are just doing a one-off, it might be just as easy to throw commodity hardware at it. After all, a Raspberry Pi costs less than a nice meal and it is more powerful than a full PC would have been not long ago.

When [Joe Coburn] wanted to make a pan and tilt webcam he didn’t try to find a minimal configuration. He just threw a Raspberry Pi in for interfacing to the Internet and an Arduino in to control two RC servo motors. A zip tie holds the servos together and potentially the web cam, too.

You can see the result in the video below. It is a simple matter to set up the camera with the Pi, send some commands to the Arduino and hook up to the Internet.

The serial protocol for the Arduino is simple: The Pi sends a numeric position followed by a P (for pan) or T (for tilt) at 9600 baud. A web server and some Python handle the interface to the Internet and the human.

We’ve certainly seen our share of similar projects. Some of them have been a bit larger.


Filed under: Arduino Hacks, Raspberry Pi

from raspberry pi – Hackaday http://ift.tt/2bEBXkD
via Hack a Day

Monday, 29 August 2016

Raspberry Pi Hive Mind

Setting up a cluster of computers used to be a high-end trick used in big data centers and labs. After all, buying a bunch of, say, VAX computers runs into money pretty quickly (not even counting the operating expense). Today, though, most of us have a slew of Raspberry Pi computers.

Because the Pi runs Linux (or, at least, can run Linux), there are a wealth of tools out there for doing just about anything. The trick is figuring out how to install it. Clustering several Linux boxes isn’t necessarily difficult, but it does take a lot of work unless you use a special tool. One of those tools is Docker, particularly Docker Swarm Mode. [Alex Ellis] has a good video (see below) showing the details of a 28 CPU cluster.

It is easy to set up a swarm using the instructions on the Docker website. If you aren’t familiar with Docker, it is almost (but not quite) a light-weight virtual machine manager. A true virtual machine manager pretends to be a piece of hardware so that Linux (or another operating system) can boot on it and run applications. Docker is a container manager, which means it doesn’t pretend to be a piece of hardware, it pretends to be a running operating system. Programs see their own file system and other resources, but in reality, there is only one kernel running on the host hardware.

The idea is similar to running something in a chroot jail. The program can make changes to its file system without upsetting the rest of the system. Docker also provides other kinds of isolation. The real draw, though, is that it can automatically load images of predefined environments. This allows developers to provide packages that are essentially preinstalled in their own private operating system.

That’s important because it means that a service can run on any node in a cluster. That lets you do tricks like balancing load across multiple nodes. You can also do rolling updates and dynamically add or remove computers from the cluster.

We’ve seen clusters before, of course. Even the little Pi Zero can get in on the act. If you want to understand more about Docker, you can always read the official documentation. Given the prevalence of Linux in embedded systems, it might be an interesting way to deploy preconfigured applications.


Filed under: linux hacks, Raspberry Pi

from raspberry pi – Hackaday http://ift.tt/2bZndyN
via Hack a Day

Amazon

Donate

Donate Towards More Raspberry PI's for Projects