blogs

The frustrations of Linux (UPDATED)

If Linux really wants to see itself installed on the average Joe's home computer, it HAS to be better than it's counter-part, Windows. As an OS (Operating System), it IS -- it's light-years ahead of the Windows architecture, IMHO. However, there is a side to Linux that is SERIOUSLY lacking -- error and system messages -- they SUCK large.

Now, I don't claim to be a super-user, but I do my fair share of computing -- from websites, to blogging, to programming, to just plain old web-surfing -- I've used my fair share of computers, right on up from the TRS-80. Accordingly, I am not in the "{whatever} For Dummies" category either. I'm "above average", as far as the general public would be concerned, simply because of the time I spend on computers. I've seen my share of error messages, let me tell you. So, if I'm complaining about them not being descriptive/helpful, what do you think the general public is seeing?

On to the problem...

Junebug -- USB PIC Laboratory

Well, I thought I'd start an Electronics section on my little blog, for those of you interested in electronics as a hobby, or just wish to read a little about embedded devices, such as the PIC Microcontroller, to gain a little insight as to how they work. So, with the need to start somewhere, let's start off by taking a look at the Junebug -- a USB PIC programmer and debugger (ICD - In Circuit Debugger), from BlueRoomElectronics.com.

 


Click the image for a full size view

 

I've had my Junebug for just over a month now, and I love it. I also have the Inchworm+/Unicorn combo, but the Junebug is far superior, IMO.

Let's check out some of the features of the Junebug;

PICKit 2 Compatible Programmer / Debugger & UART tool
1. USB-B connector, provides power and communication for the Junebug, Tutor & target projects
2. Programmer status Power, Target Power & Busy
3. PIC18F2550 preprogrammed with .hex
4. 18F2550 ICP, expansion & PK2 compatible
5. Tutor mode switch see page 6 for details
6. ICD programming / debugging connector (2x5 type)

Yes, the Junebug is a PICKit 2 Compatible Programmer / ICD and fully supported by the Microchip software. This means that you can use the Junebug anywhere the PICKit 2 is supported, such as MPLAB, MPLAB C18 and the PICKit 2 software.

Not only can you program a wide range of PIC products, you can also use the Junebug as an ICD (In Circuit Debugger). For those of you, like me, that can't afford a hardware simulator, the Junebug is perfect!

Click here for a list of products
that can be programmed/debugged with the Junebug

 

OK, so you can program, and debug your target boards/PICs, what project or board should you build first? Well, why don't you have another look at the Junebug -- it's much more than just "a programmer" -- it's also a complete development board suited for so many projects and applications, well, let's just say it will keep you entertained for many, many hours, without building a single PCB.

Let's check out a few of the features from the TUTOR side of the Junebug;

PIC18F1320 Tutor / Trainer
7. USER I/O connector U5V,RA1,RA2,RA3,RA4,RB1(TX),RB2(RX),GND
8. 38KHz Infrared detector / demodulator enable with DIP switch IR IN
9. Reset or RA5
10. CON4 A3,A4,GND socket designed for iButton® / 1-wire®, and various small parts
11. VR1 & VR2 variable resistors on RA1 & RA3 (DIP switch selectable)
12. Six multiplexed LEDs
13. Pushbuttons on RB0, RB2 & RB5
14. PIC18F1320 for user programs and software development
15. CON5 designed for buzzers, servo motors, PWM and general I/O

Yeah, I'd say that's enough to keep you busy! Start with the LED's -- learn how to light them up -- flash them in patterns, back and forth -- be inventive and experiment. Once the flashing of LED's is understood, add in A/D conversion with the variable resistors (VR1/VR2) and make the patterns change with the pushbuttons.

Still a little too basic for you? How about an IR send/receive device (such as a TV remote)? What about PWM (Pulse Width Modulation) for servos/stepper motors -- want to build a robot? You could add an iButton reader to it and design your own lock. Or maybe use the serial port for communications within a home automation project. The possibilities are only limited by your imagination.

