Wednesday 30 March 2016

Bare Metal Media Centre

Sometimes, along comes a build that is simple and bare, and yet exemplifies “hacking” – an art form that uses something in a way in which it was not originally intended. We’ve featured a few Raspberry Pi builds, but this one is less about the Pi and more about putting the rest of the hardware nicely together. [Garage Tech] built this Raspberry-Pi Stand and the end result is brilliant.

MediaPlayerSide-6-5-4It is nothing more than a metal book holder – the kind you are likely to pick up a pair for a few bucks at a charity shop or flea market. He was lucky to also snag a JBL On Stage IIIP Speaker Dock for cheap. Quickly spotting an opportunity, he decided to put together an OpenELEC based media centre using his bounty. Having made up his mind, he needed a couple of other parts to make sure this build looked, and sounded, good. An iQuadio Pi DAC+ , the Pi-DAC+ case from ModMyPi which comes with all the necessary hardware, and the official DSI touch screen.

With all of the stuff on hand, the rest of the build involved a short time at the workbench drilling some holes and slots in the aluminium book holder plate to mount the Pi-DAC case and the display. He drilled the holes and slots such that he can fix the display on either side. Along the way, he discovered an interesting issue regarding the display orientation – check it out. The final result is a nice looking media centre that sits proudly on top of his audio rig.


Filed under: Raspberry Pi

from raspberry pi – Hackaday http://ift.tt/1PEweqH
via Hack a Day

Monday 28 March 2016

Raspberry Pi Art Frame using OpenFrame

Digital picture frames were a fad awhile back, and you can still pick them up at the local big box store. [Ishac Bertran] and [Jonathan Wohl] decided to go open source with digital frames and create the openframe project. The open-source project uses a Raspberry Pi with WiFi and either an HDMI monitor or a monitor that the Pi can drive (e.g., a VGA with an HDMI adapter).

You are probably thinking: Why not just let the Pi display images? The benefit of openframe is you can remotely manage your frames at the openframe.io site. You can push images, websites (like Hackaday.com) or shaders out to any of your frames. You can also draw on public streams of artwork posted by other users.

Openframe doesn’t store any of your artwork. It simply retrieves it from a given URL on demand. [Ishac] shows how to convert an old monitor into something that looks like a high-end frame and it is easy to think of uses for this: schools, offices, or sending Mom pictures of the grandkids remotely. You can watch his video, below.

Repurposed monitors are nothing new. However openframe is an extensible open source project, and we are curious to see where it goes over time.


Filed under: Raspberry Pi

from raspberry pi – Hackaday http://ift.tt/1TdHoJQ
via Hack a Day

Friday 25 March 2016

The Pi Zero Mass Storage Picture Frame

The Raspberry Pi Zero – and the not perpetually out of stock Raspberry Pi A+ – only have one USB port, but behind that port is a lot of functionality. This is an OTG USB port, and just like the USB port on your smartphone, this little plug can become any kind of USB device. Transforming the Pi into a USB gadget allows it to be a serial connection, MIDI device, audio source or sink, or a USB mass storage device.

[Francesco] was especially interested in the USB mass storage capability of the Raspberry Pi Zero and built a small project to show off its capabilities. He turned a Pi Zero into the controller for a digital picture frame, constantly displaying all the image files on a small screen.

The build started with [Andrew Mulholland]’s guide for Pi Zero OTG modes, with just a few modifications. When the Pi is plugged into a PC, it automatically becomes a 100 Megabyte USB storage device. You don’t need that much space on a digital picture frame, anyway.

While setting up a digital picture frame is easy enough, there’s still a tremendous amount of untapped potential in using the Pi Zero as a USB gadget. With enough buttons, switches, and sensors, the Pi can become a wearable MIDI device, or with the Pi camera module, an IP webcam. Neat stuff, and we can’t wait to see what the community comes up with next.


Filed under: Raspberry Pi

from raspberry pi – Hackaday http://ift.tt/1RCMAHO
via Hack a Day

Thursday 24 March 2016

Building A Better Game Boy With A Pi

The most collectible Game Boy, by far, would be the Game Boy Micro. This tiny Game Boy is small enough to lose in your pocket. It can only play Game Boy Advance games, the screen is tiny, but just look at the prices on eBay: it’s one of the few bits of consumer electronics that could be seen as an investment in retrospect.

The popularity of the Game Boy Micro, the ability for the Raspberry Pi to emulate old game consoles, and the introduction of the Raspberry Pi Zero could only mean one thing. It’s the PiGrrl Zero, a modern handheld to play all your retro games.

The design goals for the PiGRRL Zero were simple enough: a 2.2 inch 320×240 display, a d-pad, four buttons on the face and two shoulder buttons. There’s a big battery, audio output, and a 3D printed case. This would be somewhat unremarkable if it weren’t for the PCB designed for PiGRRL Zero. It’s designed to be soldered directly onto the Raspberry Pi Zero, taking advantage of the mostly component-free back side of this tiny single board computer.

With this PCB, the Pi Zero is turned into a tiny battery-powered computer running emulations of all the classics. NES, SNES, Sega, and of course Game Boy Advance games are readily playable on this devices, and for a price that’s a fair bit lower than what a mint condition Game Boy Micro goes for. Our judges thought it was cool enough to be one of the winners of the Pi Zero Contest. Check it out!


Raspberry_Pi_LogoSmall

The Raspberry Pi Zero contest is presented by Hackaday and Adafruit. Prizes include Raspberry Pi Zeros from Adafruit and gift cards to The Hackaday Store!
See All the Entries


Filed under: nintendo gameboy hacks, Raspberry Pi, security hacks

from raspberry pi – Hackaday http://ift.tt/25nTq80
via Hack a Day

BlinkenBone Meets The PiDP8

