Monday, September 2, 2013

Raspberry Pi Journal #17

Installing GIMP


Now that I have AbiWord, the next thing I want to have would be a paint program. GIMP fit the bill, so I installed it next:

sudo apt-get install gimp

Easy enough to do. Not a problem.


That's the logo you'll see when you download Gimp. Pretty neat, eh?



Okay. Here's the first problem. I don't know what to do. Sure GIMP is very powerful, but the user interface is kind of cryptic. I'm having trouble doing everything. I did play around with it, but nothing too fancy.



I can't even choose color! How bad is that? Not to mention, I missed my Wacom tablet. Oh, dear. I must rethink this over. I was hoping there'd be an easy integration with AbiWord. If there is, I never did find it.



This is the message that I get when I quit the program. I don't know what happens here, but I don't like it. Oh, well. I guess GIMP and raspberry pi are not compatible with one another. Too bad.



Sunday, September 1, 2013

Cooking Journal #2

Making Popcorn Snack

In the old days, it was rather inconvenient. Nowadays, it's push button easy!

1. Put Popcorn in Microwave
2. Set Correct Setting (Snack/Regular)

Ummmm...that's it.

Insert Popcorn

Set Setting

Saturday, August 31, 2013

Raspberry Pi Journal #16

Installing Abiword

Leafpad is fine, if what you're doing is some light word-processor, without any fancy things. If you want to have graphics, though, you need something better. There's open office or Libre office. There's also Abiword and Gnumeric. Let's do the easy way first. Install Abiword!

The first thing I check is to see whether or not Abiword is installed:

which abiword

Not installed. Okay, so let's download the package

sudo apt-get install abiword

It'll go through the installation process, and will put a link on the desktop under Office. I decided to type something and add some graphic to it.




As you can see, AbiWord has multiple fonts, and the ability to add graphic. That's not all. It also has various capabilities, such as HTML markings, and epub export. I have book making ambition, remember? So, this capability is a big deal to me.



I don't have a scanner attached to my Raspberry Pi, yet, and there's no instruction on it. So, I don't plan to add some anytime, soon. I'm happy with my current set up of taking pictures with my 3DS and transfer it via SD card. I do batch transfer, though, so it's not like it's an everyday occurrence.



The printer setup is quite flexible. I'm not sure whether to credit AbiWord for it, or maybe CUPS printer driver. There is an option to print 2 or even 4 pages on one page, and it looks to be quite robust, with various options. I'm pretty happy with it.



And there it is, the double page print. It's quite charming to have, and I like it very much! I think AbiWord should be in everyone's toolbox, assuming you're not running it headless. If you install GUI for work, then you should definitely get AbiWord.

By the way, I eventually did installed Open Office, also known as Libre Office.

which libreoffice

Installing it:

  1. sudo apt-get install openoffice.org
  2. sudo apt-get install libreoffice


I always know it by the openoffice moniker, so imagine my surprise when it installed libre office! Ah, the constant march of progress!



Friday, August 30, 2013

Raspberry Pi Journal #15

Changing Desktop Background

I found that the default raspberry pi logo on a white background is too bright for my taste. So, I decide to change it a bit. The background or wallpaper can be easily changed by doing right click on the background itself. A set of menu will come up.

Choose Desktop Preferences. You can load any picture that you have and have it as your wallpaper.

Desktop Grub is darker color, but I've since replaced it with Saber Dollfie.

And if perchance you have a different menu, try this from command line:

pcmanfm --desktop-pref
pcmanfm -w file

Type "man pcmanfm" will tell you all the different options, and I can tell you it works!

And should you want a script to randomly pick a PNG picture to use as wallpaper, I managed to cobble this line:


PIC=$(ls *.png | shuf -n1);pcmanfm -w $PIC

And finally, here is my final script. Notice, I end the script with a specific image.


#!/bin/bash

