may raspberry pi

My work with the Raspberry Pi has slowed of late, due in no small part to a lot of travel so far this year. When I got back this weekend, powered up the Raspberry and updated Arch Linux ARM to the latest packages, as least as of Saturday 3 May. I then went through my usual of cleaning up the file system and creating a compressed image. It was at the end of that process I discovered my biggest problem to date: the size of the compressed ZIP file. It had grown over 500MB to roughly 1.5GB compressed.

I tried to upload it to Sourceforge, only to find out they had a 1GB file size limit. So I pushed it out to the only place I have that would accept it, Goggle Drive. Please note that the older images have been deleted from Sourceforge, and for all intents and purposes, I’m done with using Sourceforge. From now on I’ll use Google Drive to hold publicly accessible compressed images, and Github to hold any source.

Furthermore, the link to Sourceforge on the main menu has been replaced with a link to my Raspberry Pi category. Simply click on it to read everything I’ve published on the subject, including posts like this one. It will help you quickly find what I’ve been doing as well as links to resources.

Here is the link to the compressed image zip file:

Link https://drive.google.com/file/d/0B3akRjoJF444SXA5dEJUeWJTdWc/edit?usp=sharing

I did download the file and found it took me, on my Brighthouse Networks connection, approximately 45 minutes.

And here is the link to the README.TXT file:

Link https://drive.google.com/file/d/0B3akRjoJF444cE9SV2R5R1ZvNGM/edit?usp=sharing

I’m going to repeat a good bit of the README, with additional comments.

Release Notes for my personal El Cinco de Mayo RPi Arch Linux Arm release

  1. The primary reason for this release is to fix Heartbleed in the OpenSSL libraries.
  2. The secondary reason is to remove unneeded applications, clean up work areas, and reduce as much as possible overall disk image usage.

The TWM-based X Windowing Arch Linux Raspberry Pi image has been updated

ArchLinuxARM-2014.05.05-rpi-twm08G.zip, located on my Google Drive location, contains ArchLinuxARM-2014.05.05-rpi-twm08G.img, a 7,948,206,080 byte file that can be flashed to an 8GB or larger SDHC or micro SDHC card. To use this image unzip and then copy the resultant 8GB file to your target SDHC or equivalent card.

This image has the TWM X window manager installed with custom configurations. All TWM related files are located in the subdirectory twm and its related subdirectories.

All Arch Linux ARM packages are updated as of 3 May 2014. NOTE: This includes updated ssl libraries to fix Heartbleed bug/exploit.

Note for future reference: My Raspberry Pi support system is a Samsung R580 with Ubuntu 14.04 LTS installed.

Node.js and Web Applications on the Raspberry Pi

Node.js is still installed, and updated from the Arch Linux Arm repositories.

Local node.js work directories have been cleaned out, leaving only two:

  • express.jade (for web framework work)
  • node_modules (for GPIO and I2C work)

To start the example node.js and Express web app:

  1. cd into express.jade
  2. type node app.js

You do not need to be root to run app.js. The web app listens on port 8080.

Security

Security has been scaled back with this image.

  • the firewall is now inactive

I determined that my ruleset for the firewall (iptables) was incorrect. This resulted in less than ideal remote access. Furthermore, it was determined that iptables.service (see systemctl) had an adverse impact on performance. Therefore the iptables.service has been disabled and the link in /etc/iptables has been removed. If you wish to enable this on your own the various iptables files are still on the image for you to work with. Good luck.

  • root login via ssh is still blocked, however.
  • sudo pi now requires a password again.

Other Applications

Java 8, which was installed local to pi, has been removed, along with all Java tools, such as ant. It will not be re-installed.

Future application development will be via Javascript (node.js), Python (2.7.6 and 3.4.0 or later), and gcc (8.4.2). These, along with bash scripting, give you four different ways to develop. Adding Java 8 to the mix provided no real benefit to such a small machine, and proved to be a major resource consumer that the Raspberry Pi did not need to support. The four current languages also have the advantage of being supported out of the Arch Linux Arm repositories; Java 8 was downloaded direct from Oracle.

pacman

The pacman cache (/var/cache/pacman) has been cleaned up with pacman -Sc. This has removed all unnecessary package references, reducing pacman’s cache disk footprint by more than half (over 400MB).

Python

RPi.GPIO has been updated to 0.5.5. It is built and deployed in this image.

Note that ~/RPi.GPIO-0.5.5/test/test.py will not work as-is with Python 3.4.0. The print statement in that version of Python is a fully qualified function (see PEP 3105) and is fully enforced. I  have included a patch in these release notes that you can cut and pasted into an individual patch file and apply to test.py.