Years ago when the old mainframes made their way out of labs and into the waiting arms of storage closets and surplus stores, a lot got lost. The interesting bits – core memory boards and the like – were cool enough to be saved. Some iconic parts – blinkenlight panels – were stashed away by techs with a respect for our computing history.

For the last few years, [Jörg] has been making these blinkenlight panels work again with his BlinkenBone project. His work turns a BeagleBone into a control box for old console computers, simulating the old CPUs and circuits, allowing them to work like they did thirty years ago, just without the hundreds of pounds of steel and kilowatts of power. Now, [Jörg] has turned to a much smaller and newer blinkenlight panel, the PiDP-8.

The PiDP-8 is a modern, miniaturized reproduction of the classic PDP 8/I, crafted by [Oscar Vermeulen]. We’ve seen [Oscar]’s PiDP a few times over the last year, including a talk [Oscar] gave at last year’s Hackaday Supercon. Having a simulated interface to a replica computer may seem ridiculous, but it’s a great test case for the interface should any older and rarer blnkenlight panels come out of the woodwork.


Filed under: classic hacks

from raspberry pi – Hackaday http://ift.tt/1WK1TN0
via Hack a Day

Tuesday 22 March 2016

Turn your Raspberry Pi 3 into a PHP 7 powered web server

In this tutorial I’m going to go through the steps to install Apache2 and PHP 7.0 on your Raspberry Pi 3, to create the ultimate low-powered, super quick web server.

Prerequisites

I’m going to assume that you have Raspbian installed on your Raspberry Pi 3. For the best results, I recommend running Raspbian from a USB Flash drive rather than a MicroSD card. See my tutorial on how to do this.

Update

These instructions should work fine on the Raspberry Pi 2 as well. Let me know if anyone tries this.

Step 1 – Add new repository sources

At the time of writing, PHP 7.0 hasn’t yet made the official repository sources, so we need to add one which provides us with the PHP 7.0 packages. Edit your sources file with this command:

sudo nano /etc/apt/sources.list

Below the existing entries in the file on a blank line, add the following two lines:

deb http://ift.tt/1o5dLx6 jessie-backports main contrib non-free
#deb-src http://ift.tt/1o5dLx6 jessie-backports main contrib non-free

Your file should look a little like this:

Install Apache 2 and PHP 7 on Raspberry Pi 3

Next we need to add a couple of certificates in order to allow us to use the sources with apt-get. Run the following two commands:

sudo gpg --keyserver pgpkeys.mit.edu --recv-key CCD91D6111A06851
sudo gpg --armor --export CCD91D6111A06851 | apt-key add -

And finally we need to update the package list by running:

sudo apt-get update

Step 2 – Install the core Apache2 and PHP 7 packages

We’re ready to install Apache2 and PHP7, along with some common packages that we may need for most web applications such as Symfony2, WordPress, Drupal etc. Run the following command to install these packages:

apt-get install apache2 php7.0 php7.0-curl php7.0-gd php7.0-imap php7.0-json php7.0-mcrypt php7.0-mysql php7.0-opcache php7.0-xmlrpc libapache2-mod-php7.0

This may take a little time, but as soon as we’re done, we are essentially finished.

Step 3 – Test Apache2 and PHP 7

Assuming all went well, we’re ready to test to see if everything went OK with the installation. First we’ll test the version of PHP that CLI is using:

php -v

You should see something like this:

Install PHP 7 on Raspbian

Next we’ll test two things; Apache2 and PHP 7. In your web browser, visit the IP address of your Raspberry Pi. If you haven’t used ssh and have followed these steps on your Raspberry Pi 3 itself, just visit http://127.0.0.1, otherwise change 127.0.0.1 for the IP address of your Raspberry Pi.

You should see the default Debian holding page:

Turn Raspberry Pi into a web server

Next we’ll test PHP. Run the following command to create a test file:

echo "<?php phpinfo();" >> /var/www/html/phpinfo.php

Yet again, visit the IP address of your Raspberry Pi, this time adding /phpinfo.php to the URL. You should see the PHP Information as shown below:

Install PHP 7 on Raspberry Pi

Conclusion

The Raspberry Pi 3 is a very capable, low power consuming little piece of kit. Combine that with the awesome power and speed of PHP 7.0 and you have a low energy web server that’s lightning quick and ideal for blogging from. As mentioned in the prerequisites, I do recommend using a decent USB Flash drive instead of an MicroSD card to run the operating system.

My first experiments with WordPress on PHP 7 on a Raspberry Pi 3 were very promising. I’m probably going to switch back to hosting this site from one again, now that the equipment and software can keep up with the traffic to the site.

Any questions or feedback, feel free to add below. Let me know about your own projects too and I’ll share them.

The post Turn your Raspberry Pi 3 into a PHP 7 powered web server appeared first on Ste Wright the Web Developer.



from Tutorials – Ste Wright the Web Developer http://ift.tt/1Pq9CKf
via http://ift.tt/1Pq9CKf

Monday 21 March 2016

Mobile Text Reader With OCR and Text To Speech

There are devices out there that will magnify text using fancy cameras and displays, devices that will convert these to Braille, and text-to-speech software has been around for thirty years. For his entry into our Raspberry Pi Zero contest, [Markus] decided to combine all these ideas into a simple device that will turn the printed word into speech.

The impetus for [Markus]’ project came to him in the form of a group of blind computer science  students. These students used a specialized program that used specialized hardware and software such as mobile Braille terminals, OCR, and oral exams that allowed these students to study the same thing as everyone else. [Markus] wanted to produce something similar, using simple text-to-speech software instead of a complicated Braille display.

The physical design of [Markus]’ project is uniquely functional – a hand-held device with a camera up front, a Pi in the middle, and a speaker and headphone jack on the back. The hand grip includes a large battery and a trigger for telling the Pi to read a few words aloud.

The software is built around the SnapPicam and includes a lot of the functionality already needed. OCR is largely a solved problem with Tesseract, and text-to-speech is easy with Festival.