OK, so that's about it for this post -- I hope that I have possibly encouraged you to join the world of embedded devices, get yourself a Junebug and start experimenting! A mind is a terrible thing to waste.

I'll update this post as I add some code here so that you can play with the Junebug Tutor. If you want to check out the Junebug in more detail, or any of Bill's other porducts, shoot over to www.blueroomelectronics.com.

Grandma wins again!

The Ancaster Fair was on this weekend past -- and I am happy to announce that my grandmother won many prizes, yet again, this year! I'm always happy to see this time of year come around -- it's the time when grandma drops off many delicious, homemade pickles, salsa, fruit and preserves. My mouth watered just walking around the fair and snapping pics of all her entries! :)

  
First for cherry pie filling and third for dill pickles!

 

  
Second for applesauce and first for chili sauce!

 

  
Other entries that are winners to me! (Variations of her chili sauce)

 

Way to go, grandma!

Oh Brother!

Just this past Thursday I was waiting on a fax to come through with a BOL (Bill Of Lading) for a package that I needed to get shipped out ASAP. I got a call back from the trucking company dispatcher that she was getting "no" as a reply to their faxes. "No", I asked? "That's what it replies with", she said. Well, I was about 1/2 hour away and was on my way back, so I told her I'd check it out and get back to her.

Upon my arrival to my shop, I looked at the fax machine -- a Brother Intellifax 1820C -- it said "Machine Error - Code 41 -- Unplug machine and call Brother". So, I unplugged the machine and let it sit for about 10 minutes and plugged it back in -- with the same results.

That's when I hit Google up for some answers. A simple search for "Machine Error Code 41" produced all the answers I needed. The error is caused by the printhead -- which is not sensing a quick enough voltage change during it's initialization. A real quick explanation of it is, the machine uses voltage to heat the ink to the proper temperature before/as it is "sprayed" through the ink jets -- if that doesn't happen, the ink doesn't flow properly.

If you do enough reading on the problem, you will quickly find that Brother is completely aware of this problem and has extended their warranty times on the printheads to 24 months without a bill, and 30 months with. The strange part is, Brother didn't improve the printhead (well, not for quite some time after anyway). They produce "crap" printheads (from the mouths of their own techs) that should be fixed, with ALL EXISTING printheads covered under warranty!

How can you have a product that has a known problem, yet you decline warranty on the item because of a date issue? Arrggggg! It is my opinion that if a company is aware of the problem, then they should warranty the product -- period. I'm not asking for a recall of all products, as most of the products may never fail -- but those that do should be covered -- period. But that's just me.

So, I'm reading that the printheads are about $30 (this was from posts in 2005 and in USD, so I'm not sure what they are now) + labour to install, and I'm soon in need of ink, I decided that the money to fix and reink was not worth the effort.

So, knowing I need my fax working tomorrow, I went looking. Here's a couple of tips for you; 1) Best Buy doesn't carry JUST fax machines -- you have to buy an "All-In-One" and 2) Wall-Mart -- no fax machines either. Just trying to save you some time! :)

I ended up picking up an HP 1040 Plain Paper Inkjet Fax for $109 at Staples. Well, at least it has a much better review!

So far, so good -- I've run some copies through it, and a couple of test faxes and it looks good. For what I need the machine to do, it's perfect. It's your basic fax machine, without all the bells and whistles, but still has enough features to give you a very good bang for your dollar. Now, we'll have to see how we do with ink consumption! It comes with a 14ml cartridge, while the replacements are 28ml.

Which brings me to my final point -- extended warranty. I say to the salesman - because I know you have to ask me three times if I want extended warrnty -- no, no and no. The machine costs $109 -- I might buy 1, maybe two cartridges for it and, a year from now, probably find something else on sale for $79 with ink included. If it weren't for the 14ml cartridges to start, they'd almost be disposable machines.

Actually, I guess my final, final point would be -- the reviews say "don't buy Brother", "stay away", "bad product", "evil" and all kinds of nasty other stuff -- although I didn't buy Brother (simply because I don't believe they have fixed the problem from what I have been reading), I really have no complaints -- the machine worked out to something like $5.25 per month that I owned it (ink is another story, but I have to buy ink for the new one too) -- it did it's job.

