Monday, July 28, 2008

New search engine? Not really ...

When I hear about a new search engine I like to go and check it out to see how good it is. Today there is a new one, CNN had an article called: Ex-Googlers launch rival search engine (oh goody, a new toy to play with). Apparently Anna Patterson knows what she is doing as the last time she created such technology Google bought it. Her company is called CUIL and, using her search engine, I did my usual search for Linux Home Automation oddly enough the first few times the engine failed to find anything. Later it started finding some information but the really odd part: the pictures associated with the sites are not related to the site (???). In fact they look like they're paid ads (a lot of them X10). I found a lot of X10 ad pictures next to my sites (and I'm pretty vocal about X10 being crap, etc.). Hmm, I'm not very happy about this. So anyway, I decided to take it to the next level and do this search: linux home automation or domotics or control, nothing, nada, zilch. Seems it can't handle complex search strings.

My verdict: not very good (D). It looks pretty but the information is not high quality. Instead it seems to find a lot of sites which are copy cat sites (my blog entries showed up under other sites but my blog didn't show up) or only briefly mention Linux. I really feel the pictures associated with the site are dishonest and many are ads. I guess this is their intention, a new way to display ads associated with searches. This search engine seems to be more about ads than search results. For the user the quality of the results, not the ads, are the point of the search. Even Microsoft eventually got that point and removed the first two pages of ads so users could get to the search results material. I don't see this search engine as ever being something I'd use or recommend (not that my opinion matters ;-).

For those wondering why I like using my search string "linux home automation"? Because I use it often enough that I know the trash from the treasures. In fact the search string I really use the most often is "linux home automation or domotics or domotica or control -site:.cn -site:scribd.com -site:experts-exchange.com". I've removed all sites in China because 90% of them are junk sites. The Scribd seemed like 'just another search engine in the results of a search engine' and Experts Exchange requires that sign up to get any of it's information (screw that!). The rest of the string gives me a pretty good view of the world and HA.

Saturday, July 26, 2008

Do we have 802.11n cards and driver for Linux?

So I'm poking around Slashdot (don't we all?). And I read that "Atheros Releases Free Linux Driver For Its 802.11n Devices". Cool, finally I can get 802.11n for my home setup. So I bounce over the link provided Madwifi announcement (the Slashdot comments have the usually, rants, raves, gibberish and a few comments with useful information) and find that they even have a list with cards that are supported by the drivers (though it was the 5003 802.11n chip, not the chips mentioned, odd). Anyway the more important thing is that we now have various 802.11n boards for Linux.

Monday, July 21, 2008

Oops, microdrives ...

When is a microdrive not an IDE/CF compatible card? When it's a Seagate ST1 (5G) with firmware 3.08 or later. Apparently these microdrives are specifically meant for use in MP3 players and some of the stuff like a partition table is not there. :-< So I now have 4 microdrives that can't be used as a hard drive in an embedded system. I guess I should have done a bit more research before I purchased these off EBay. Oh well live and learn.

Bluetooth to replace RS232 cables?

I'm currently taking a class on Wireless protocols, very cool class. I've learned about RFID technology and how it could be the solution to programming a remote by placing the remote on a device and pushing a button. Well it's not that easy for the programmer but it is for the consumer. Of course there's some WiFi which I had more of in another class (I love taking classes where I can use what I learn in real life). But Bluetooth has caught my eye as an interesting protocol for use as a cable replacement technology. What I want is the ability to have one interface on a central HA controller and have it connect to many RS232 devices around the house.

Enter the following products, first the STM4100 Bluetooth to UART module from BTDongles.com. The other is from Sparkfun.com, the Bluetooth DIP Module. Neither of these are cheap but for experimenting they are a very good solution. At the moment I'm not sure how well they would work in a multi-drop environment (one master, many secondaries).

The problem of Linux cross compiled drivers

I managed to get the cm15a driver to load on the ORC but I'm now getting the following:

Jul 20 14:10:14 (none) kernel: usbcore: registered new interface driver cm15a
Jul 20 14:11:20 (none) kernel: usb 1-2: new low speed USB device using ohci_hcd and address 2
Jul 20 14:11:20 (none) kernel: usb 1-2: configuration #1 chosen from 1 choice
Jul 20 14:11:20 (none) kernel: cm15a: probe of 1-2:1.0 failed with error -12
Jul 20 14:11:20 (none) kernel: usb 1-2: device_add(1-2:1.0) --> -12

Error -12 translates into 'Cannot allocate memory'. I'm not sure why it works on servers and desktop machine and not the embedded machine but I'm looking into it. I may have to recompile the entire kernel, busybox and various tools to test this out. Or I could spend $500 on the SDK for the embedded system (not likely). Oh well, more work to do, but this is not a bad thing. :-)

2008/07/22 - Dang just found this post is broken. I'm working on it ...

Friday, July 18, 2008

Toys, toys, toys!

This has been a very good week. First I got over my asthma, last week was lousy for me, I couldn't breath. Then a few books arrive (Java J2SE and J2ME books), then my new reference design (the ORC), then the TI RF MSP430 dev boards, then my new hard drive and today 512M of RAM and 4 - 5G microdrives. I'll use the microdrives (real hard drives) to build my new distributions on as it's less wear and tear on the compact flash. Too bad I'm still catching up on my home work (couldn't work on my homework and I really need to catch up) and finals are coming. This means that I have a lot of new toys calling to me.

Hard Drive upgrade and Gparted

I spent a little time last week working with parted. Parted and Gparted, the GUI driven version of parted, is a partition editor (for creating, destroying, resizing, checking and copying partitions, and the file systems). When I worked with parted last week it was to repartition compact flash images for use on an embedded system. I'm still not clear on how to use the CLI parted for repartitioning but I've had very good luck with gparted. This week it was so I could upgrade my laptop's drive from a 40G drive (25G for Windows, 14G for Ubuntu). Living with the 14G reserved for Linux was getting difficult. I need space for my homework and my home automation development projects. I was actually living with 1 - 1.5G of free space and that gets eaten up very quickly when you start working with compact flash images (128 - 256M). So I sprang for a new drive, a 250G drive (I also have another 512M of RAM on the way). Now that the upgrade went well I can add the Java SDK (J2SE, J2EE and J2ME) along with the custom distribution I'm working on.

The good news is that this wasn't difficult to do. First thing I did was to backup the existing 40G drive (/dev/sda) to an external 40G USB drive (/dev/sdb). I used a bootable CD so there was no access to the hard drives (not mounted and no swap turned on) and to minimize ram usage. Here's the first command I used once I booted from the CD:

 # dd if=/dev/sda of=/dev/sdb bs=32768 

I need the external USB drive because I couldn't hook up both the 40G laptop drive and the 250G laptop drive at the same time (I couldn't find the correct adapters). Next I shutdown, replace the 40G drive with the 250G drive. I then booted back up with the CD and copied the external 40G to the new 250G drive.

 # dd if=/dev/sdb of=/dev/sda bs=32768 

I'd like to point out here that if the external drive had been larger than the original 40G drive I'd now be copying more than 40G worth of data to the new drive though I only needed the 40G of data. You can use the appropriate options to dd to only copy what you need. Once I completed the copy, using dd, I unmounted all the hard drive file systems and removed the external drive. At this point the new drive is bootable but you'll only see the 40G of useable space. The extra 210G is unformatted but I could have formated it as ext3 (my FS of choice) and just mounted it as a new file system. But that's not what I wanted.