Note to everyone: The fix is already in the test directory as test34.py, for Python 3.4.0. Even the patch is there as patch.txt. I bring this up in case you want to apply it to another installation on another distribution.

--- test.py 2014-04-21 08:45:14.000000000 -0400+++ test34.py 2014-05-03 00:54:50.910000000 -0400@@ -123,13 +123,13 @@ GPIO.setup(LED_PIN, GPIO.OUT) pwm = GPIO.PWM(LED_PIN, 50) pwm.start(100)-print "\nPWM tests"+print("\nPWM tests") response = raw_input('Is the LED on (y/n) ? ').upper() self.assertEqual(response,'Y') pwm.start(0) response = raw_input('Is the LED off (y/n) ? ').upper() self.assertEqual(response,'Y')-print "LED Brighten/fade test..."+print("LED Brighten/fade test...") for i in range(0,3): for x in range(0,101,5): pwm.ChangeDutyCycle(x)@@ -224,14 +224,14 @@ def cb(self,chan): self.switchcount += 1-print 'Button press',self.switchcount+print('Button press',self.switchcount) def setUp(self): GPIO.setup(SWITCH_PIN, GPIO.IN, pull_up_down=GPIO.PUD_UP) def test_switchbounce(self): self.switchcount = 0-print "\nSwitch bounce test.  Press switch at least 10 times and count..."+print("\nSwitch bounce test.  Press switch at least 10 times and count...") GPIO.add_event_detect(SWITCH_PIN, GPIO.FALLING, callback=self.cb, bouncetime=200) while self.switchcount < 10: time.sleep(1)@@ -239,12 +239,12 @@ def test_event_detected(self): self.switchcount = 0-print "\nGPIO.event_detected() switch bounce test.  Press switch at least 10 times and count..."+print("\nGPIO.event_detected() switch bounce test.  Press switch at least 10 times and count...") GPIO.add_event_detect(SWITCH_PIN, GPIO.FALLING, bouncetime=200) while self.switchcount < 10: if GPIO.event_detected(SWITCH_PIN): self.switchcount += 1-print 'Button press',self.switchcount+print('Button press',self.switchcount) GPIO.remove_event_detect(SWITCH_PIN) def tearDown(self):

Accounts:
Console only: root, password: root
Console and ssh: pi, password: pi

As pi, to start the TWM X Windowing desktop, type startx at the prompt.

ubuntu 14, the best linux release ever

Yesterday I updated to Ubuntu 14.04 LTS, or simply Ubuntu 14. For the first time in all the years of my experience with Ubuntu, I’m moving to a long term support (LTS) release with every intention of staying there. Whether I’ll stay with 14.04 for the full five years that Canonical guarantees security updates, or update to 16.04, depends on how much progress is made at the next LTS release two years from now in 2016. But as for installing the latest every six months, I think I’ve moved well past that point. And that’s actually a good thing. I’ve been a long time user of (and at times, battler with) Ubuntu going back to 2007 and Ubuntu 7.04. I started trying Ubuntu with the first alpha release of 7.04, and ended my first attempts at using Ubuntu with 7.10. That was the year I also wrote “It isn’t worth the trouble anymore” due to my experiences upgrading to Ubuntu 7.10 and openSUSE 10.3 on two home systems. I’d had all I could stand upgrading and then fighting introduced hardware support regressions. I was also using Windows XP at the time, and in spite of the fact Vista had been released nearly a year prior, I wasn’t going to dive into that “bag of hurt” while running away from the Linux bags of hurt. Nope, no way. But time heals all wounds, and even Linux can show improvements. In the case of Ubuntu the improvements are substantial and world class. Where I have, in past critiques, been quite brutal in my assessments, I have to say now that Ubuntu is one of the best, if not the best, Linux distributions you can get get. Period. In fact, I’ll make the following statement for the record;

Ubuntu is one of the best, if not the best, operating systems (including Windows 8.1 and Mac OS X Mavericks) you can install on any personal computer. Period.

If you’re considering an upgrade from Windows XP and don’t want Windows 7 or later, and further assuming you’re not beholden to some very specific software application that must run on Windows XP, then you should consider Ubuntu 14.04 LTS. It really does have what it takes to challenge Windows, especially anything older than Windows 8.