At the race track

I went to the races last weekend to watch a friend of mine, Sean, race. I enjoy the races and haven't been in a while, so I thought it would be fun -- especially since I knew someone racing.

To make a long story short, I didn't get to see too much of Sean as he had some "technical difficulties" with his transmission and had to be pushed off the track after a half lap. Bummer. Actually, to be quite honest, this happened August 4th.

  

 

The good news? Sean works at a Transmission shop! The bad news? The transmission is from a 1971 Ford Pinto and they don't have parts to fix it! Double bummer.

Of course, when stuff like this happens, I seem to be the one my friends bring their stuff to when it needs fixing. Ah, but I enjoy a challenge! :)

The problem was that the transmission got stuck between gears, first and second, and was jammed. Good thing it was in neutral so it could be pushed off the track of he'd have been in some real trouble!

Below is a shot of the completed repair. I've got to get my butt in gear for work this morning. As the repair will take a little explaining, I will get the rest of the pics together and post the repair, in detail, when I get home tonight. (Oh, the part I made is the aluminum housing for the shifter -- but I'll detail that later.)

 

 

UPDATE (08.26.07) - Well, I'm just got back from a great weekend -- a buddy of mine had his annual pig roast (but I'll leave that for another post) -- so I thought I'd get the rest of those pics up regarding Sean's tranny.

85 Chevy P/U - frame strip down and paint

This post highlights the rebuild process of the old 305 in my 1985 Chevy Short-Box, Step-Side Restoration Project.

I'm finally getting some pics taken of my progress (which has been relatively slow as I simply have a ton on the go this summer). This weekend past I finished up the frame restoration. Basically, it involved grinding down, spot blasting, cutting out, repairing and painting of the frame. It's actually done, but I haven't taken pics of the painted frame yet. Here's what I do have;

  

A bad portion of the frame needed to be repaired. Here, I've ground off the original rivets used to secure the leaf spring supports to the frame -- and pounded them through to remove the supports. The bad section was then cut out with a small cut off wheel in an air grinder.

 

  

After welding in the new piece of steel, the welds were ground down to produce a smooth, finished surface (well, better than the rest of the frame anyway!).

 

The leaf spring supports were then reattached with grade 8 hardware. The key to this was marking the location of the support on the frame before removing it. Of course, I had to do this on the top of the frame as I was cutting out most of the side. I would imagine you'd track poorly if you were to be off much here, which would cause excessive tire wear, among a host of other problems, such as handling.

 


Last, the frame was ground down with an angle grinder and stone, then with a wire cup brush to remove as much rust as possible. (Yeah, the underside was fun.)

I'll have to take a few more pics and get them posted -- I'll update this as soon as I do.

What is it you want to know?

To my most recent guest, "Chicken Sh*t" (from the Ottawa, ON area -- you know who you are).....

So, ya decided to Google me, did ya? Heck, what do you want to know? I've never made any attempt to hide my identity (I did note that YOU posted here anonymously though).

I'll help you out a bit;

1) the 7/8 year old you find in the White/Yellow belt Karate tournament in BC -- not me (but my parents live about 20 miles from there, how weird is that?)

2) the address/business you find in Florida -- no longer at that address either (phone numbers are bad too)

3) the 'quote' you find as being credited to me (some guy uses it on eBay) -- not mine, but I have used it as I do like it (are you the one?)

4) thesafeguys.com -- yep, my site -- I am a Certified Master Safecracker

5) internet-locksmith.com -- nope, no longer mine -- and hence your "thief" comments, but we'll get to that in a minute

6) the stuff you find from dragonflycms.com, myndworx.com, xtremethemes.com and other such places -- yeah, I like to dabble in PHP programming every now and then

7) the reference to being a "Clearstar member from outside the USA" -- no longer a member (hey, I've got my own sites!) -- Wow! That was a while ago... still a Certified Journeyman Safecracker!

8) FireKing University and MBA references -- just some of the places I've been trained at

