Raspberry Pi command line: Connect to storage

Raspberry Pi command line: Connect to storage

Although Raspbian will, when booted as far as the GUI, automatically mount any disk-type device (USB flash key, camera, etc.) plugged into the USB port and offer to open it for you, you may wish to get more direct control of the process. Or, as is more often the case, you may want to mount a disk when the Raspberry Pi is running a project that doesn’t involve anyone getting as far as typing startx at the command line, as such graphical fripperies aren’t necessary for most connected devices. For more command line tips and projects such as this, you should check out our brand new Ebook, Conquer the Command Line. It’s available on all the usual digital services so you could own it instantly. Connected or mounted? Plugging a drive or flash memory device into your Pi (connecting it to your computer) is not the same as making it available for the Pi to interact with (mounting it) so that Raspbian knows what’s on it and can read, write, and alter files there. It’s an odd concept to accept: the computer knows there’s a disk plugged in, but its contents remain invisible until the Pi is told to mount it. It’s a bit like seeing a book on your shelf, but not being allowed to open or read it. Disks and disk-like devices are mounted by Raspbian on a virtual file system, and you’ll rarely need to worry about what goes on beneath that layer of abstraction, but to see some of it, type mount. The information displayed is of the form device on mount point, file-system type, options. You’ll see a lot of device “none” for various bits of the virtual system that you don’t need to worry about; the devices that concern us start with /dev/  and have names like /dev/mmcblk0p1  for partitions of the Pi’s SD card, and /dev/sda1  for plugged-in USB drives. Plug in a USB drive (remember that the Pi is not happy to power drives itself: either use a powered drive, or plug a USB flash drive into a powered USB hub). If you haven’t yet typed startx , then the disk will not get automatically mounted; if you have, then you need to unmount it. mount  will show an entry beginning something like “/dev/sda1 on /media/FLASH DRIVE… ” and you can unmount with sudo umount /dev/sda1  (yes, that is umount without an “n”). An error…
Source: Raspberry Pi command line: Connect to storage

Spookiest Raspberry Pi Halloween projects – part two

Spookiest Raspberry Pi Halloween projects – part two

Yesterday we looked at three spook-tastic Raspberry Pi Halloween projects. If you think those were scary, then get a pillow ready for our remaining four frightfests… The full article can be found in The MagPi 38 Scary Door (and Scary Porch) Don’t get too close to this door if you value your sanity Maker: Cabe Atwell – Electrical engineer, writer, crafter of cursed objects You are entering the vicinity of an area adjacent to a location. The kind of place where there might be a monster, or some kind of weird mirror. These are just examples; it could also be something much better. Prepare to enter… The Scary Door. Or not in this case, as this is not a real door. Or a Twilight Zone parody. While the Haunted House we started off this feature with shows the entrance to a spooky residence, this kind of project is what you might find inside as you wander around. It’s a peculiar metal door, with a window you can see through. A knocking sound is coming from behind it; perhaps someone is lost? As you get closer, you see through the window a normal-looking lounge. You can’t see anyone, but the knocking is still there and as you reach for the handle, a monstrous face appears. Who’s that at the door? Cabe’s idea was to create a modern haunted house effect on the cheap that was different every time you saw it. As well as the pop-up scares, there’s ghosts and monsters flying around in the ‘window’ (actually an LCD screen), and the scares and sounds you can create are as many as you can imagine. The knocking sound comes from pistons smashing against the door. As well as the door, Cabe has previously created a Scary Porch, which he describes as “[an] exploration of my idea of consuming someone with light and sound, to the point where they wanted to run away.” Unlike our Haunted House project from earlier, which was doorbell-activated, the porch could sense how far away you were from the door. As you started to approach, it would start playing creepy sounds and slowly turn on some bright red lights. As you got closer to the door, the louder the sounds became and the brighter the lights got, until screams and roars began playing when you were in knocking range. Significantly less scary with the lights on, nevertheless…
Source: Spookiest Raspberry Pi Halloween projects – part two

Justin Lin Circling 'Space Jam' Sequel Starring LeBron James (Exclusive)

Justin Lin Circling 'Space Jam' Sequel Starring LeBron James (Exclusive)

Lin, Andrew Dodge and Alfredo Botello are writing the script for the basketball sequel which will star the NBA player.read more
Source: Justin Lin Circling 'Space Jam' Sequel Starring LeBron James (Exclusive)

Spookiest Raspberry Pi Halloween projects – part one

Spookiest Raspberry Pi Halloween projects – part one