Although [Markus] is just plugging a few existing software modules together, he’s come up with a device that is certainly unique and could be exceptionally useful to anyone with a vision impairment.


Raspberry_Pi_LogoSmall

The Raspberry Pi Zero contest is presented by Hackaday and Adafruit. Prizes include Raspberry Pi Zeros from Adafruit and gift cards to The Hackaday Store!
See All the Entries


Filed under: Raspberry Pi

from raspberry pi – Hackaday http://ift.tt/1S1KLyl
via Hack a Day

Raspberry Pi Zero Contest Grand Prize Winners!

The Raspberry Pi Zero Contest presented by Adafruit and Hackaday came to a close last week, as the clock struck 11:59 am on Sunday, March 13, 2016. Since then our team of judges has been working to pick the top three entries. It was a hard job sorting through nearly 150 amazing creations.  In the end though, the judges were able to pick three grand prize winners. Each winner will receive a $100 gift card to The Hackaday Store.  So let’s get to the winners!

[JohSchneider] and [Markus Dieterle] both won Pi Zero boards and went on to win $100 gift certificates. [shlonkin] didn’t win a Pi Zero, but persevered and continued working on the classroom music teaching aid even without a Zero board. The top winners aren’t the only ones who are doing well. Everyone who entered has a head start on a great project for The 2016 Hackaday Prize.

I’d like to thank Hackaday’s own [Dan Maloney], [Kristina Panos], [Sophi Kravitz] and [Brian Benchoff] who joined me to judge the contest. The entire Hackaday staff is indebted to [Limor Fried] and [Phil Torrone] over at  Adafruit for coming up with 10 live videos, and providing 10 hard to find Pi Zero boards for our winners. The biggest thanks go to the entrants. If I could send a prize out to each and every one of you, I would!


Filed under: contests, Raspberry Pi

from raspberry pi – Hackaday http://ift.tt/21DPFa6
via Hack a Day

Sunday 20 March 2016

Upgrade to PHP 7.0 on Ubuntu

I took the plunge and upgraded to PHP 7.0 on Ubuntu 14.04 and so far so good, everything’s lightning fast, and touch wood, nothing seems to be broken. Here’s the steps I took to upgrade.

Prerequisites and disclaimer

My server is a Ubuntu 14.04 box that uses Apache 2.4 and PHP 5.5.9 prior to upgrade. These instructions are for Apache 2.4 users with a similar configuration, and I recommend you test in isolation before using in a production environment. Proceed at your own risk.

Step 1 – Add a new Apt source

At the time of writing, I’m using the packages maintained by a guy called Ondřej Surý (he’s worth a follow on Twitter) until there’s a Debian package for PHP 7 in the official release channels.

To do this, enter the following command into the box you’re upgrading:

sudo add-apt-repository ppa:ondrej/php

You’ll probably be prompted to enter your password at this point. Go ahead and enter it.

Step 2 – Install updates and the PHP 7.0 package

Next we’re going to update and upgrade packages on our system to ensure everything goes smoothly. You can do this in a single command with:

sudo apt-get update && sudo apt-get upgrade

Once this has finished, we’re ready to install PHP 7.0. Enter the following command into your terminal:

sudo apt-get install php7.0 php7.0-mysql libapache2-mod-php7.0

This will install PHP 7.0, the MySQL DB package for PHP 7.0 and the Apache PHP7 module. I found that everything else pretty much worked without being installed separately. That’s it pretty much. You shouldn’t need to make any configuration changes and everything should just work.

Step 3 – Test to ensure your server is using PHP 7.0

From the command line, type the following command:

php -v

You should see something line this:

Upgrade to PHP 7.0 on Ubuntu

Congratulations, your command line at least is using PHP 7.0.

Now we need to ensure Apache is using the right version of PHP. Change directory to any of your sites (or if you have just one on your server, this will probably be /var/www/):

cd /var/www/

Amend the path to suit. Now we’re going to create a test file to see the information about our PHP environment. Type this command to create the file:

echo "<?php phpinfo();" >> phpinfo.php

Visit the page from your browser, hopefully you’ll see something like this:

Install PHP 7 on Ubuntu

Conclusion

PHP 7 is a complete overhaul and from my own experience, it’s rock solid and incredibly quick. It will speed up your applications and serve data to your web servers quicker than ever, whether it be Nginx or Apache. It’s bundled in the next LTS of Ubuntu which is due anytime now, I can see PHP 7 being huge.

Any feedback, comments or questions, feel free to comment away.

The post Upgrade to PHP 7.0 on Ubuntu appeared first on Ste Wright the Web Developer.



from Tutorials – Ste Wright the Web Developer http://ift.tt/25cXk3u
via http://ift.tt/25cXk3u

Saturday 19 March 2016

Bartop Arcade RetroPie Powered Laser Cut

[hhtat] wanted to build an arcade cabinet since his days in high-school. Only recently have the tech planets aligned. Looking into the night sky he saw a laser cutter, the Raspberry Pi, and lowering prices on key components and thought, “this is the year.”

Much like an arcade cabinet we posted earlier, this one sits on a counter top. With full controls and a nice screen, it provides a lot of the experience without the additional explaining to the SO why the living space should house a giant decaled MDF box.

The frame was designed in SketchUp and vectors were made in Inkscape. The frame was lasercut out of MDF and Acrylic. Decals were printed and applied. The resulting case, build from tab and slot construction, is attractive.

The internals are simple. A Raspberry Pi with a fast SD card acts as the brain. Rather than make it difficult on himself, [hhat] bought a pre-made controls kit from eBay. Apparently there is a small market for this stuff. He also purchased an IPS screen with built in controller. The IPS panel gives the arcade cabinet a desireable wide viewing angle.

The final product looks like a lot of fun and we can see it turning at least one person into an unintentional loner at any house party.