OK, so I just got home from work -- I'm hungry, and my dinner is far more important than replying to some guy (girl, kid -- whoever you happen to be) Googling me, quoting things they find in an attempt to make me look bad. I have simply 'unpublished' your comments for now, but will be more than happy to repost them here (in the proper place mind you, not thoughtlessly placed amidst a thread that has nothing to do with your comments) and will do so later this evening.

Stay tuned! (UPDATED -- read more -- this is VERY LONG, be forwarned!)

Out with the old, in with the new

Well, it's that time again -- time to upgrade the service vehicle. For those of you that have read some of my posts regarding my '03 Blazer, you'll know why I'm happy to get a new vehicle -- a 2007 Dodge Nitro.

I was going to say that I was happy to get rid of my Blazer, but that just didn't happen. You see, I put on a lot of kilometers with my job -- about 60K a year. So, my Blazer, after 3 years, had just over 180K -- which made it 'undesirable' by the dealership. They offered me $4,500 for a vehicle that I paid $30K for three years prior -- I'll keep it, thanks.

Again, for those of you that have been following my 85 Short-Box, Step-Side Restoration project -- you may have noticed that I also had an '86 that my dad drove. I sold the '86 yesterday and my dad moved into the Blazer. Hey, I still have the '85 to work on! (Which should be soon... damn, I wish it would warm up!)

The way I look at it is, my dad does very little driving -- pretty much city only. So, the Blazer will give him a little more comfort than the PU, not too mention the safety aspects of it. Plus, in two years, the vehicle will be worth the same as it is now simply because the kilometers will be allowed to 'catch up'. If he puts on 10K in the next two years, I'll be surprised. The goal is to keep in under 200K.

(As a side note, I still have to post about most of the problems I've had with my Blazer... just to keep you from going through the same thing.)

The FizzBuzz Test

I was stunned when I read that 199 out of 200 programmers can't program -- and I'm not speaking figuratively -- they can't write a single line of code.

This fact intrigued me, so I Google for more information on it. That is when I ran into the FizzBuzz Test. Basically, the test is as follows;

Write a program that prints the numbers from 1 to 100. But for multiples of three print "Fizz" instead of the number and for the multiples of five print "Buzz". For numbers which are multiples of both three and five print "FizzBuzz".

Here's mine, in PHP;

FizzBuzz();

function FizzBuzz()
{
for ($i = 1; $i <= 100; $i++)
{
$out = (($i % 3 == 0) && ($i % 5 == 0)) ? "FizzBuzz" : (($i % 3 == 0) ? "Fizz" : (($i % 5 == 0) ? "Buzz" : $i));

if ($i == 1)
{
echo '[a href="http://kylestubbins.com/node" alt="Return to KyleStubbins.com home" title="Return to KyleStubbins.com home"]KyleStubbins.com[/a][br /][br /]';
echo '[b]Fizz[/b] is divisible by 3[br /][b]Buzz[/b] is divisible by 5[br /][b]FizzBuzz[/b] is divisible by 3 AND 5[br /][br /]';
echo "Let's Begin![br /][br /]";
}

echo $out.'[br /]';
}
echo '[br /][br /]All Done![br /][br /]';
echo '[a href="http://kylestubbins.com/node" alt="Return to KyleStubbins.com home" title="Return to KyleStubbins.com home"]KyleStubbins.com[/a][br /][br /]';
}

Note: I have changed all < > brackets to [ ] bbcode style simply so they wouldn't parse in this post! Sorry, but the formatting won't hold for the post either! This really could be cut down to a couple of lines -- all of the "extra" stuff is to display the start and end, and to add a link to get you back here, but is not needed for the actual "test".

You can see the results here. Feel free to post yours! :)

The power of Linux

I have been an Ubuntu Desktop user for almost two months now, so let me update you a bit.

About a week ago, I made a HUGE mistake when running the command line as root (I can just imagine some of you grinning already). No, I was not using the rm command! That has to be the first line in every Linux book you read -- WARNING!!! Then an example of wiping out your system with the rm command.

