Category Archives: Raspberry Pi

Raspberry Pi – Chromium browser

Apparently Chrome is based on an open-source package called Chromium, and there is a Chromium browser for the R-Pi!

Install it with “sudo apt-get install chromium-browser“.

It has all the familiar features like the Extension “Switch to New Tab” — Amazing.

Here is a screen-shot of the R-Pi showing Chromium expanded with a few Cntrl/+  keys:

Chromium on R-Pi showing zoomed webpage

So, we now have a decent browser to use. Dillo was very basic. Midori was slightly better. But Chromium wins!

Advertisements

Raspberry Pi – The Pi has arrived

My very own Raspberry Pi arrived in the letterbox this morning.

The little delivery glitch (delivering and charging for two clear enclosures instead of one clear enclosure plus one Raspberry Pi) was generously fixed at no extra cost by the busy sales-people at Element14. Many thanks, Alice W.

Everything works perfectly, including the LAN which is vital for internet access (for both program updates and time and date).

Here is a snapshot showing the LAN working (IP address 192.168.137.120) and the date not showing January 1st, 1970:

Eth0 plus time and date

Raspberry Pi – Customising the desktop

When using the standard SD card OS as supplied for the Raspberry Pi, the desktop program provided is LXDE (Lightweight X11 Desktop Environment). It is similar to Windows XP or 7, but lacks a few controls. For example, it is very difficult to reposition the icons. There doesn’t seem to be any “snap-to-grid” for all of them at once. Right-clicking each icon does show a “Snap to Grid” item, but this will just as likely put it on top of another one nearby! So we have to move all the icons away, leaving a clear patch, then drag each one back roughly where we want it to be and hope “Snap to Grid” works properly. What were the designers thinking? Talk about primitive!

And did I mention that a small drag and drop distance causes an error? What? So you can’t juggle icons to any exact location either:

Small-Icon-Movement

The other bugbear is the double-click speed. I could find no way to adjust that. To get to the mouse control: LXDE button (at bottom left of screen) | Preferences | Keyboard and Mouse | Mouse:

Mouse preferences

All this shows is the acceleration and sensitivity. No double-click time. It is set very fast (probably .1 seconds or less). I’d like it to be set to maybe .25 seconds to save on finger-tendon damage with repetitive use.

THE SOLUTION:

Change over entirely to single-click mode,which I have used on Windows for years, and love it.

Hit the LXDE button | Accessories | File Manager | Edit | Preferences (not long to go, now) | General | Open files with single click.

Single click

Success! Amazingly, this also works for the desktop icons. [ They are, of course, just files too ]

Raspberry Pi – Mandelbrot pictures

The Python book I’m using is Teach Yourself Python in 24 Hours, by Ivan Van Laningham. It’s been around since 2000, so it’s quite a standard on the subject. There are many example programs listed in the book, both running from the command-line as well as those using the Tkinter GUI.

Chapter 23 introduces us to the Mandelbrot Set and gives a 708-line Python program to calculate the familiar colourful graphs one sees in high school mathematics.

The partial program is as follows:

#!/usr/bin/python
from Tkinter import *
from Canvas import Line,Rectangle
import sys
import string
from colormap import *
from tkFileDialog import *
class Msize:
     def __init__(self,xr=400,yr=400,xs=-2.0,ys=-1.25,xw=2.6,yw=2.6):
          self.xresolution = xr
          self.yresolution = yr
          self.cxsize = self.xresolution
          self.cysize = self.yresolution
...
     def clacker(self,event=0):
          self.pop.post(event.x_root,event.y_root)
if __name__ == "__main__":
     if len(sys.argv)>1:
          ncolors=string.atoi(sys.argv[1])
     else:
          ncolors=32
     root=Tk()
     mandel=Mandel(ncolors,root)
     mandel.root.mainloop()

To avoid all this manual input, the author has generously published them all on his website:

http://www.pauahtun.org/TYPython

Here is how the program looks on the Raspberry Pi when choosing an area to expand and then after the calculations are finished:

Choosing an area

After the calculations

As you can see by the glyphs on the program window, the book’s author is a keen student of Mayan history and archeology.

“A thousand years ago, the Mayans who built a great civilization in the jungles of Central America believed that mistakes in calendrical calculations were the fault not of the scribes or the astronomers, but were the result of direct intervention by the gods.  I believe this too.  If you find any errors in this book, please notify gods A through Z of the Mayan pantheon.  Visit them at The Mayan Gods, or report to them directly at http://www.pauahtun.org/cgi-bin/tothegods.py.”

Here are some of the other beautiful Mandelbrot pictures produced on the Raspberry Pi:

Raspberry Pi – Reading up on Python

Still waiting for my actual Raspberry Pi, so I’m reading up on Python in the meantime (Teach Yourself Python in 24 Hours).

The other day, a friend generously loaned me his Pi to check out. On the first boot, all went well until it started searching for the LAN connection. I let it finish the very slow boot, and then shut down again.

I connected the LAN cable and rebooted. This time it got itself an IP address and could access the internet. Woohoo!

I wanted to take a screenshot, but when I hit the PrintScreen key, it said I didn’t have gnome-screenshot installed.

A quick install: “sudo apt-get install gnome-screenshot“.

The following screenshot shows part of the installation of this program in the xterm window. The browser, NetSurf, is also shown in the foreground.

1st Raspberry Pi screenshot

The second screenshot shows some Python code being run, displaying 800 digits of pi. Note the curious early occurrence of “999999” in this number.

2nd Raspberry Pi screenshot