Filed under: Raspberry Pi

from raspberry pi – Hackaday http://ift.tt/1VlAhiM
via Hack a Day

Thursday 17 March 2016

Steam-Powered Raspberry Pi Zero Doesn’t Get Any More Steampunk

Steampunk usually involves sticking a few old valves on your laptop and riding a penny farthing, but [Alexzpro] understands the real thing: he just created a steam powered Raspberry Pi Zero (translated).

His setup is a little lashed together, but works it’s a throwback to electricity generation of old and deserves the steampunk moniker. A steam boiler drives a steam turbine, which turns a motor, generating electrical power. This feeds into a regulator and a bank of capacitors that smooths the voltage out to a nice even 5 Volts, which powers the Pi.

It’s not exactly efficient, but running the steam boiler using two propane blowtorches sure makes us grin. Usually we see people trying to go the opposite direction and power their projects with renewables. We can appreciate this for what it is too, and it’s certainly not the first time we’ve see a Raspberry Pi burning through electricity for little apparent gain.


Filed under: Raspberry Pi

from raspberry pi – Hackaday http://ift.tt/1pOGpUO
via Hack a Day

Vintage 8mm Camera Now Powered By Raspberry Pi

If you are a lover of the aesthetic of vintage photography and Instagram’s filters don’t quite cut it for you, then there are plenty of opportunities even in this post-film age to sample the real thing. Plastic lens cameras from the former Soviet Bloc countries or the Pacific rim are still in production, and you can still buy 35mm and 120 roll film to put in them.

You can even still buy 8mm film for your vintage movie camera, but it’s rather pricey. [Claire Wright] is a young film maker who had an old 8mm camera and really wanted that analog film feel to her work, and she and her father solved this problem by using the 8mm camera’s lens in front of a Raspberry Pi camera sensor. Since an 8mm film frame is 4.5mm x 3.3mm and the Pi camera sensor size is 3.76mm x 2.74mm, it’s quite a good fit.

Their first prototype had a custom case which concealed the Pi camera behind the lens on rails taken from an old CD-ROM drive, and had an HDMI screen on top and a pistol grip to make it portable. An external thumb screw allowed the camera to be positioned in the focal plane.

A further refinement has stepper motor driven focus driven from an Adafruit motor drive HAT. The software is simply the standard Pi camera utilities. To demonstrate the system, she made a short video about how it came to be, and took the camera on a road trip to Austin, Texas. She tells us a local 3D print shop is working on a 3D model to replicate the camera, but sadly as yet there are no resources for the Hackaday crowd to examine.

Her video is below. She has certainly captured the feel of an 8mm film very well. If the SUVs were replaced by cars with more chrome in her Mainstreet America, you might almost be there in the 1950s.

This appears to be the first 8mm camera we’ve featured here on Hackaday. We have however covered one or two vintage camera inspired projects, such as this Holga lens for a Canon digital camera, this completely open source camera, and this Arduino-driven single-leaf shutter.


Filed under: digital cameras hacks, Raspberry Pi

from raspberry pi – Hackaday http://ift.tt/1R4LBur
via Hack a Day

Wednesday 16 March 2016

Tiny Raspberry Pi Shield for High-Quality RF Signals

Among its many tricks, the Raspberry Pi is capable of putting clock signals signal out on its GPIO pins, and that turns out to be just the thing for synthesizing RF signals in the amateur radio bands. What [Zoltan] realized, though, is that the resulting signals are pretty dirty, so he came up with a clever Pi shield for RF signal conditioning that turns a Pi into a quality low-power transmitter.

[Zoltan] stuffed a bandpass filter for broadband noise, a low-pass filter for harmonics, and a power amplifier to beef up the signal a bit into a tiny shield that is cleverly engineered to fit any version of the Pi. Even with the power amplifier, the resulting transmitter is still squarely in the realm of QRP, and the shield is optimized for use as a WSPR beacon on the 20-meter band. But there’s plenty of Pi software available to let hams try other modes, including CW, FM, SSB, and even SSTV, and other signal conditioning hardware for different bands.

Yes, these are commercially available products, but even if you’re not in the market for a shield like this, or if you want to roll your own, there’s a lot to learn from [Zoltan]’s presentation at the 2015 TAPR Digital Communications Conference (long video below). He discusses the difficulties encountered getting a low-profile shield to be compatible with every version of the Pi, and the design constraints that led to the decision to use SMT components.


Filed under: radio hacks, Raspberry Pi

from raspberry pi – Hackaday http://ift.tt/1M90dMn
via Hack a Day

ElasticHosts launches Linux-friendly cloud storage

ElasticHosts launches Linux-friendly cloud storage

Cloud provider ElasticHosts has launched a new cloud storage solution specifically designed for Linux users. ElasticHosts Cloud Storage is specifically built for the needs of Linux system administrators, and works out of the box with common Linux tools such as Rsync backup and SSHFS remote file servers. The new service is immediately available from ElasticHosts datacentres worldwide and can be used as a standalone service or alongside the company’s Cloud Servers, both VMs and auto-scaling Linux Containers.

ElasticHosts Cloud Storage provides unlimited file storage on-demand. It dynamically scales as required and is billed only by consumption. Customers can choose from ElasticHosts’ worldwide data centres to get fast local access in an appropriate data jurisdiction, and benefit from 24/7 support.

Key use cases include:

  • Offsite backups: Full Rsync integration allows system administrators to import files and maintain incremental backups using standard Linux tools
  • Shared network drives: Share files, connecting securely from multiple locations over SSHFS or WebDAV
  • Hosting static web pages and downloads: Serve simple pages or large downloads without a webserver, or offload these from your webserver
  • Integration with ElasticHosts cloud servers: Run auto-scaling Linux Containers directly from SSD storage, and mount your storage on VMs, enabling tight integration with your software and direct remote access into the filesystem of your running server

