The Power of Raspberry Pi–the new resurrection

beryl and RPI On Lap Monitor
For background and to start this story at the beginning, go to this post. To go to the previous post in this series, go here. The Raspberry Pi (RPI) on Schooner Mahdee has continued to work well in its primary task–weather and boat data logging to hard drive and serving and displaying that data plus tides and currents as well as performing alarms for anchor position and wind speeds.

The RPI was clearly not good at interactive GUI applications except simple email and very basic web surfing. It was also not working satisfactorily as an Internet gateway and a Wifi access point. The harder we pushed the RPI, the more often it crashed and shutdown. Then the RPI-2 was released with 4-CPU cores and 1G RAM–four times the cores and twice the memory of the RPI–and I thought maybe now I can get everything I want.

The new RPI-2 is designed to use a more advanced ARM architecture which meant that a standard Linux distribution could be used rather than the Raspbian distribution required for the RPI. I like Debian, so I installed Jessie on our new RPI-2. The RPI-2 has a different setup of IO-ports so our woody Ti-Bow case was not usable. That gave me an excuse to keep the RPI in its case and temporarily mount the RPI-2 next to it without a case.

During the extended transition of applications and functionality from the RPI to the RPI-2, I connected the two together with a simple Ethernet cable–no hub needed. The 50W regulated 5V DC power supply we have on Mahdee has more than enough capacity to run both Pi’s, the HDMI monitor, Passport hard drive, along with various other USB accessories and device charging requirements. I describe installing Debian Jessie and setting up the RPI-2 to run the chart plotter OpenCPN here. That article also includes a link to download an installable copy of OpenCPN that I created.

Because we are sometimes without any Internet access, I try to anticipate and install applications before they are needed and while we have good Internet access. Whereas the RPI is well equipped with a 16G SD card, the Sandisk Extreme SD card we purchased for the RPI-2 has a capacity of 64G. More than 6000 packages are now installed on the RPI-2 using over 80 percent of those 64G. SD storage is primarily programs and their documentation because most data is saved on the external Passport USB hard drive. So we have lots and lots of programs. More programs than may ever be used.

There is some stuff (actually a lot) on the SD card that really isn’t needed there. Given our experience driving an SD card to its premature death by writing gigs and gigs of weather data to it, we are sensitive to this. Further, an SD Card with more free space will distribute writes so as to extend its life; a nearly full SD Card can not do this and is more likely to fail prematurely. Since the Passport USB hard drive is always connected (using an entry in /etc/fstab), we can move a few things there. My criteria is to only move things that are not needed to boot the RPI-2 and preferably things that have lots of writes; mostly static files that are primarily read can be left on the SD Card.

I create a directory on the Passport drive such as rpi2_rootdir and in that directory, I create the subdirectory rpi2_rootdir/var/cache. Then I move /var/cache/apt into that subdirectory and create a link to the new location in its place. The only time I really need the apt cache is when updating and upgrading and that subdirectory ends up with lots of data and writes that I would rather have on the Passport. Another file with lots of activity is /var/swap which is used by the package dphys-swap. That file is a swap file for when memory is scarce and therefore (unfortunately) can be heavily used in my setup. One can also move the /var/log directory to the Passport once everything is stable. Further, I create a subdirectory in my user home directory which links to a directory on the Passport drive and I use that directory (on the Passport) for most of my user data–e.g. my email folder, downloads folder, music folder, application data, etc.. With those changes, my usage of the SD card is now less than 50 percent–including a complete copy of NOAA charts on the SD Card as a backup.

