Saturday, March 7, 2009

Acerhk, Ubuntu, and acerhkgui


In my previous blog, I posted about my experiences with programming. In this post I'll post a bit more about my experience and motivation to program. For those readers -- and I hope there are readers -- that may be interested in only a portion of this post, the sections in order of presentation are:
  • Ubuntu
  • Python
  • Acer Hot Key (acerhk) and AcerHK GUI (acerhkgui)
Ubuntu:
Ubuntu has been my number one choice for Linux distribution for quite some time. In my next post, I will post with regard to why I choose Linux and why I finally settled on Ubuntu Linux as my choice for a distribution. For the purpose of this post, discussion of Ubuntu is limited to how it has motivated me to dip my toes back into programming.

Ubuntu is a great distribution and is increasingly becoming the face of Linux for the masses. It has had the distinct advantage of having a benefactor, Mark Shuttleworth, who believes in the value of benefits from Open Source Software (OSS). While I could blog on and on about who he is and what he has done, I am posting a link to a interview with Mark Shuttleworth from a few years ago, so when you hear "Ubunut is 2 years old" in the video, it is now several years on and not even the Ubuntu I remember.

A huge criticism of Linux in general is that it is "too hard" for the average user. That Linux still requires the user to drop to the command prompt --the black screen with white letters where you have to remember what to type, get your spelling correct, and control variations of what happens with additional input on the same line and possibly never see a graphic result of what you have done. The abstract nature of this is frightening for many people. For other people, they just aren't interested in that aspect of a computer -- "Hey, just show me where to point and click." Well, I am not frightened of the command prompt and have no problem diving in to that. I do, however, tend to agree that if the system requires certain tasks to be performed from the command prompt, it is still not ripe for the masses. Well, for the vast, vast, majority of tasks in Ubuntu, the command prompt never has to be seen. Mater of fact, it is typically the "early power user" and not the common user that finds they need to drop to the command prompt and are lost. I say this because the average user will be able to install and start Ubuntu and do all of their ordinary tasks and programs from the GUI and require no complex configuration at the command prompt level. But, if you find yourself there, don't worry, it isn't that difficult and you can find information and help in the Ubuntu Forums as well as other places. I recommend the Ubuntu Forums because of the friendliness of the users and the vast amounts of knowledge able to be obtained from there.

The term Power User is a person who pushes the limits of what they do with a computer because they are always asking "What if... " or "Can I..." or "I'd like to..." or "I bet I can..." For the most part, they are somewhere between a normal user and a system programmer. For me, an early power user is a person who has just started to get off the beaten path of a typical computer user who turns on a computer, runs a few games (possibly), uses a few standard applications, email and internet.

I do agree that for Linux to become mainstream for the average user, the common tasks and configuration options should NOT require going to the command prompt. That is critical because most users don't want to see a command prompt. Early on, I found that I had not choice but to drop to the command prompt if I wanted to address configuration of my computer's hardware and get it working exactly like I wanted to. I really found very little that wasn't working right out of the box, however, not everything did. For example, my initial hardware issues were with my tablet PC screen's digitizer was not recognized and that my bluetooth was not active. No, I didn't have a problem with my network card being recognized (wireless or wired).

Still, thinking where linux has come from and where it has gone on its own and without a large corporate backing. No doubt, Linux can hold its own with any of todays operating systems. People, however, feel that they because it is unfamiliar for them, it doesn't work. It does.

So, anyway, my bluetooth hardware was not comming on by default and my buttons didn't work to activate the hardware. Through internet search, I found out that if I issued a command from the command line to the acerhk driver, I could turn on the device. So I installed the device driver through the repository and then from the command line, I issued the following command:

echo "on" > /proc/driver/acerhk/blueled

That was just too much for me and I never seamed to remember it when I wanted to turn my device on. This is the type of issue that still needs to be refined in Linux; however, the vast majority of people would not have this issue.

Python
This is where Python came in. During my readings, I discovered that Python was quite a powerful programming language that was primely suited for developing Graphical User Interfaces to interact with command line programs. Basically, it serves as a shell to the command line interface. I also liked that the programming language was cross platform and widely accepted for use on Windows, Linux, Mac and others. I'll go into my discussion of cross platform in a future blog.