So I started up gparted and something mounted the file systems (grrr!), so I manually unmounted them again. I also turned swap off (swapoff). I observed that I had three partitions (kind of). I had the initial 25G - NTFS (Windows), the 14G - Linux root partition and the swap partition (an extended partition). I also had a lot of unformatted space. Since I had the original data backed up on two drives I decided that I was going to remove the extended partition. The swap partition was in the extended partition so I removed it first. I then removed the extended partition, applied every thing (the changes won't take effect until you apply them) and waited. At this point gparted (or something) remounted my partitions and I unmounted them again. I knew they were mounted because new Nautilus sessions would open up (this was very annoying and I think it was Ubuntu doing this). Finally I resized the existing Linux partition leaving 2G (2048) above it for the new swap partition (I have 512M of RAM now but 512M more is on the way). I applied the changes and let it go. After a long while (it was very busy) it completed. I now added the swap to the remaining space and applied it. Once done I exited gparted and rebooted the system. When I rebooted I had a working system and no files appear to be missing. This whole process took several hours (from copying the drives to the final reboot). Over all that wasn't painless (dang remounting file systems, grrr) but it wasn't difficult either. Next task is to move the Fedora serv er over to Centos. That I'm sure will be a major undertaking and work for another day (I have a second computer for that).

Labels: , , ,

Saturday, July 12, 2008

How do you build a bootable compact flash card?

I ran into an interesting problem this week. I recently purchased an ALIX3C2 (Embedded 500 Mhz Geode Motherboard w/ USB, Serial, Mini-PCI) board for use on the OpenRemote HA project. It's not my first embedded Linux system but it's the one where I need come up with instructions for those who are not embedded systems folks. When it arrived I found that I only had 16M, 32M and 2G CF cards in my stock. The embedded system image provided was for a 128M CF card. No problem actually, just dd the image (as per the instructions) to the larger 2G CF card. Sure enough the system booted and I was a happy camper except I'm wasting about 1.7G of compact flash and I needed to add 100M of files to that 128M image. I started to do some research and found that there appears to be nothing on how to build an embedded system (from nothing to a full distribution complete). I did find Building Embedded Linux Systems - 2nd edition, Aug 2008. I won't be able to order it until later so I ordered Building Embedded Linux Systems - 1st edition, 2003 for $10 w/S+H. For $10 bucks I'll chance it. I'm sure I'll learn somethign from it specific to kernel 2.6.

In the mean time I'll detail how I grew my compact flash from the 128M to the 1.9G that I had left on the card on my new web page called LORHA (the Linux OpenRemote/Home Automation distribution). I'll also attempt to lock down how to get grub installed on the flash card. How to build a cross environment, how to build the kernel, modules, libraries and executables needed for buil! ding you r own mini-distribution. The closest thing I've found is Linux From Scratch (the Cross Linux from Scratch is more fitting). I'm currently reading their books (they're online) on how to build your own distribution.

Sunday, July 06, 2008

Please allow me to introduce myself ...

I'm currently involved in a few projects but none so interesting as the OpenRemote project. At the moment I'll keep mum about it as we'd like to get a little more organized before we start bragging about how we're going to conquer the world (I think we will). Needless to say, it's home automation (domotics). :-)

For the benefit of those who will be working with me I'd like to create an informal resume, so they know what my strengths and weaknesses are.

  • Name: Neil Cherry - code monkey, hardware jockey, networking expert, and general computer geek. The reason I say code monkey is that I am not a formal programmer, I took a few courses but have no degree in it and I don't program as a living though I do use programming at work.
  • Personal background:
    • male, mid 40's, married, live in NJ.
    • Started in computers in the late 70's - 110 baud, teletype and modem to a mainframe
    • My first computer is an Atari 800XL w/Omnimon, I still have it.
    • Current OS of choice: Linux (distribution: multiple)
    • Editor of choice: emacs (yes, I'm one of those).
    • Language of choice: C and Perl, though it really I'm more of a 'right tool for the right job' kind of guy.
    • Started home automation with x10 and the Heathkit serial interface (the CP290). I currently have X10, Insteon, Z-Wave, digital, analog, weather stations, cameras and a lot more stuff. My current home automation software of choice is Misterhouse but I'm working on something new.
    • My current employment has me working on Cisco routers with various protocols. I test to make sure the routers/hardware/protocols/applications work properly in the managed services. Often this involves writing Perl scripts to make my tests repeatable. In past 'lives' I've designed router networks (upwards of 500 router networks) for managed service customers, done repair of electronics, written/debug! ged firm ware and applications, and worked with various embedded hardware, software and protocols.
  • Education: EET-AS - 1986, CS-AS, Telecommunication-BS (to be completed in 2009), I am planning on getting a Masters of Science in the near future. I haven't decided what yet. Pretty sure it's going to deal with computers and I hope home automation. On most computer subjects I am self taught. I have quite an extensive library of books. My notes are kept online to make them easier to search.
    • Electrical Engineering Technology - AAS, Middlesex County College 1986.
    • Computer Science Transfer - Middlesex County College, no degree as MCC says that some of my courses are now too old (English, History and Bowling for example). I suppose Napoleon really didn't lose at Waterloo, I guess I'll never know.
    • Telecommunications-BS - In progress (2009), Pace University (expected Fall - 2009).
  • Hardware background:
    • General TTL and analog circuits
    • wire wrap
    • small, one-off custom PCBs
    • some PAL work but not much FPGA
    • Lots of networking (RS232, RS485, current-loop, ethernet and wireless (much of the Ethernet and WiFi off the shelf)).
    • Various processors and micro-controllers
      • 6809 - my favorite processor.
      • 6502, 6800, 68000.
      • 8051 family - easy to use
      • PIC (14 bit family) - I have a love/hate relationship with these. ;-)
      • AVR - really like these micro-controllers
      • MSP430 - love the low power modes
      • EZ430 - Just starting with this.
  • Programming background:
    • I don't do much GUI work
    • Lots of embedded, communications and device drivers
    • Solder, if you don't understand then you probably don't do much hardware. ;-)
    • BASIC - Not Visual BASIC
    • Assembler - for all the above, IBM mainframe, and x86
    • C/C++ (I like object oriented but I don't like C++)
    • Perl
    • Java (apps and applets)
    • Javascript (and HTML and CSS which are not languages or programming)
    • lots of other language I use very little of anymore (PASCAL, LISP, Tcl, shell, DOS bat files, etc. ).
  • Operating systems: well too many so I'm not even going to bother. But I will say that I started using OS-9 (not the Mac stuff) on the 6809 before I started using PC DOS. DOS seemed like a step backwards.

Replacing the wires ...

...well, replacing most of the wires anyway. You can't replace the power wires unless they can make Tesla's work on wireless power very safe. But many of the other wires, like communication wires, are being replaced. Will this bring additional problems? Or will it be the ultimate solution? I don't know, but it's here to stay. Either way I know it will keep me employed. :-)

I've been working with others on a new home automation project called OpenRemote. One thing that's been made very clear is that wireless is a must. It's expensive to run cables and if a cable can be replaced by wireless technology then all the better, but it better be inexpensive.

Sometimes things are easy to do, you can replace 10Mbps Ethernet with WiFi (802.11b or g) or you can replace 100Mbps Ethernet with 802.11n (now, if they would only finalized the standard). To replace cables such as RS232 is a bit more difficult. Sending data at various speeds can be handled by WiFi and a terminal server but at an expense. Terminal servers are not cheap the lowest cost models are around $100 (US). Now, what if you need to toggle the control bits of an RS232 port for something like an IR dongle. Well this get a bit more complex. I am aware of a few ways of doing this but lowering the latency could be very important to doing this properly. Let say you need to turn on and off a bit (that's two commands) such as DTR or CTS really fast to generate the correct IR signal. It might take 50+ ms (about 100 Hz, remember on _|- and off -|_) to send each such command via a network at 9600 bps (64 bytes frames). In networking there can be a lot of overhead to send that one command. If such a command gets behind a large frame it could be delayed even more as you have to wait until that large frame gets done. This is not to say it can't be done it's just that it needs to be properly done.

Anyway, I've decided to look into this technology. I'm currently purchased four of the TI EZ430-RF25! 00 devel opment boards. It says it can do 200 kbps and I'm going to see if I can learn to communicate point (a master) to multi-point (multiple endpoints). This should be quite a challenge.