After email (using Mutt) and general writing using VI/VIM, my most used interactive application is a web browser. In the original RPI, I often tried to use Midori, but it’s development fell behind and it failed to render a lot of sites. Net Surf and some other light browsers don’t work well for me. The new official light browser for the Pi is the Epiphany Browser. I have not been impressed by that browser either. Google Chrome is not available from the Debian ARM repository and I have not found an easy way to get it. My favorite browser, therefore, is Iceweasel (the Debian fork of Firefox). I install the Vimperator add-on which makes the browser usable without a mouse–you just need the keyboard–and then my web browser works much like my VI editor which provides a user interface consistency that is very nice. But, Iceweasel/Firefox is a resource hog! Fortunately, there are several configuration changes that can greatly improve the usability of Iceweasel/Firefox on a resource-limited device like the RPI or RPI-2. I use the modifications described here. Also, I add the following line to my .profile:

export set MOZ_DISABLE_IMAGE_OPTIMIZE=1

Before these changes, Iceweasel would slow down the RPI-2 the more it was used until the RPI-2 was virtually unresponsive. With the changes the RPI-2 works great with Iceweasel. I do try to limit the number of open tabs in Iceweasel, but I currently have 25 tabs, along with about a dozen terminal windows, my QT Weather program, XTide and can even use LibreOffice and have the interface feel responsive! All in all, a very nice computer experience.

The Debian Jessie install went great and the only real hitch for me is not limited to the Raspberry Pi. Jessie uses the new SystemD and that breaks a lot of UDev scripts I wrote to automatically start services such as the Weather data logger when the Airmar USB cord is plugged in, and the GPS position and time servers when the USB puck is plugged in, and the Internet gateway when the Palm is tethered. Jessie has packaged some automatic scripts which work with common new devices, but not our GPS, Palm, or Airmar. For the Airmar, it turns out that my automatic testing and recovery scripts will get the data logging started. The problems with my other old devices may not affect those with newer devices, but my solution for them will be covered in the next post along with some new stuff.

Next In Line…Mote

So I thought Buttercup only had the car Wesley and the boat Mahdee as main competition for things that “we-must-pay-attention-to-and-fix.”  Wrong, bring Mote, the Shuttle computer we purchased in February, into the picture.  Yesterday, the solid state drive (of course the one that we use for the main OS, VMWare, all the installed programs, and anything else of importance) decided it had seen enough action and wasn’t going to take our abuse any longer.  So, that brought both David’s and my work to a halt.  We both use the computer at the same time.  Here’s a link to the discussions about our shared computer on our other blog.  I suppose the important background discussion is this one.  We do have the computer on 24/7 and it is hard at work running programs even when we’re not–so it is not surprising that maybe something gave way.

Last night David worked into the wee hours to get the computer back up and running using the data hard drive while I investigated BIOS updates that might be needed and whether that was the problem.  Today, we went over to our favorite computer store to pick up a USB-to-SATA Hard Drive Adapter so we can test the 2.5″ 128 GB Crucial solid state drive on another computer (the laptop) or via another path on Mote.  I’m hopeful that it is simply the (still under warranty) hard drive or the 2.5″ to 3.5″ adaptor we use–I’d hate to think it’s the SATA hard drive controller.  Though the motherboard and computer are also still under warranty, it would be a big hassle to deal with replacing Mote.

Today, for David, is surprisingly consumed with getting the mirror of the solid state drive (with all our databases and programs) up and running on the larger 2TB “data” drive in the computer.  So–no pictures of Buttercup fuel lines yet.  I suspect that will be delayed until the weekend.

Thor Lab Snacks

OK, over the years we’ve ordered a lot of things from Thorlabs because they are incredibly reliable, quick to ship, and they’ve just got all the right optical “stuff” that we seem to need for putting together a quick prototype.

Now for the “real” reason we order things from them–it’s the lab snacks. Sure, there’s nothing like getting a package with lenses, filters, and cool opto-mechanical components that would have taken ages to fabricate ourselves. But the really good part is seeing what’s in the lab snack box!

happy guy
A Happy David With All His Thor Lab Toys…and Snacks

the snacks
That Little Box is Full of Goodies

work
And So Work Can Continue On…

Google Analytics Alternative