Anyway, Python caught my attention for the first language I really wanted to learn. So, I began to learn with a purpose of creating those GUI interfaces between users and the command line and to reduce the need to work from the command line. Goal... to help bridge the gap between Linux today and a widely accepted and used Linux.

AcerHK and AcerHK GUI (acerhk / acerhkgui)
Acer laptop computes came with hardware that was software controlled. The issue with Linux was that Acer didn't release software for the Linux platform. Frankly, I am not even sure if they offered specifications of the hardware... but anyway. AcerHK was written to enable the Linux platform to utilize the Acer hardware.

As I mentioned before, to be able to turn the hardware on and off, it requried a command line input to the driver. This isn't alltogether bad, as it can be setup once in the load scripts to always turn on the hardware; however, for me I feel that isn't the best solution given the amount of air travel these days and a need to activate / deactivate radios. Also, I don't always use my bluetooth, so I don't like the blue LED flashing at me all the time... so I turn it off.

There are a couple of links that I would recommend for users of the acer comptuers and who wonder if you are using the driver or if you need the driver. Note that not all Acer computers use the acerhk driver for the hardware. Also note that the acerhk driver does work with other laptops besides the Acer.

Acerhk and Ubuntu Update
RF (Radio) Switch Guide

The RF Swithc Guide provides a list of computer models by vendor and the solution for activating the hardware.

So, as I started learning Python, I learned enough to begin working on my first program. Yes, I know I gave it a very creative name -- "acerhkgui" (Acer Hot Key Graphical User Interface). Enough of showing my Text Colorcreativity. LOL.

The program I wrote is one that can be installed to Ubuntu or any other Linux distribution to provide a simple GUI to interface with the acerhk driver. I have included a screen shot of the program as it looks on my computer.

I have a "road map" for development of the application. Sure, it doesn't have far to go, but I can already see where I can extend the functionality of the GUI as there are a couple of other computers that utilize a very similar interface to the RF hardware.

I have published the software and it is available in Ubuntu / Debian (.deb), ReadHat/Fedora/Other (.rpm) and Generic Linux (.zip) You can access the download for the software from my SourceForge.net site.

I highly recommend that use the .deb or .rpm version if you want a painless installation. The .deb / .rpm file will provide the user with a launcher that is recognized automatically by the GNOME / LXDE / Other desktop environments and available in the menu system.

Also, the driver does not enable the wireless LED automatically. You can read my post on the Ubuntu Forums for details about getting the LED to work for the Wireless. So, where can you get it? Here: AcerHK GUI

Conclusion
Well, Linux is a very good platform for the average user as well as the advanced users. The early power user may be stumped and unless they are willing to dig and learn, they will back out to what they are familiar with. Finally, Ubuntu / Linux provide a motivation to learn and grow. As it has for me, I now have an application that I have written, use daily, and others are using. I released the software a little over a month ago and I already have over 100 downloads. It is fabulous to be able to contribute back to the open source community and bridge the gap between the common user and Linux. Finally, you can contribute by using Linux (in one form or another) because the greater the user base, the more hardware / vendor support there will be and the more users the greater the likelihood that commercial software publishers will produce native software and games for Linux.

Well, back on the road less traveled. :)

Sunday, March 1, 2009

Python - Sliding Around on a Dull Sunday

Well, this is my first actual post. Really had no idea what to call the post, but since I have not really been a blogger before, why not start!

My big news for the day is really a recap of my big news for the last month. Even though I have only scratched the surface, I feel very proud. "What?" you might ask. Well it is programming -- computer programming. Programming is one of those things that I have really wanted to get into for many, many years. I just know I don't have the real talent to make it big in the field. Still, it is one of those things I have wanted to do for some time and something I know that I can do... but I just learn slowly.