The 'mistake' I made, was not actually done on purpose -- it was kind of a 'wrong place, wrong time' thing -- let me explain. I was in the middle of copying some files to a new, shared directory that I setup to share with my LAN. This is when I had to 'chown' (CHange OWNership) the copied files -- I started to type the command

sudo chown -R langroup:langroup /

when I was interrupted. Can you see it? The FULL command was going to be

sudo chown -R langroup:langroup /home/lan-shared

as I only wanted to change the ownership on that directory and it's recursive directories (hence the -R option). But I turned around, after my interruption, and hit the enter key without completing the command.

I still wasn't aware of what I did -- it took about 4 or 5 seconds before I looked at the screen and saw it. Then, I realized what I had done! I had, inadvertently, issued a command, as root (sudo) to change the ownership (chown) of directories and files, recursively (-R), to the 'langroup' user and group (langroup:langroup), starting from the ROOT directory (/). Obviously, this is NOT what I wanted. :(

I quickly escaped the command (Ctrl-c), but it was waaaaay too late. Almost every directory and file on my system was now owned by 'langroup' -- you can only imagine the havoc that wreaked.

It took quite a long time to get sorted out -- I actually gave up on trying to save the system, but I wanted my files! The short and sweet of the recovery process was to boot the LiveCD in another machine and look at the directory structure and, more importantly, the ownership of the directories/files. From there, boot the machine I was having problems with from the LiveCD and get into recovery mode (ie. the command line -- or 'shell'). There you are root and can start changing ownership to what they should be -- therein lies the time. Oh, my goal was simply to get network connectivity back so I could transfer my files. Or even get my CD writer back! Something to allow me to get my files. I ended up achieving network connectivity and was able to get my files.

I will now offer you a tip that would have saved my bacon, had I known it at the time. When installing Linux (any flavor) set yourself up a separate partition for your /home directory. Why? Simply because if you set it up in that manner, you save all your files to a separate partition on your hard drive. In the event of a serious problem, such as I have outlined above, you can simply reinstall the OS without touching (ie. without formatting) the /home partition. As an added bonus, you can install a newer version of the OS (say, for example, when Ubuntu Fiesty 7.x is released) as a clean install, and not an upgrade, if you so desire. The structure would be like so (keep in mind, this is for a single boot, Linux only machine -- do a Google search if you need dual boot instructions);

Example -- you have an 80G drive.

/ (root) ext3 -- 10G
/home ext3 -- 69G
/swap linux-swap -- 1G

10G is plenty for the OS, and the 1G swap can be altered to your needs (depending on the amount of memory you have, etc.), but is a good base. Assign the majority of your drive to your home directory, as this is where the majority of files will be stored. Now, if you ever have to reinstall, you can choose NOT to format the /home partition and your data will be intact upon completion of the install.

This problem actually worked out better for me, in the long run -- here's why;

I initially installed Ubuntu on a P3 machine, and not one of my better ones, simply because I was testing the OS and didn't know if I'd like it, or stick with it. I quickly found that I did like it, used it the most, and wished I had put it on a better machine. Part two of that is that I also wanted to install Beryl (a Linux Theme Manager -- all kinds of cool stuff that'll give any Vista user a run for their money!), but it just didn't like the older hardware (especially the ATI video card!) and wouldn't run.

Well, seeing that I now had to reinstall Ubuntu, now was the perfect time! Instead of reinstalling Ubuntu on that machine, I threw Window$ XP back on it as I still, unfortunately, need a Windows machine (no, I haven't tried 'Wine'... yet!). From there, I copied all the files over from my current XP machine and then installed Ubuntu on that machine -- a P4 3.2GHz dual core machine with 2G of ram, 2 x 200G SATA drives, yadda, yadda, yadda.

I'm happy to announce that Beryl installed without a hitch -- and man, IS IT SWEET! Do a search for 'Beryl' over at YouTube.com -- there are a bunch of videos there demonstrating Ubuntu & Beryl.

The moral to this post? The 'chown' command can be just as dangerous as the 'rm' command, if you're not careful! ;)

Syndicate content