Showing posts with label raspberry pi. Show all posts
Showing posts with label raspberry pi. Show all posts

Friday, July 25, 2014

Adventures in RetroPie


One of my goals with Raspberry Pi was to turn it into a vintage gaming console like the video above. I tend to be seduced pretty quickly by cheap ways of using interesting technology. The video can be found with more detailed written instructions on Lifehacker.com. Unfortunately, for the total noob like me, there are lot of little steps a long the way that made this "easy" project take way longer than prescribed.

Step One required me to download and install RetroPie on a SD card. RetroPie is the software that allows the Raspberry Pi to be used as a multi-platform vintage gaming console. The installation was not a simple drag and drop action. Lifehacker suggested using RasPi SD Card Builder for the Mac. One tutorial noted that Card Builder caused problems for some people. I, of course, am some people.

RasPi SD Card Builder seemed to stall about 3/4 of the way through the process. I made multiple attempts. A couple of times I received the error below.

Noob that I am, I wasn't sure  how to fix the problem. A couple tutorials suggested beginning a Terminal session on my Mac to build the SD card. However, they also mentioned being EXTREMELY careful. Entering the wrong syntax could cause major corruption to my Mac if I did things wrong. I really didn't want to cause total system failure just so I could play Super Mario Brothers and Excitebike.

Against, my better judgement, I began a Terminal session. I was very careful and followed the instructions from Tuts+ for flashing an SD card from Terminal. It really wasn't difficult, but the looming threat of a corrupt Mac had me worried. For the next 20 or so minutes, I starred at the window below.

In Terminal, there is no status bar. No blinking cursor. No spinning wheel. Nothing. You just wait. And hope that something is happening. And hopefully that something, isn't completely catastrophic to your hard drive. Multiple tutorials for RasPi setups use the phrase "this may take a few minutes, be patient". Unfortunately, "a few minutes" is really vague. Sometimes it means 2-3 minutes. Other times, it means more like 20. For flashing this particular image, it meant 45 minutes. By the time it was done, I was ready for bed.

The next morning I attempted Step Two and booting RasPi to boot up Emulation Station. Emulation Station is like an OS that manages multiple vintage gaming console emulators. You can load NES, SNES, Sega, Atari, and several other systems and play any ROMS (games) that you may have. Step two is not particularly difficult, other than setting up your "Internationalisation Options". Setting up your keyboard properly is essential to making things work. My Apple keyboard proved to be a little troublesome at first. But with some tweaks, I think I figured it out.

After another reboot, I had to set-up my controller for Emulation Station. I was using a  USB SNES controller from Amazon. To be honest, I didn't really know what I was doing in this step. I was just blindly following instructions. Things seemed to be working right. But after spending several hours just trying to flash the SD card, I was happy to just see RetroPie booting. I semi-successfully set up the controller for Emulation Station, but something was wonky. I didn't feel like I had full control of what I was doing. The buttons on the controller didn't seem to be acting the way I thought they should. I soldiered on.

Step Three required me to configure my controller for the emulators. This is a separate step than configuring the controller for Emulation Station. Remember, Emulation Station is like the OS. The emulators themselves (NES, SNES, Atari, Sega, etc) are more like the apps. Emulation Station and the Emulators have their own sets of configuration. I had to go back into command line and tap each button on my controller (up, down, left, right, a, b, x, y, l, r) when prompted. It wasn't difficult, but it took a couple tries.

Step Four was where things started getting real. I had a few ROMS that I had played on my Mac. Super Mario Brothers, Excitebike, RC ProAm, Blades of Steel, Contra, and NHL 95. In Step Four, I needed to load them on my RasPi. Lifehacker recommended CyberDuck for transferring files from my Mac to the RasPi. I downloaded CyberDuck, connected RasPi to my router via Ethernet and realized that I no idea how to find the IP address of my RasPi. Using "ifconfig" in command line, I learned how to find it, thanks to this link. (fwiw, i could never have done any of this without google) I connected to RasPi and eventually transferred my ROMs.