So, where did it start. Hmmm... I guess I will begin at the beginning! :) Way back in the early 1980's I got my first computer. Specifically, I believe that was 1982. It was nothing fancy, but it was good for me. It was an Atari 800 maxed out with 48K of ram (16K was standard). Can you believe that? Well, it didn't come with a lot, but it did come with Atari Basic. I know, not a lot to it and hell... it wasn't even Microsoft Basic (LOL). But it was something. Also, as many kids, I was motivated to write games. Guess my thinking was way ahead of the times... and I must say my ability was light years behind my thinking. Nonetheless, I decided to write a program... a very simple game in Basic using very rudamentary graphics. Nothing fancy, but I did it and I was very proud of that little game. I do wish I had it around still, but perhaps it will resurect itself in a different language and perhaps in a bit better form... time will see. I didn't do much else... as I found Atari Writer and I felt so liberated to be able to type papers! We have come so far now days, but as for programming, I did only a few programs. I remember I wrote a random number generator to roll dice for me and produce results that could be used in role-playing. Well, anyway, let me fast forward through time.

I set aside computer programming and didn't really touch it again until around 2001 when I took my first computer class. It was really a very easy class and was hardly any effort on my part. The only thing that took any time was those little programs that we had to write. In 2001, the instructor was using GW Basic. Wow. How behind times can you get? At least those things I had learned with my Atari gave me a let up. Anyway... I would have thought we would be using something different, but it didn't really mater, as I was motivated again and found it interesting nonetheless. In 2002, I became interested in Java. Who wasn't in those days... right? Well, I got a book on Java 1.2 but never really found the time to spend on it as I was working on my Masters Degree in International Relations -- I know, a far cry from computer programming.

Still, I toyed a little with it and always wanted to find the time to do it. I have been through a few tutorials and such and was very happy that it was a cross-platform solution and the tools were free. About the time I was starting to get into Java, I had the need to pop in a live CD for some data recovery and that sparked my mind on Linux. I know.... but at that time, I wasn't about to install LINUX on my machine. I had tried RedHat Linux and while it looked good, I had hardware compatability problems. So, at that point in time, I'd let it save me from a failed hard-drive but I wouldn't rely on it for anything else. I digress... Linux is a topic for another day. Today... it is programming. :)

During the time I was working on my Masters Degree the campus was using a new program in their administration. It was written by some students there and they called it Python. Well, in reality, it was the program name.... and the language name. The program name was short for their project name -- Project Yet To Have One Name. Would you believe I thought that was what Python stood for when I heard of the programming language also... but it isn't.

Well, I got into Linux in 2007 -- full blown and somewhere during that time, I learned of Python and its ease of use while at the same time powerful abilities. During late 2007, I gave up -- temporarily? -- on Java and turned my thoughts to Python. After some reading and a few tuturials in 2008 (I move slow) I finally dove into it in 2009. No, not a New Year's resolution. I just found myself complete with a lot of things and able to focus on doing something with my spare time.

As with anything, what really motivates me to learn is a project. I like to learn by doing and fully believe in task-based learning. I'd gotten at least a little under my belt -- enough to stand on although I didn't fully have my ballance. And in late January, I found a motivational project to work on.

The Project: My computer has bluetooth in it and I knew how to turn it on from the command line interface (CLI) using a complex command that I had to look up periodically. I didn't like that and decided to write a small Graphical User Interface (GUI) for the driver. That was my project and it was one that applied to me and one that others could benefit from.

It started out simple and was just going to be for the bluetooth aspect; however, it now also provides interface for the wireless. Bottom line -- it works. I am proud of it and it is an effective tool for me to learn with. What is more is I have published it and it is available on the internet. In one month, I got almost 90 downloads and only one complaint, which happened to be because he didn't have the driver my program was to interface with... so not my fault. :)

Today, I woke up and decided to make some minor adjustments... before I knew it, I had made more than a few minor adjustments and got it to a point where I felt like doing another minor point release. I am now on version 0.3.

Here is a screen shot of my program and a link to my project page. I'll probably mention it every now and then in my posts, but not as much as I did here. The fact is, programming can be fun if you have a project you are interested in working on. It is as rewarding -- no actually more rewarding -- than making something. Digitally, I can affect many people and my expenditure for each person goes down the more and more people use it. Makes me feel good to produce something that people are using.

So here you go: http://sourceforge.net/projects/acerhkgui/


Alright now.

Thanks for Reading!
Peace Out!