Raspberry Pi—Can An Old Dog Learn New Tricks?

My friends keep asking me:  “What do you all day now that your retired?”  “Puttering around in my small world,” might be one answer, but it’s not very specific.  One thing I’m actually doing, is playing with the Raspberry Pi, a gadget designed to teach kids about technology.  In some sub-cultures of the Geek world, the Raspberry Pi is a very popular little device.  It’s one of those toys that many grown-up kids love too!  I’ve always felt guilty for giving up on math when I was young, so I’m using my Raspberry Pi in an attempt to relearn math.  Maybe even go further than I did the first time around—but that might be Pi in the sky.  I’m just starting, and won’t know for months or years.  I’m not sure if it’s even possible for an old dog like me to learn something that hard and abstract.  I piddle at it a little bit at a time, whenever I feel like it.  I hope I can push myself to learn new things, even things that were hard for me to learn when I was young.  It’s an experiment, and the Raspberry Pi is a cool tool to conduct that experiment.

The Raspberry Pi is a small, single circuit board, that is a complete computer for $39 at Amazon.  It’s used to teach programming, mathematics, automation, robotics and embedded systems.  I had three reasons for buying the Raspberry Pi.  First, I read that it came with a free version of Mathematica.  Second, I wanted to learn Python.  Third, I wanted feel the same kind of fun I had in the 1970s and 1980s, with old 8-bit computers like the Atari 400 and Commodore 64.

The Raspberry Pi has been a success at teaching kids, so what about adults?

I bought the Model B a couple months ago, before the Model B+ came out.  Be sure and get the B+ now.

The Raspberry Pi mainly appeals to Do-It-Yourselfers and Makers.  It’s not a turn-key product.  You can buy just the B+ board if you have lot of computer junk sitting around the house to make it work, and get off with just spending $39.  You’ll need a USB keyboard and mouse, and if you want Wi-Fi, a Wi-Fi adapter.  I bought my Raspberry Pi as a little kit off Amazon ($62) that included the SD card already preformatted and loaded with  NOOBS, a power supply, HDMI cable, plastic case and WiFi adaptor.  If you want to save money and have a SD (microSD for B+) card lying around, it’s possible to format one yourself with a free download.  At first, I hooked it up to the Ethernet wire, and used the two USB ports for keyboard and mouse, but later moved the whole setup to another room, so I had to add an old USB hub to the first USB connector and the Wi-Fi USB to the second.

I bought the Amazon Basics keyboard and mouse for another $15.  But I now wish I had spent $9 more for a wireless keyboard so I could skip the USB hub.  My Raspberry Pi seems to be a growing octopus of wires.  If you start with the B+ model, it has 4 USB ports, removing the need for a USB hub.   Remember, the B+ model requires a microSD card.

I should mention right up front that the Raspberry Pi is not a fast machine.  If you lack patience or do not like to tinker, then the Raspberry Pi will only confuse and annoy you.  To be honest, I bought this $39 computer to get a free copy of Mathematica.  The cheapest other way to get Mathematica is to buy the home edition, which is $300 – or the new $150 a year online version.  Mathematica recently updated their Raspberry Pi edition to v. 10, their latest.  Wolfram is being very generous.

I’m hoping that Mathematica will give me a leg up on relearning math by making math more visually fun.  Python is also used by mathematicians, scientists, statisticians and big data miners.  Even though the Raspberry Pi is promoted as an educational tool the the young, it has tools suitable for grade school through graduate school.

If you want just want to learn Python and Linux, I’d recommend putting Ubuntu on any old machine you have – it will run much fastest than a Raspberry Pi.  Buying a faster SD card could speed up your system.  Check for compatible cards here.  It’s also possible to have different versions of Linux to boot up on different SD cards, and even other OSes. Even Raspian might be upgraded to run faster.  Having the Pi is essential for the free copy of Mathematica, and a fun gadget electronic and robotic projects, but most of the programming features can be installed on your existing computer.

I hooked my Raspberry Pi to an old HDTV via the HDMI cable, although you can hook it to your existing monitor if you have an extra HDMI port and just switch sources.  And I did that to begin with, but having two keyboards and mice on the desk is a pain.  I moved my whole setup to another room and think of my Raspberry Pi as my math studying computer.  It’s also possible to have a headless system, where the Raspberry Pi runs without being connected to a monitor or keyboard/mouse, and you remote into it from your main computer.  I might ultimately do that.

I lucked out and did everything without referring to any instructions.  And I was lucky.  When you first boot up you see a text-based configuration menu which OS did you want to install.  I guessed that I wanted Raspbian – which turned out to be right, because Raspian comes with the free version Mathematica and setups to program in Python, the reason why I bought the Raspberry Pi in the first place.

Installing Raspian takes a while, but after that you’re shown another text based menu – raspi-config.  If you live in the United States use the config_keyboard option, the default is for Great Britain.  If you get funny things from your keyboard, this is the problem.  I then told it I want to boot up in the GUI and restarted.  Now my machine boots into Raspian.

Raspian

I then ran WiFi Config (wsa_gui) to configure the Wi-Fi, and put in my password.  Again I guessed and lucked out at what to do.  If you have no Linux experience, you will need to find instructions for all of these steps.  Because people set up their Raspberry Pi machines with surplus parts it doesn’t always work.  That’s why I went ahead and bought the $62 kit from Amazon – and even still I was lucky that everything I added worked well with the Pi.