Richard Davies, CEO for ElasticHosts, comments: “Most cloud storage products, such as Dropbox, are built for consumers on desktop computers, or have complicated APIs, like Amazon S3. This makes them cumbersome for Linux system administrators to use. We are heavily involved in the Linux community and were keen to create a solution that meets their specific needs and works with their existing tools; it is actually something we use internally. For example, Rsync is a fantastic tool for incremental backups that is widely used, so when we were designing the storage we knew it needed to integrate with it. Similarly SSHFS remote file servers are very popular.

ElasticHosts Cloud Storage can be purchased directly from ElasticHosts’ website: www.elastichosts.com.



from Linux User & Developer – the Linux and FOSS mag for a GNU generation http://ift.tt/1ptmB9r
via IFTTT

Tuesday 15 March 2016

Making Dumb Robots Evolve

Evolution is a fact of life, except in Kansas. It is the defining characteristic of life itself, but that doesn’t mean a stupid robot can’t evolve. For his entry into the Hackaday Pi Zero contest, [diemastermonkey] is doing just that: evolution for robots built around microcontrollers and a Raspberry Pi.

[diemastermonkey]’s project is a physical extension to genetic algorithms. Just like DNA and proteins have no idea what they’re actually doing, microcontrollers don’t either. Instead of randomly switching up base pairs and amino acids, [diemastermonkey]’s project makes random connections pins depending on the values of those pins.

The potential of these crappy, randomly programmed robots is only as good as the fitness function, and so far [diemastermonkey] has seen some surprising success. When putting these algorithms into a microcontroller connected to a tilting table mechanism and a PIR sensor, the robot eventually settled on a bit of code that would keep a ball in motion. You can check out the video of that below.


Raspberry_Pi_LogoSmall

The Raspberry Pi Zero contest is presented by Hackaday and Adafruit. Prizes include Raspberry Pi Zeros from Adafruit and gift cards to The Hackaday Store!
See All the Entries


Filed under: robots hacks

from raspberry pi – Hackaday http://ift.tt/1LntmmY
via Hack a Day

Monday 14 March 2016

A $5 Graphics Card For Homebrew Computers

While not very popular, building a homebrew computer can be a fun and rewarding process. Most of the time, though, the video capabilities of these computers is as bare bones as it can get – running headless, connected to a terminal. While this is an accurate reproduction of the homebrew computers of the 1970s and 80s, there’s a lot to be said about a DIY computer with an HDMI-out port.

[spencer] built a Z-80-based homebrew computer a few years ago, and while connecting it to a terminal was sufficient, it was a build that could use a little more pizzazz. How did he manage to stuff a terminal in a tiny project box? With everyone’s favorite five dollar computer, the Raspberry Pi Zero.

The computer [spencer] built already had serial inputs, outputs, power, and ground rails – basically, a serial port. The Raspberry Pi also has TX and RX pins available on the 40-pin header, and with a stupidly simple board that [spencer] whipped up in KiCad, he could plug a Pi into the backplane of his homebrew computer. A few setup scripts, and a few seconds after turning this computer on [spencer] could mash a keyboard and wail away on some old school BASIC.

This isn’t a use case that is the sole domain of the Pi Zero. A Parallax Propeller chip makes for a great video terminal with inputs for PS/2 keyboards and mice. A largish AVR, with the requisite NTSC video library, also makes for a great video interface for a homebrew computer. The Pi Zero is only five dollars, though.


Raspberry_Pi_LogoSmall

The Raspberry Pi Zero contest is presented by Hackaday and Adafruit. Prizes include Raspberry Pi Zeros from Adafruit and gift cards to The Hackaday Store!
See All the Entries


Filed under: contests, Raspberry Pi

from raspberry pi – Hackaday http://ift.tt/1S0D4ej
via Hack a Day

Sunday 13 March 2016

A Pi Powered Recording Studio

In the mid-90s, you recorded your band’s demo on a Tascam cassette tape deck. These surprisingly cheap four-track portable studios were just low tech enough to lend an air of authenticity to a band that calls itself, ‘something like Pearl Jam, but with a piano’. These tape decks disappeared a decade later, just like your dreams of being a rock star, replaced with portable digital recording studios.

The Raspberry Pi exists, the Linux audio stack is in much better shape than it was ten years ago, and now it’s possible to build your own standalone recording studio. That’s exactly what [Daniel] is doing for our Raspberry Pi Zero contest, and somewhat predictably he’s calling it the piStudio.

Although the technology has moved from cassette tapes to CompactFlash cards to hard drives, the design of these four-track mini recording studios hasn’t really changed since their introduction in the 1980s. There are four channels, each with a fader, balance, EQ, and a line in and XLR jack. There are master controls, a few VU meters, and if the technology is digital, a pair of MIDI jacks. Since [Daniel] is using a Raspberry Pi for this project, he threw in an LCD for a great user interface.

As with all digital recorders, the money is in the analog to digital converters. [Daniel] is using a 24-bit, 216kHz, four-channel chip, Texas Instruments’ PCM4204. That’s more than enough to confuse the ears of an audiophile, although that much data will require a hard drive. Good thing there will be SATA.

Although you can buy an eight-channel solid state recorder for a few hundred dollars – and [Daniel] will assuredly put more than that into this project, it’s a great application of a ubiquitous Linux computer for a device that’s very, very useful.


Raspberry_Pi_LogoSmall

The Raspberry Pi Zero contest is presented by Hackaday and Adafruit. Prizes include Raspberry Pi Zeros from Adafruit and gift cards to The Hackaday Store!
See All the Entries || Enter Your Project Now!


Filed under: digital audio hacks, Raspberry Pi

from raspberry pi – Hackaday http://ift.tt/1V4t4Ue
via Hack a Day

Birthday Celebrations The Pi Way

Home automation with your Pi – Part 2

Control your automated system