I rebooted to happily discover NES and Sega appearing in Emulation Station. Yay! I attempted to navigate to my games using my controller with little success. Something wasn't working right. I kept getting lead into a menu screen with options that weren't mentioned in my tutorial. I kept tapping buttons until finally I managed to reach the opening screen of Super Mario Brothers. Success! Kinda. 

The game itself worked flawlessly. I was jumping, busting bricks and collecting coins like it was the late 80s. Unfortunately, I couldn't seem to exit the game. My Apple keyboard was unresponsive as I tapped F4 and ESC. I couldn't even get back to command line. Frustrated, the only way to end a game was to reboot by pulling the power cord. This is not good practice with RasPi or any computer.

I ended up reconfiguring the keyboard settings a little to provide myself an exit from the game and Emulation Station. However, I feel like I should be able navigate and control the entire console from the controller.

Now it is probably worth mentioning that I attempted this project using a 25+ year old 13" composite TV. I do not recommend this! Composite TVs crop to much navigation from the top and bottom of the screen in both Emulation Station and Raspian. Raspian is unreadable on a composite. HD is essential. I later connected the RasPi to my 40" HDTV and was amazed to discover an entire menu at the bottom of Emulation Station that had been obscured by the cropping of my composite. My controller suddenly didn't seem so wonky.


While this project was not a gigantic undertaking, I really don't know how comfortable I am putting something like this in front of my K-4 students. While many of them have surprised me, the need for Terminal sessions seems a little too advanced. I have two RasPi  for my classroom this year. I thought I had an idea of what I'd like to do with them. Now, I'm not so sure.

Wednesday, June 4, 2014

The First 96 hours with Raspberry Pi


It hasn't been 96 continuous hours. More like, a little here and a little there.

I ordered my Raspberry Pi from Amazon. I got the Complete Kit which included the Model B Raspberry Pi, power supply, 8GB SD card with NOOBS pre-loaded, and a Wi-Fi dongle. I found an old Apple keyboard, Apple Pro Mouse and an even older Emerson 13" composite television to rig up my first 'maker' computer.


I watched the videos from Raspberry Pi Foundation and hoped for a successful first boot up. I was a little concerned that my 13" composite might not do the trick, since it only had coaxial input. I used an RCA to coaxial converter that I had in the garage. I tested it with a VCR to be sure that it worked.
The first boot up was not a success. Nothing but static on the screen. The RasPi's LED was lit, but it was not sending any signal to the TV. I retested all my other hardware and checked the cables, but still had no luck.

I decided to relocate to my living room to try it on my HDTV. SUCCESS! And it was beautiful to see it in all of it's HD glory! After NOOBS booted,  I loaded Raspbian for the OS. It took about 15 minutes or so to load. Once everything loaded, I wasn't quite sure what to do. I poked around the OS to get a feel for how things worked. It was very similar to any graphical user interface. I hadn't planned on keeping my RasPi in the living room, so immediately got to work on trying to solve the problem of why my RasPi wouldn't send a signal to my old 13" TV.



Many reviewers on Amazon complained that their composite output was broken on delivery. The RasPi FAQ, however, explained that all their devices were factory tested. Considering they were made in the UK, I theorized that it was more of an NTSC/PAL issue, than a faulty jack. My theory was correct, but I didn't really have the skills to correct it.

I had to learn how to work with the config.txt file in the boot partition of the SD card. This required me to learn a little about Linux and how to comment out a line of code. I tried for several hours to modify the code but never got it to work. I gave up and went to the RasPi forum. I got a couple replies fairly quickly. I downloaded a newer version of NOOBS, erased the SD card, reloaded NOOBS, and rebooted while connected to the 13" TV and held Shift-4. SUCCESS! Raspbian had to be reloaded but I was happy to have finally have solved the problem after 24 hours.