Now, I must reiterate  my first impression.  The Raspberry Pi is slow.  The Midori browser works, but is very slow, especially under my Wi-Fi.  Luckily Midori was recently replaced (9/15/14) with Epiphany browser, which runs much, much faster.   Using Raspian is slow too.  Not horrible, but running GUI apps takes much patience.  So much so, I’m not sure I want to run them.  Internet speed is also improved by being wired with Ethernet.

Python runs in text mode, so speed isn’t a factor.  The Wolfram Language also runs in text mode.  Mathematical has a graphical UI which takes a very long time to load, but once you’re in the notebook it’s fast enough crunching normal math problems.  Using the system to program electronic projects won’t require speed either.  The Raspberry Pi is not a desktop replacement computer, although if you’re patient it can do most things.  If you go to Google or YouTube you’ll find a endless examples of what people do with their Raspberry Pi.  I have mine set up on a table with a bunch of math, Python and statistics books.

I might discover that I can’t break through the math-barrier and switch to learning robotics.  Or I might really get into math and decide spending $300 for a Windows copy of Mathematica, but until then using the free version is a great bargain.  I like playing with the Raspberry Pi because it reminds me of the days when I loved reading Byte, Creative Computing and Compute!.

p.s.  If you don’t want to use Mathematica, but still want to study math and Python, I also recommend Sage, a free alternative to Mathematica that runs on Linux.  And it’s possible to run Linux within Windows, or run Sage as a binary on the Mac.  That way you need to buy nothing extra, or mess with new gadgets.

JWH – 9/18/14

What’s The Visual Basic of 2014?

I’m an old retired programmer that would like to fart around writing an occasional computer program.  For almost twenty years before I retired I wrote ASP/VBScript/SQL Server code for IIS.  It’s not something I’d use just for fun.  Actually, my brain is old and I don’t want to stress out a bunch of brain cells studying something hard.  I just want to whip out small personal applications.  Years ago, Visual Basic was a very easy to use tool for creating programs to run on Windows.  Microsoft still supports Visual Basic, and even has a free edition with Visual Studio Express 2013 for Windows, but modern Visual Basic isn’t the fun and easy tool it once was.

visual-basic-2

Many sites on the internet promote Python as the current easy to learn, quick and dirty programming tool.  Python is free, works with Windows, OS X and Linux, and its well respected.  Python offers a lot of room to grow.  My worry about Python is it’s not a GUI programming language even though you can get all kinds of libraries to write graphical programs.

In the early days of microcomputers – does anyone call them that anymore – the interfaces were text based, and much easier to program by newbies and do-it-yourselfers.  Adding a graphical front end and a mouse made programming far more complicated for amateurs.  That’s why the old Visual Basic was such a wonder.  We now have a bunch of graphical user interfaces to deal with:  Windows, OS X, iOS, Android, Gnome, KDE, etc.  Python and Java have tools that let programmers write cross platform applications, but to be honest, I think they’re all ugly.  And the variety of possible tools is overwhelming, just look at the GUI programming offering for Python

If you want beautiful applications and apps you need to write native code that’s best for each GUI.  Goddamn Apple came out with Swift today.  It could become the Visual Basic of 2014 if you own a Mac, which I don’t.  How cruel of Apple to tempt me so.  Swift is meant to be easy, fun, beautiful, elegant, and fast.  Makes me want to stop writing this essay and go buy a Mac – but that’s not going to happen.

Back to my problem.  What’s a good programming language to write quick and easy programs for a GUI that can be shared across platforms?

Duh!  What about HTML.  HTML is for web apps, but why not use it for desktop applications too?  It provides a common programming system for writing a common graphical interface, especially when you think about HTML 5 and CSS 3.  And it’s even possible to work with a fun language like Python with a web framework.  This might be a great idea, but it’s not quite what I want.  Visual Basic was a single program that made it easy to write programs that ran under Windows, at first with a runtime, and later as a binary executable.  Many of the widgets were drag and drop requiring little or no code.

Code.org entices would be programmers with a simple drag and drop programming language to start, and then moves students to JavaScript.  They even have a language, LightBot for kids as young as 4, and they offer classes in Python, HTML and Objective C.  There’s all kinds of avenues to learn to program, but I’m not really asking about that. 

What I want is a programming language that’s equivalent to a hammer, saw, pair of pliers and couple of screwdrivers.  Just the basic toolkit to get handyman programming done.  I don’t want a whole workshop of tools to build fine furniture or rebuild a 1968 Porsche.   I just want to computerize some of my daily tasks, like managing my book collection or organizing my computer files.

I could take a step backwards and give up on having a GUI and mouse with my programs, in which case Python is probably the answer.  Whenever I play with R, the statistical programming language, it reminds me of the old days of mainframes, mini-computers and GW-BASIC.  Maybe a GUI requires power tools, and I should just give up on programming for a graphical interface.  COBOL and FORTAN used to do some amazing things with only green bar paper output.

However, is going old school really the answer?

I could do what I wanted with PHP and SQLite, but I’d have to run a web server on my machine.  If I ever wrote something worth sharing, it would require the user to also install a web server.  That is a burden, but is it a showstopper?   Combining a server side scripting language with a simple server, and a good WYSIWYG HTML editor might deliver something very equivalent to Visual Basic.  I could still use Python, but would PHP be better?  Wouldn’t HTML 5 and CSS 3 offer far more GUI power and standardization than any non-standard GUI library?  And adding a MVC library might make programming faster if their learning curve wasn’t too steep.

It’s a shame that someone doesn’t make an IDE with built-in web server so it would be the programming language and runtime in the same program.  Or does such a doohickey already exist?  I’ll need to research that.

JWH – 6/2/14