We are going to use heimcontrol.js as the control software for our automated system. This is a home automation web interface written in Node.js that runs on the Raspberry Pi, and sends low level serial commands to an Arduino connected via USB to control various hardware connected to it. Although some of the things the Arduino does can be done with the Raspberry Pi in theory, the Raspberry Pi does not have the ability to read analogue voltages, so temperature and light sensors would not be possible in this case. Also, the Raspberry Pi only has one hardware pulse width modulation output and three are needed for the LED strip.

Raspberry Pi prep

Use the latest Raspbian image as a starting point for this project. Log into the Pi using the default username of “pi” and default password “raspberry”. The first thing you’ll need to do is use sudo raspi-config to enable the camera and resize the root filesystem so the image uses all of the available space on the SD card. Once this is done, we can update our packages to the latest version and then install some extra packages that will be required later on:

sudo apt-get update

  sudo apt-get upgrade

  sudo apt-get install libboost-dev arduino streamer

Next, we need to download a precompiled Node.js package and a MongoDB package (both are required by heimcontrol.js. Packages can be found at http://ift.tt/1pgBuLC, in case they go missing.

  wget http://ift.tt/1UpNpTl

  sudo dpkg -i node_0.10.36_armhf.deb

Check it has installed correctly:

  pi@raspberrypi ~ $ node -v

  v0.10.36

Time to install MongoDB…

  wget http://ift.tt/1pgBxqL

releases/download/v2.1.1-1/mongodb_2.1.1_armhf.deb

  sudo dpkg -i mongodb_2.1.1_armhf.deb

  # Start service:

  sudo /etc/init.d/mongodb start

  # Automatically start service at system startup:

  sudo update-rc.d mongodb defaults

Now it’s time to install heimcontrol.js, which our expert had to fork on GitHub to fix a couple of issues.

  npm config set python python2.7

  git clone http://ift.tt/1c4zvf9

heimcontrol.js.git

  cd heimcontrol.js

  npm install

RaspberryPi&Speaker

The install process will take a while as there’s quite a lot of stuff to compile. Before you can access heimcontrol.js, you will need to know the IP address of your Raspberry Pi. You can find this out using the ip addr command. Our address was 172.17.173.41. Run heimcontrol.js by typing:

  node heimcontrol.js

Note that you have to be in the directory where you cloned the repository for this to work. This is probably /home/pi/heimcontrol.js. Heimcontrol runs on port 8080, so type the IP address of your Pi into your web browser followed by :8080 – in our case the correct URL was: http://ift.tt/1UpNpTp. We have applied a patch that disables authentication by default, because it gets annoying if you have to log in every time you want to use the web interface. You can re-enable authentication by editing config/development.js inside the heimcontrol.js directory.

Now that we know heimcontrol is working, Ctrl+C out of it because we have more work to do before we can start using it. We need to load the video for the Linux camera driver for the Raspberry Pi camera so that it can be used with the streamer software we installed earlier. To do this, you need to edit
/etc/modules using sudo and your favourite text editor (use nano if in doubt, so sudo nano /etc/modules). Add the line “bcm2835-v4l2” to the end of the file so the driver is loaded at boot. To load it instantly, run sudo modprobe bcm2835-v4l2.

Arduino prep and remote control scanning

We need to write some software to the Arduino called duino, which allows the ports to be controlled over serial from heimcontrol.js. This way of working is elegant because it allows more sensors to be added to the Arduino without any need to reprogram anything. We have already installed the Arduino software, so now we need to copy some libraries required by duino to the Arduino installation directory so that the software can be compiled:

  cd /usr/share/arduino/libraries

  sudo cp -r /home/pi/http://ift.tt/1pgBxqP

duino/src/libs/* .

  cd ~

Pi Comparison

Before we write the duino software to the Arduino, we want to use the Arduino to sniff the messages sent by the remote for the remote control sockets. To do this, connect the 433MHz receiver module (the wider module of the two modules with four pins instead of three – see diagram to left) to the Arduino. Connect the data pin (either of the middle pins) to pin 2 of the Arduino, VCC to 5V, and GND to GND. Download the receiver software using:

  wget http://ift.tt/1pgBuLO

rc-switch/master/examples/ReceiveDemo_Simple/

ReceiveDemo_Simple.pde

… which is again mirrored over at http://ift.tt/1UpNsOP.

Now we have to start the Arduino software. If you are connecting to the Pi via SSH then you can enable X11 forwarding to your local machine by logging in with:

  ssh -X pi@172.17.173.41

Alternatively, you can type startx to start an x session if you have a screen and keyboard connected to the Pi. Once you have logged in with your desired method, type arduino into a terminal to start the Arduino programming software.

Open the ReceiveDemo_Simple.pde file that you just downloaded and upload it to the Arduino. Then open the serial monitor (Tools>Serial Monitor) and press the reset button on the Arduino. By pressing each button on your remote, you can see the code to switch each socket on and off. Make a note of the codes for each button because you will need to enter them later. Our output can be seen in the top-right image.

Once this is done, we can finally write the duino software to the Arduino. This process is the same as what you’ve just done except the file is located at /home/pi http://ift.tt/1pgBuLQ.

The software might take a minute to compile. Once it has been uploaded, you can exit the Arduino software and press the reset button on the Arduino. Now we can put everything together and start adding our sensors to heimcontrol.js.

Set up your control interface

Now is the time to start adding our sensors and devices to heimcontrol.js

1. Start heimcontrol.js on boot

Before we start adding devices, it makes sense to start heimcontrol.js on boot. To do this, we can add a line to /etc/rc.local which is a script that gets ran at boot by the root user. The file needs to be edited with sudo and your favourite editor, for example:

  sudo nano /etc/rc.local

Add the following line before the line “exit 0”:

  su pi -c “node /home/pi/http://ift.tt/1UpNsOR” &

Heimcontrol.js will be started automatically at boot from now on, but for now you can start it with node /home/pi/http://ift.tt/1UpNsOR.

webcam_view

2. Add the camera feed

Go to Settings and select Webcam. Set the method to Streamer and the devices as /dev/video0. Pick an interval; we picked two seconds but you can pick any interval you like. Shorter intervals are more feasible on a Raspberry Pi 2, as it is generally more responsive. Click Save and then go back to the home page.

3. Prepare remote control socket codes

This is where you need the codes that you sniffed from the remote earlier on. The heimcontrol.js web interface takes the code as a binary string of 1s and 0s. However, the code we sniffed is in a different format so you’ll need to convert it to binary using Python. Type python2 into the terminal to open a Python interpreter. Format the integer you captured as a binary string like so:

  >>> “{0:b}”.format(16738063)

  ‘111111110110011100001111’

4. Add the remote control socket

Go to the Settings menu and go to the Arduino section. Click the Add button and set the method to RC Switch. Set the code type to binary. Give the switch a name, enter the pin that the RF transmitter is connected to (in our case, pin 2) and enter the two codes that you just worked out for the on/off buttons. Go back to the home page and test that the switch works. If it doesn’t, you might need to add an antenna to the transmitter by making a loop of wire. Check everything is connected correctly.

5. Add the temperature sensor

The temperature sensor can be tricky because it needs calibrating. A multimeter is a good idea so you can accurately read the analogue voltage. Go to the Arduino settings page and add a sensor. The formula for the TMP36 is: [(Vout in mV) – 500] / 10. We read 718mV with a multimeter, which would put the temperature at 21.8°C. Experiment with the formula by seeing what the raw value of x is from your sensor, but ours ended up as: (((x+45) * (5000/1023.0)) – 500) / 10. (5000/1023 is because the Arduino has a 10-bit analogue-to-digital converter, ie 0-1023 to read a voltage up to 5V.) Note that you have to ensure you have perfectly matched brackets, otherwise the software will crash because it simply tries to eval the string you put in.

Home automation with your Pi - Part 2

6. Add the LED strip

Finally, it’s time to add the LED strip. Make sure the signal wires are connected to PWM-capable pins on the Arduino marked with a ~. We used pins 3, 5 and 6. Go to Settings>RGB Lights. Ensure you have the signal wires connected to the correct colours. We used 6 for red, 5 for green and 3 for blue. Click Save and turn on the 12V supply. Select a colour from the colour picker. Your strip should light up! Pick Red, Blue and Green to ensure everything is wired up correctly. 



from Linux User & Developer – the Linux and FOSS mag for a GNU generation http://ift.tt/1pgBv26
via IFTTT

Wifi Enabled Center Speaker

[Ronald] has been improving his audio set-up for a while now, his latest revision culminating in this WiFi enabled center channel speaker. It all started with feature creep as you can see in this direct quote, “Being an engineer, I couldn’t stop here, not now that I had a way of adding more features…”

He had purchased a new amplifier for his system, but was irritated that the loudness setting would re-enable itself every time he switched inputs. First he thought he might just have a little board that intercepted the signals from his remote and tacked on the loudness off signal. It occurred to him that it would be even cooler if he could control it from his computer or phone. So he opened the case on his new amp and discovered an i2c break-out. We can guess how it went after that.

In version 2.0 he kept most of his work from 1.0, but wanted to simplify the set-up and build it all into a center speaker unit since an amplifier and two speaker cabinets takes up too much room. He fit a similar set-up as before in the center speaker casing, but added a touch screen and a few other improvements.  Though, strangely, he ran into some problems upgrading to the Raspberry Pi 2.0 and had to revert.

The final result is very nice, though obviously not done. As the engineer’s mantra goes, “If it ain’t broke, it doesn’t have enough features yet.”


Filed under: musical hacks

from raspberry pi – Hackaday http://ift.tt/1pmSVel
via Hack a Day

Saturday 12 March 2016

Use the Twitter streaming API in Django

languages over the years, and one of these is, of course, the very popular Python. In the past, we’ve done tutorials on using Twitter via Python to create little apps and streaming programs. The various libraries make good use of the API and, with a little bit of tweaking, you can carry out a lot of Twitter-powered functions.

Twitter is a web tool, though, but luckily there is a version of Python for the web: Django. Some of the tools have been further ported to Django and allow you to integrate it into websites fairly easily. This can be used for something like a sidebar that has a running stream of tweets from the website owner or from a list of relevant information, or for sniffing out a certain hashtag. Using these in web development requires you to have your own API key from Twitter, but those are fairly easy to get when you look in the right place, and we’ll show you where that place is shortly.

Getting a Twitter API key enables you to start accessing Twitter via a whole number of ways, not just for a bit of Django in this tutorial. Bear in mind that it still doesn’t guarantee full access to Twitter, though; there is a limit to the amount of requests that it can make and there are no push notifications available for anything but the homegrown Twitter applications. Still, you can carry out a lot more different functions with it than those you might see in more official efforts.

To get the API, you need to first head to the Twitter Developer site while logged in (http://dev.twitter.com). The layout has changed a bit recently, but to find your list of apps to manage and/or add a new one, scroll down to the bottom to find the ‘Manage Your Apps’ option. From there, go to ‘Create New App’ and fill out all the necessary details for whatever it is that you want to create, filling in any blanks in your profile that Twitter wants in the process.

django1-1

Get the library set up

We’re going to be using the excellent Django Twitter Stream library by user michaelbrooks (http://ift.tt/1YJe2mD) to create our own Twitter streams. It runs on tweepy, one of the better Python modules for using Twitter, and makes use of a database to store data. We first need to install it using:

  $ pip install -e git+http://ift.tt/1plSukj

django-twitter-stream.git#egg=django-twitter-stream

Once installed, you should now add it to the INSTALLED_APPS in the Django settings file:

  INSTALLED_APPS = (

      # other apps

      “twitter_stream”,

  )

If you’re using MySQL, you’ll need to make an entry that enables it to save the tweets the correct way; MySQL is set to only read standard utf8 characters sets, whereas tweets use 4-byte characters that aren’t supported by that. You can add an entry to your database settings to fix that, though:

  DATABASES = {

      ‘default’: {

          ‘ENGINE’: ‘django.db.backends.mysql’,

          # username, password, etc…

          ‘OPTIONS’: {

              ‘charset’: ‘utf8mb4’,

          },

      }

  }

Finally, you need to update your database for the installation to complete. Do this with:

  $ python manage.py syncdb

django4-1

Connect to Twitter

Now the Twitter stream module is installed, you’ll find a new section on the Django admin page for ApiKey. Here you can add your Twitter keys – get them from the settings of the application we created earlier, filling in all the requested fields from the ApiKey.

We can now add filtering terms to the Twitter stream. Bear in mind that when we say ‘filter’, we’re referring to a specific term in the Twitter API. It’s basically the same as the standard Twitter search function, but you can give it more precise parameters that will return very specific tweets, such as all posts from a certain user, hashtag, list or whatever you’d like the website to display. You can add whatever filters you want to use to the database using the Django Admin interface again. There are exact details on all available filters inside the documentation (bit.ly/1LfN2Gh).

Most of it is the way that it reacts to certain phrases. Words with no punctuation will lead it to look for any instance of that word on its own. This includes Twitter account names, hashtags, instances where the word has punctuation attached to it and even links with the term in.

Adding a space between words allows you to search for multiple words in one tweet, and they don’t have to be together or in a specific order. You can also add a comma between terms as an AND/OR statement, returning results that contain either or both set of words.

The GET user parameter can be used to returns results from specific users, either from just their feed or only certain results from that feed, based on the keywords. There are more ways to narrow it down, such as by location or via lists, and with a bit of ingenuity you can create a complicated string that handles all your needs.

django2-1

Start streaming tweets

To begin building the database that you can start drawing from, you need to start the streaming API using the following:

  $ python manage.py stream

This will fill up by polling the stream every ten seconds. You can limit this rate by instructing when the stream should poll, but you cannot get it to create multiple streams. You can try if you want, but you may get your own API banned, so it’s not worth it. Anyway, to change this rate you can instead use:

  $ python manage.py stream MyAPIKeys –poll-interval 30

You can also get the stream to save to a .json file. You can do this if you want to read the file rather than the database, or if you want to shut down the database. To redirect it, use:

  $ python manage.py stream –to-file [file].json

Tweet page

You can create a stream page to initially check the stream before you start adding elements from it into a website. To do this, you’ll first need to add a new URL line to the url conf like so:

  url(r‘^stream/’, include(‘twitter_stream.urls’,

namespace=“twitter_stream”)),

You’ll also need to add it as an app in the INSTALLED_APPS file, with a section like so:

  INSTALLED_APPS = (

      # other apps

      ‘django.contrib.humanize’,

      ‘bootstrap3’,

      ‘jsonview’,

  )

Create a settings file

If you want to start customising the Twitter streamer, you need to add specific settings to the Django settings file. You can’t just change one setting and ignore the rest, though, so you’ll need to add all the default settings before making any modifications. Here’s what you should start with in your settings file:

  TWITTER_STREAM_SETTINGS = {

  # Set to True to save embedded retweeted_status tweets

  # Normally these are discarded.

      ‘CAPTURE_EMBEDDED’: False,

  # Change the default term track & tweet insert interval

      ‘POLL_INTERVAL’: 10,

  # The name of the default keys to use for streaming.

  # If not set, we’ll just grab one.

      ‘DEFAULT_KEYS_NAME’: None,

  # Put the stream in a loop so random termination

  # will be prevented.

      ‘PREVENT_EXIT’: False,

  }

With this, you can start making permanent changes to the way the stream works, as well which API keys to use at any given time if you’ve decided to use multiple APIs in the app.

django3-1

Implement into your site

The API allows you to create a database or a file to keep the necessary tweets in. As with any database or list file in Django, you can start using data from it to fill up a page or part of a page. Tweets contain time data, among other things, so you can easily organise them into chronological order to create a more natural stream.

If you are looking at retweets, though, be aware that if you’re writing information to a file, new entries will overwrite other data, so you need to use a database for that.

With these tools you can start updating your website to be much more in line with modern social media practices, and help direct people to other avenues of information than the main website.

Test settings

Try the following settings file to get things working at first, and build upon it to make the code better and more efficient.

  from os.path import abspath, dirname, join, normpath

  # Absolute filesystem path to the

  # Django project directory:

  DJANGO_ROOT = dirname(dirname(abspath(__file__)))

  SECRET_KEY = ‘secret’

  DATABASES = {

      ‘default’: {

          ‘ENGINE’: ‘django.db.backends.sqlite3’,

          ‘NAME’: ‘test_database.db’,

      }

  }

  STATICFILES_FINDERS = (

      ‘django.contrib.staticfiles.finders.

FileSystemFinder’,

      ‘django.contrib.staticfiles.finders.

AppDirectoriesFinder’,

  )

  TEMPLATE_LOADERS = (

      ‘django.template.loaders.filesystem.Loader’,

      ‘django.template.loaders.app_directories.Loader’,

  )

  TEMPLATE_DIRS = (

      normpath(join(DJANGO_ROOT, ‘templates’)),

  )

  INSTALLED_APPS = (

      ‘django.contrib.humanize’,

      ‘django.contrib.staticfiles’,

      ‘bootstrap3’,

      ‘twitter_stream’,

      ‘south’,

 



from Linux User & Developer – the Linux and FOSS mag for a GNU generation http://ift.tt/1V0zq6Y
via IFTTT

Amazon

Donate

Donate Towards More Raspberry PI's for Projects