Gather round, ghouls and girls, it’s that time of the year again when scary rules supreme. Perhaps you’re planning on dressing up to go trick-or-treating or marathoning a ghastly amount of horror films, but we’ve found some people who are deep in their lairs experimenting with a Raspberry Pi to create the spookiest projects the world has ever seen. We’ve hunted down the most horrifying and wicked projects for your reading pleasure, but don’t worry, the only dark art at work here is the odd bit of C programming. Beware, read any further and you’ll be doomed to be inspired by these seven unholy projects… and have to read many more awful puns. The full article can be found in The MagPi 38 We’ll be rating these projects using the all-knowing MagPi SPOOK-O-METER Raspberry Pi Haunted House Enter if you dare to the abode with home scare-tomation Maker: Stewart Watkiss – data centre manager, father, part-time Count Dracula It’s late. The night grows dark and you’re near the end of your trick-or-treat run – but what’s this? A house you’ve never seen before on your road. Eager for more sweets, you make your way to the door. A haunted house sign greets you, but you think it merely decoration. Approaching the door, you press the doorbell – only for glass to break and the light to go out. A door creaks, the sign you had dismissed flashes, and you hear screams as the lights come back on. Startled, you look to your right and realise monsters are partying in the garage next to you, celebrating another victim in their night of ghastly fun. What horrors await inside? “I had been trying to think of something fun to do for Halloween and the Raspberry Pi was an obvious choice,” the owner of this nightmarish house, Stewart, tells us. “I’d recently built a circuit for home automation using remote-control sockets and had the idea of using that to turn lights on and off automatically. I also spent some time looking around at shops to see what other Halloween props I could add to the project.” The system is deceptively simple, although there’s a lot of different components to it. A dedicated doorbell is hooked up to a PiFace board that interacts directly with the Raspberry Pi and some Python code. Stewart chose the PiFace for this, instead of wiring up directly to…
Source: Spookiest Raspberry Pi Halloween projects – part one

Ultrasonic Theremin

Ultrasonic Theremin

Thinking outside the box is what we like here at The MagPi. The Raspberry Pi is so versatile and so open that you can do so much with it that perhaps other people wouldn’t have dreamt of before. So here’s a good question: with a Raspberry Pi, some speakers, and an ultrasonic distance sensor used for robotics, what would you make? Linus Forslid decided to build a type of theremin. The full article can be found in The MagPi 38 A compact device with one purpose – this is Linus’ complete Theremin “A theremin is a device that measures distances to objects nearby and turns that into sound, so that when you move your hands around it, you can generate music,” Linus explains. It’s not exactly like a normal theremin, though. “Unlike a classic theremin, my project uses an ultrasound sensor rather than measuring electrical fields with antennas, and currently my project only has a single sensor, so you can only control the tone it produces. Eventually, I plan to add another so that the beat can also be manually controlled.” Theremins were used to create the eerie, creepy music for classic sci‑fi films. Due to this and its unusual method of operation, the theremin has become intriguing to many musicians and techies, including Linus: “I’ve always wanted a theremin, from the first day I heard of it. It’s just such a cool thing. As it turns out, though, an actual theremin is not cheap or easy to build, but this project was easily doable and I had almost all of the components at home already, so the cost was minimal as well. I decided to use a PC speaker instead of the Pi’s own audio jack and an external speaker, mostly because I could, in addition to it not requiring an additional power source.” The set up is quite simple, but works very well The hardware is one thing, but actually translating it to sound, surely that takes a bit more work on the code to get it operational? “Not really, I think.” Linus adapted some pre-existing code for the project. “The script that controls the theremin is coded in C using wiringPi, and it took maybe an hour to get it working. I’ve spent a couple of hours beyond that just tweaking the numbers to try out different sounds and find one I like. I wouldn’t say it…
Source: Ultrasonic Theremin

Raspberry Pi fridge monitor

Raspberry Pi fridge monitor

The house is infested with cheese fairies who raid the fridge at all times of day and consume considerable quantities of tasty cheese. In this project, any fridge-door-opening activity will result in a notification email – or, if you prefer, a tweet or Facebook update – telling you the time that the fridge door was opened. This may seem a somewhat trivial example, but it really serves to show just how easy it is to hook up a sensor that will cause your Raspberry Pi to notify you of events in a variety of ways using the If This Then That framework. As you’ll see from the below list of required components, this project uses a photoresistor connected to the Raspberry Pi GPIO header using a pair of female-to-female jumper wires. This tutorial can be found in The MagPi 37 You’ll need Photoresistor (almost any one will work for this project) 2× female-to-female jumper wires USB Wi-Fi adaptor (unless your fridge has an Ethernet socket nearby) Detecting Darkness Unlike an Arduino, for example, a Raspberry Pi does not have analogue inputs that can measure a voltage. It does, however, have digital inputs; if the voltage at a digital input exceeds about 1.65V (half of 3.3V), then the input is read by the Raspberry Pi as HIGH, otherwise it is counted as LOW. So, although you can’t use a photoresistor with a Raspberry Pi to give a measurement of the light level (not without a few extra components anyway), you can use a photoresistor to tell if it’s dark or light. The digital input pin (GPIO pin 18) has its internal pull-up resistor enabled. So, while the pull-up resistor is trying to pull pin 18 HIGH, the photoresistor will try to pull it low. They are in a of tug-of-war and if the pull-up resistor is winning, the input will be HIGH; if the photoresistor is winning, it will be LOW. The more light falling on a photoresistor, the lower the resistance (the stronger it pulls pin 18 towards 0V). Typically, a photoresistor will have a resistance of a few hundred to a few thousand ohms when it’s in the light. If you make a photoresistor really dark (say inside a fridge), then its resistance rises to several mega-ohms (millions of ohms). At this point, the built-in pull-up resistor (50 to 100 kilo-ohms) will be easily winning and the input will be HIGH.…
Source: Raspberry Pi fridge monitor