I poked around for a bit while connected to the 13" TV. To be honest, I was a little disappointed. There is a reason why there are so many free composite televisions on craigslist. The image quality is dreadful. It is even worse to try and read computer text on a composite TV. However, one of my goals for my RasPi was to create a vintage gaming console that played NES, SNES, and Genesis games. I'd peeked a great tutorial for creating that project and concluded that 8-bit and 16-bit games would look fine on my old TV.

But before I could get to that, I wanted to connect my RasPi to the internet. My kit included a USB WiFi dongle and I read some tutorials about connecting to WiFi. Unfortunately, I have a hidden home network and my Linux skills weren't sharp enough to make the attempt. So, I decided to hardwire via ethernet to see if it worked. SUCCESS! Seeing the Google homepage load on the old 13" composite was magical. Kind of. 13 standard definition inches is not enough to view the most basic web page. I checked out a couple blogs and could hardly read a thing. There was some lag as pages loaded, but it wasn't unbearable. Connecting my RasPi to the internet proved a couple things. I either needed a HD monitor or start building the vintage gaming console.

I opted to download and install the Minecraft Pi Edition instead. Thankfully, there were multiple tutorials online for getting this done. Downloading was easy. However, I needed to launch my first LXTerminal session to decompress the file and load it. SUCCESS! Before long, I wasplaying Minecraft. Unfortunately, I know nothing about playing Minecraft. I figured out how to dig a hole and created a cave. I soon discovered that my 'vintage' Apple Pro mouse lacked a right-click button to allow me to build blocks. Normally, I would just use control-click but RasPi didn't respond. No worries. My cave was beautiful.



To more savvy Linux (and Minecraft) users, this is probably the most pathetic blog post ever written. Honestly, I am a little ashamed of my self for having become such a passive computer user. I used to connect all kinds of weird devices together with skill and ease. I was a web designer who could automate multiple tasks in Photoshop and creatively use HTML an Javascript to create interactive web pages. But that was 1990's and I have not maintained my skills. The past 96 hours have been a pleasure. I've been actively solving problems that lead to new ideas and creativity. And isn't that the point?

I can't wait to share this experience with my students next year.

Tuesday, April 29, 2014

Invent to Learn


This book is what I've been looking for, for a long time. Go buy it now!

I just got to the part about 3D printers, physical computing, and programming. I've been actively teaching coding via iPads since December. We use Kodable in K-2 and Lightbot and Hopscotch in 3-4.  I tweeted last week that the energy in my room has been absolutely electric while working with these tools. It's been so easy to see the benefit of teaching coding to young children.

Prior to reading the above, 3D printing didn't seem like something that would have a place in K-4. However, to be honest, I wasn't really clear on the practical applications of 3D printing either. Invent to Learn opened my eyes. A local high school recently acquired a 3D printer with the help of my friend Tony Youngblood. He also hipped me to iOS based CAD programs soon to be released by Makerbot. After a little more research, I've decided my classroom needs one. The 3D printer is the kiln of the 21st Century art room.

But physical computing is the technology that has me the most excited. Littlebits caught my eye a while back, but somehow I completely forgot about it. I've been describing them as electric Legos to my co-workers. These should be in every 3-4th grade science kit. I'm really interested in the Korg set for my own personal amusement. 

Although it is capable of so much more, I've also been familiar Arduino as tool for interactive art projects. I'm not sure how accessible it would be for my students, but it's definitely worth more research.

But Raspberry Pi. Oh my. So yummy. A $25 no-frills credit card sized computer that runs various useful computing tools. It also runs Scratch. Incredible. I have this idea about having my fourth graders building multiple Raspberry Pi stations for creating a Scratch lab in my classroom. I'm not sure how do-able this project is, so I'm gonna pilot the idea on my own in my garage this summer. After tweeting my ideas, I was also introduced to Kano. Wow.

3 more days of TCAP. Yeehaw.