Tag Archives: Raspberry Pi

Applying Critical Thinking Across Disciplines

After patiently waiting for RetroPie to install and worrying about issues, I read the rest of the documentation including this sentence, “Now, you have to copy your rom files into the ROMs directory.” At first glance, I figured it meant the files had to be moved from one place on the Pi to another. Turns out these are ROM files that come with the various games and legally you are supposed to own the games in order to use the emulator.  Well, I don’t own any games–never bought a game console–so legally I can’t use RetroPie.

As I realized what had happened, I was reminded of one of the fundamental rules of cooking: read the WHOLE recipe first so you aren’t surprised when you are making something for dinner in an hour only to discover the whole casserole needs to sit overnight in the fridge. That’s a little how I felt last night.

Fortunately, there was an uninstall option but it did leave a few orphan applications behind and I’m thinking it may be time to do a clean install of Raspbian (after a backup, of course!)

Turns out all those cooking lessons can apply to programming!

Patience is…

waiting for RetroPie to install on my Raspberry Pi. It turns the Pi into a gaming machine and was a suggestion in the Raspberry Pi Projects community at reddit. I wanted a break from Python and I haven’t experimented with installing anything on my Pi.

It’s been working away for awhile and I’ve seen what appear to be error messages so I’m wondering if my Pi will even work after this over.

But if it doesn’t, I’ll get to practice installing a new OS, right?

It’s all about the learning.

Some Quick Tips for Newbie Programmers

The first steps of learning a new programming language is often to reproduce code written by others in books and on webpages. Seems easy, right? Should work perfectly, right? Not always.

Three things to do if borrowed code doesn’t work for you:

  • Always read the comments. Several times now, I’ve found that the original poster was almost right and a commenter with more experience than me had found the error or made the necessary addition.
  • Know your versions. I’m learning Python and I’ve learned that there are two versions with different syntax. Knowing the version of your tutorial is important. Both books I’m using–Make: Getting Started with Raspberry Pi 2nd edition by Matt Richardson and Shawn Wallace and Hello World: Computer Programming for Kids and Other Beginners 1st edition by Warren and Carter Sande to explore python more in depth–use version 2.7 syntax.
  • Retreat and reboot. I’m using IDLE as my text editor and python shell. I thought I had correctly installed pygame and I wasn’t getting syntax errors, but the pygame window refused to open.  The code was right, and it just wouldn’t run. I closed everything out and went away for awhile. When I returned and fired up my little python program, the window opened perfectly. Two lessons here: sometimes you just have to walk away. And that usually means a complete reboot that allows your computer to do its own retreat.

I am having fun doing some learning and being able to access it on my laptop is much more natural. I think I’ll be able to find more pockets of time including in hotel rooms now that I don’t have to carry all the peripherals. The RPi and a short ethernet cable are all I need.

 

Running Pi On My Mac

I’ve fiddled around a bit with my Raspberry Pi in the past but wanted to be able to run it using my laptop rather than having all the parts (monitor, keyboard, and mouse) cluttering up my workspace. Yesterday, in between Spring cleanup and gardening, I managed to get it to work. It took several chunks of time: I would work on it, get to a stopping place of either a roadblock or success, go outside and play in the dirt, then return with renewed energy.

I knew I wanted to do it via Ethernet as that way I could do demos without having to worry about connecting over wireless networks. And the two devices had to be connected to each other rather than through a router for the same reason.

There was a lot of trial and error but by last evening, I was playing with python via my mac. The steps below are NOT in the order I did them, and I wasted a whole block of time trying to get a small screen I have to display before giving in and setting up the RPi workstation. (The screen issues had to do with the screen and not the RPi.)

I tried the first option here and that at least got me as far as discovering and setting network addresses on the two devices. But, as the site points out, without having a keyboard and display, it’s tough to test. Once I gave in to setting up the workstation, I was able to have both devices talk to each other through ping pretty quickly.

I installed a VNC server via this Instructables site. The comments led me to the X11vnc as well as the missing code in the original directions. I figured I had to get X11vnc to autostart so I followed these directions. I never did get autostart to work, but the other issue that stumped me for a bit was the fact that I had to login to the RPi after start up before I could view it on my laptop, and I wasn’t sure how to do that without having the RPi plugged into its own desktop peripherals. I followed some directions for auto login but that seemed to take away my root abilities.  This was the point where I had to do some backing out, unediting a few files.

Finally, just as I was thinking it would have to wait for another day, I found this site by using the keyword “headless.” I had done a lot of the directions, but it was the ssh part that I hadn’t quite figured out. Worked wonderfully and left me wondering how much time I might have saved had I found this site first. But, I also learned a lot through the trial and error, getting comfortable with terminal windows and linux commands so it wasn’t a complete waste of time.

Now, I use the terminal window on my Mac to ssh into the RPi. I start up the X11vnc server, start up the the RPi graphical user interface and then use VNC to interact with it since I get an error message when I try to connect via the server command on my Mac.

Lessons learned? The Internet has a wealth of information and I am grateful to everyone who posted all the links above. However, it was not always exactly what I wanted or needed so I had to pick up bits and pieces from here and there. I did things that needed to be undone so a little ongoing documentation helped. (I have a paper journal where I can jot short term notes.) Finally, as always, knowing the language of the project helps to choose the right keywords.