First 30 issues of The MagPi free on Google Play and iTunes

First 30 issues of The MagPi free on Google Play and iTunes

Did you know you could get The MagPi on Google Play and Apple’s iTunes? You can subscribe to the magazine from there and buy our individual issues – however they only used to go back to the relaunch from earlier in 2015. That’s over 30 issues missing from The MagPi’s history! We’ve fixed that though. Not only are all the previous issues of The MagPi up on our app, but they’re all completely free, forever. So as well as being able to read all our new and current issues, you can catch up on all the past issues while waiting for the latest one to arrive. Old and new, every issue of the MagPi is now available Head over to the Play Store to grab the Android version, and the iTunes Appstore for the iOS version now to get some free mags! The post First 30 issues of The MagPi free on Google Play and iTunes appeared first on The MagPi Magazine.
Source: First 30 issues of The MagPi free on Google Play and iTunes

New Scratch review

New Scratch review

Scratch is one of the best ways to introduce young people into the joys of coding. Developed by MIT, specifically to help young people learn to code, Scratch is a visual editor with characters (known as Sprites) and blocks that react to, and control, the sprites. The blocks click together in much the same way that code is written, and clicking the blocks together creates programs. The Raspberry Pi foundation’s aim to build tiny and affordable computers for kids gels pretty nicely with Scratch’s aim to help young people learn to code, so it’s no surprise to see Scratch form part of the stock Raspbian operating system. What you may not have noticed, is that the recent Raspbian Jessie update contained a revamped version of Scratch packing some great new features. The new version of Scratch is based upon the same edition of Scratch (version 1.4) but it now runs much faster (up to 10 times as fast in some instances) and has native support for the GPIO pins. Let’s handle the speed boost first. The need for Speed While Scratch is developed by MIT, it’s brought to the Raspberry Pi thanks to the hard work of a developer called Tim Rowledge (rowledge.org), and it’s from his endeavours that we should thank for Scratch’s souped-up engine. Scratch was originally developed in a language called Smalltalk, and it runs inside a Squeak virtual machine (VM). Tim has spent time a lot of his time ensuring that Squeak runs on various ARM-based systems like the Raspberry Pi (mostly because he’s a RISC OS fan). Tim says he spent time “rewriting some of the more egregiously ugly code, improve algorithms, tweak VM configurations and so on.” While direct speed comparisons depend on a lot of factors, a version of Pac-Man created in Scratch by Andrew Oliver is now running at a playable 30fps (up from 16fps on the Raspberry Pi model B and a mere 1 fps on the original Pi). This faster speed isn’t just a nicety. The way Scratch gets kids coding is by recreating games, and game-like environments. The improved Scratch performance prevents young people from hitting a performance limitation and switching off. Using Pins If the speed boost wasn’t enough, Scratch now incorporates GPIOServer so you can directly access the pins on your Raspberry Pi. It’s been referred as a “first pass” at GPIO implementation, and it’s a bit…
Source: New Scratch review

Adam West, Straight-Faced Star of TV's 'Batman,' Dies at 88

Adam West, Straight-Faced Star of TV's 'Batman,' Dies at 88

The actor struggled to find work after the campy superhero series was canceled, but he rebounded with voiceover gigs, including one as the mayor of Quahog on ‘Family Guy.’read more
Source: Adam West, Straight-Faced Star of TV's 'Batman,' Dies at 88

Gene Wilder, Star of 'Willy Wonka' and Mel Brooks Classics, Dies at 83

Gene Wilder, Star of 'Willy Wonka' and Mel Brooks Classics, Dies at 83

The comic actor was at his best in ‘The Producers,’ ‘Blazing Saddles’ and ‘Young Frankenstein’ and teamed with Richard Pryor in four films.read more
Source: Gene Wilder, Star of 'Willy Wonka' and Mel Brooks Classics, Dies at 83