for ((walltick=100;$walltick;walltick=$walltick-1))
do 
  PIC=$(ls wallpaper/*.jpg | shuf -n1)
  pcmanfm -w $PIC
  sleep 100
done
pcmanfm -w saber.png
sleep 5
exit 0













Thursday, August 29, 2013

Raspberry Pi Journal #14

Adding a Temperature Widget

Go to the bottom bar on the GUI Desktop. Hit the right mouse button, and a menu will pop up. One of the option is Add/Remove panel item. Among them is a Temperature sensor.

Select that to add it to the bar. You can move it up and down for proper placement. The temperature reading is in Celcius, and anything below 70 degree is fine. My usual temperature reading is about 54 degree.

There is an exception. When I was connecting my Kindle to it, it sometimes goes to 84 degree for a second or two. I wonder why? My guess is that there is a voltage drain that somehow causes the calibration to be off. Otherwise, no harm.

Wednesday, August 28, 2013

Raspberry Pi Journal #13

Installing CUPS for Printer


So, I have an old Samsung ML-2525W laser printer laying around. Naturally, since I'm looking for more gadgets to be connected to my Raspberry Pi, it got the job. The first shock of the day is that there is no standard printing spool. It took some digging to come up with lpr, and lp. Both of these program are old. The new one, after much digging, is CUPS (Common Unix Printing System). That one threw me out for a loop, because Apple made it.

Anyway, having CUPS makes life tremendously easy. There is a gotcha with permission, though. Let's go through the process.

The first thing you do is to install CUPS:

sudo apt-get install cups

After some heavy duty downloading, everything is set up. The installation starts cups daemon server automatically. You can check it out by opening your web browser to localhost port 631

http://127.0.0.1:631

If all goes well, you will see the browser showing CUPS Administration page.


Everything is browser-based, so it's really easy. Just add a new printer and you're home free.


You need to login and enter your password. The browser interface allows you to administer the printer completely, including moving printing jobs, or even cancelling them. You don't want just anybody to be able to do so.


Did I say adding a new printer is easy? Well, there's a gotcha. You cannot add a new printer without proper permission. Didn't you just entered your password? Yes, you did. So, what's going on?

This instruction should be with all printer installation instruction, but some missed it. You need to add yourself to printing administration group. Do this:

sudo usermod -aG lpadmin username

where if you're the default user, that should be "pi".




Success! I see my printer name there. After selecting it, would you believe I still have to choose my printer from a long list of names? Anyway, set up your defaults here. I set my page size to "US Letter".

That's it! Do a test print and see if it works! Congratulations, you just added a new printer!

Book Review #2

Programming the Raspberry Pi

Getting Started with Python
Simon Monk


The problem with Getting Started series is the extremely limited amount of information that the author can pack into such a short space. However, I think Simon Monk does an admirable job doing it. The book is divided into two parts. The first part deals with Python as a language and all the idiosyncracies the language has. The second part deals with communicating with various modules available on the market.

I really wish that Simon Monk would write two books: One deals with Python language, and the other deals with hardware projects. As it is, there is quite a bit cut out of the book. There's a lot of dependence upon internet resources. It's not that the information presented is lacking. It's just that it's such a bare bones that you have to read the book extremely carefully, as to not miss anything, or worse, misunderstanding the information presented.

There is an obligatory chapter dealing with installing the program, or in this case, setting up the Raspberry Pi. I wonder if you need that much details, but it's actually a compact form to setting up and installing Raspberry Pi, while still providing more details than what the Foundation provide. This isn't good or bad. It's just a design decision that we should be aware of.

The "do-what-I-do" teaching technique is not what I think a good way to teach. Sure, it will cause the students to get results very quickly, but can they expand the knowledge? Most of the time, they won't. I think it's a pity that the book is so short, because the information is presented rather well. It's just that the real foundation is not explained. Woe befall readers who did not do his homework! 

I'm used to read condensed text, and this text is not the most condensed. However, there is a judgement call here. Do you want to condense the text so much that it takes effort to read, even though there's more material? Or do you want to sacrifice detailed info in an effort to make it readable? I think the author did a great job balancing information and readability. If only more authors write like this, I will be happy!

I was pleasantly surprised to see Hangman game in there. In truth, the game is so easy, it is easily implemented in just about any language in one hour. For some reason, most book authors didn't do that. They simply choose a simplistic (and useless) program to make a point. So, I'm glad to see a good game in here.

I'm not so happy that the function list is rather short. I'd like to see a few pages of it, outlining the most common usage. It's a judgement call, but I'd say I can use a few more convenient functions and their relevant modules in one place.

I'm not too happy about drawing section, either. Perhaps it's just me, but the author never answered the question, "How do you put a dot on screen?" 

As far as I'm concerned, if I can put a dot on screen, I can do anything, albeit slowly. I don't have that information. I do have lines, ellipse, and rectangles. I guess, I can make a 1 pixel rectangle, but then it'll be even slower. I know SDL does allow surface, but I don't see it there. There is a discussion about writing an arcade game, but I think the game falls into the simplistic side, and not the sophisticated side. 

The rest of the short pages deals with hardware. There is a good project selection here, including roving robots. There is enough subject to please most people. This is where I think the format is at fault. I'd like to see more pages on this subject! Thus, I think it would be helpful if the author would write 2 books, instead of one.

All in all, it's a good effort by Simon Monk, marred only by the small number of pages inherent in "Getting Started" series. I can recommend this book to any Raspberry Pi user interested in getting started in Python.