I upgraded my Samsung R580 notebook that had been running 13.10 to 14.04 without any incident. When it finished it came up with all my settings intact and everything functioned exactly as it did before the upgrade. I was quite impressed, since I haven’t had any major Linux upgrade that successful, and I’ve been a user of Linux since the very early days of S.u.S.E., when it was sold and shipped from Germany.

I’ve installed and upgraded it on both hardware and virtual machines, and it’s only on virtual machines that Ubuntu stumbles, and not because of Ubuntu. Ubuntu, as well as Fedora 19 and 20, and any distribution that uses a Linux kernel 3.13 or later, will not allow VMware Tools (from VMware 6.0.1) to install cleanly. Specifically the filesystem sharing driver, allowing a VM client to share a Window’s folder, fails to build due to arbitrary changes in how certain group and user permission data types are represented in the kernel vs how they’re represented around the rest of userspace. Normally, with my other VMs, I share common data via that shared folder, which makes development and testing across a heterogeneous environment rather easy. Failure to share and work well together is not a Good Thing. The only saving grace (or graces) are these: I can drag and drop bidirectionally between 14.10 and Windows 8.1. It’s slower, and I have duplication of files which I have to remove when I’m done, but it’s what I have to do for the time being. And because it works so well and looks so good I’m willing to put up with it until VMware pushes out an update adding support for this latest kernel.

The system does look really good. It’s a handsome looking environment. Ubuntu 14.04 shows even more subtle visual refinements over 13.10, and I was (and still am) very happy with Ubuntu 13.10. In spite of running into the folder sharing issue, installing a bog-standard new Ubuntu 14.04 virtual machine took all of ten minutes from start to finish. Yes, I dinked around with the background, but really, if you want something that you can load and go with RIGHT NOW, you can’t beat Ubuntu at this point in time. I have come to enjoy working with Unity. I’ve had my mixed reactions to Unity along with everybody else, but after 12.04 was released all those issues were addressed and I never looked back. What has made Unity the #1 desktop choice for me is the final tweak of allowing me to put the application menus back on each application, instead of leaving them at the top left corner of the desktop control bar, à la Mac OS X. The solution of having application window menus in-line with the window top is a reasonable and clean compromise. Windows 7 and 8 have tried to tackle the waste of screen real estate with the ribbon task bar (see Windows file explorer, for example), to the complaints of many. I actually liked that idea, but then I liked the original Metro look and I like Unity, so I guess there’s no accounting for taste. This last screen shot is my farewell to Ubuntu 13.10. It’s running Java 8 update 5 and  the JavaFX demo Ensemble. It’s interesting in that IMHO the JavaFX demos run better on Ubuntu 13.10 and 14.04 than they currently do on Windows 8.1 update 1. This leads me to my final prediction: my next notebook, the one I buy after my Samsung Series 7 Chronus running Windows 8.1 update 1, will be a notebook running Ubuntu 14.04 LTS. Yes, Ubuntu’s that good. Update Some folks have asked about Ubuntu vs Arch Linux for Arm. They’re wondering if Ubuntu can be installed on the Raspberry Pi instead of Arch Linux Arm. The answer was “NO.” The last version that was installed on the R-Pi was Ubuntu 9.06 cross-compiled to run on the ARM V6 architecture of the R-Pi. After that release (starting with 10.04) Ubuntu was optimized to run on more advanced ARM architectures. The 14.04 release is optimized to support 64-bit ARM V8, such as the ARM Cortex A57 used in AMD’s Opteron A1100 processor. I’ve modified my declaratory statement above with one world; personal. Personal is primarily my notebooks and desktop systems running with Intel processors. That may change to include tablets running more capable ARM processors, but only if you want a complete end-to-end solution. For R-Pi work I still recommend and support Arch Linux Arm. The Arch ARM distribution is highly granular, more easily granular, and works quite well on the Raspberry Pi as they’re currently shipping. Even if there was a Raspberry Pi that was released with a 64-bit processor, I’d still stick with Arch Linux ARM if for no other reason than the body of experience and good will I’ve built up with this distribution on the Raspberry Pi. I’d be a fool to abandon that.

Update 13 May 2015

I have upgraded to Ubuntu 14.10 (see October) and now Ubuntu 15.04. Still feel the same way about Ubuntu. The fact that a five year old Samsung notebook is running the current Ubuntu release without issues is amazing. This notebook originally came installed with Vista, then was upgraded to Windows 7. It reached a point where Windows 7 was very unstable, which is why I switched to Linux, Ubuntu 13.10 specifically, December 2013 (read here).

Trust me. It’s all still very, very good. In spite of its noisy and noisome critics.