Tuesday, November 27, 2012

The Efficiency Index

I've always loved the idea of indexes - a collection of securities that make it on and off a list based on a well-defined set of rules. As I tried to image what a hypothetical "Drashkov Index" would look like, I quickly realized that all the companies I would put on there had one thing in common - if successful they would make the world a far more efficient place.

I believe that for the foreseeable future (the next two decades at least), the world will not see any form of cheap energy. Consequently, we won't experience anything resembling the cheap-oil fueled growth of the post WWII era. Today Americans make up about 5% of the world's population, yet consume about 25% of its resources. With billions of people striving for a Western standard of living, demand for energy will be insatiable. At the same time, the increasingly obvious effects of climate change will make more people receptive to treating and pricing carbon as the pollutant it is.

If we accept a world of high energy prices, the only way to grow and develop is to make our world a far more efficient place and in a way that is much different from merely optimizing our existing products and processes. To illustrate the difference, consider a few examples:

  • Marc Andreessen famously said that "Software is Eating the World". By its very nature, doing tasks in software is far more efficient than doing them in hardware. Writing an article on a laptop and publishing it online is far more efficient than using a typewriter, the post office and getting it printed on a pile of dead trees.
  • The mechanical parts and motors in electric cars are efficient in a way ICE engines and drive trains can never be. Tesla's Model S - a large, heavy luxury sedan - is considerably more fuel efficient than any econobox on the market today.
  • 3D printing / Additive Manufacturing is inherently a much more efficient way of building objects than the wasteful processes of today's manufacturing, which mostly involves starting with large blocks of matter and getting rid of lots of material.
  • Lab grown and artificial meat requires far less biomass and energy to make a pound of meat protein. While many people choose a vegetarian or vegan lifestyle, the majority of people in the world would like to enjoy the same meat and protein-heavy diet as westerners enjoy today. The only plausible way this will happen is through something as radically new and efficient as lab grown and artificial meat.

I hope that one day we'll see a cheap green-energy fueled economic boom, but for the forceable future, I think we'll be living in a world of expensive energy. The Efficiency Index - a collection of companies whose raison d'ĂȘtre is to make the world more efficient seems like a great investment. So, what companies would you put on the Efficiency Index?

Saturday, February 18, 2012

How To Make the 23" Android MegaPad

A few months ago I published a video showing me using my home-made 23" Android tablet, which got a bit of attention and made people wonder how it was made. A lot people made plausible guesses - that it was a staged video, that it ran android-x86, etc, but few made the right guess so I wanted to publish a how-to so anyone that's interested can make their own.

The core of the MegaPad is the TI PandaBoard - a $200 ARM development board which contains what are essentially the guts of any modern smartphone - a dual-core 1GHz CPU, 1GB RAM, GPU, WiFi and a host of connectors. The great folks at TI provide both Ubuntu and Android releases for the PandaBoard and it's fairly straightfoward to get one of the releases up and running. For the touch input and video output, I went with the Acer T230H, which was made for Windows 7 and uses optical-touch to provide 2 touch points with acceptable performance. This monitor has been discontinued by Acer, so I found it in Kijiji, but as we'll see, you can substitute with another suitable touch monitor.

The bit that makes it all work is this: pandaboard releases are made to work with a keyboard and mouse and will not recognize the Acer touchscreen if you merely plug it in. Luckily, Linux developers have written a touchscreen driver that works with the Acer monitor, so all we have to do is recompile the kernel with the right drivers and voila! We got ourselves a megapad. There a few more details. The touch driver that comes with the Gingerbread pandaboard release supports only one touch point, so in order to get dual-touch working as in the video, we'll have to patch the driver.

There are a number of improvements one could make to the MegaPad. The lagginess you see in the video is due to the fact that Gingerbread was never made to support 1080 at reasonable frame rates, however the folks at Linaro have been busy making an ICS release for the pandaboard, which you can check out here. I suspect ICS will run far smoother than Gingerbread. Moreover, one can use any size touchscreen, as long as linux drivers are available. I went with the T230H simply because it didn't require the big investment larger screens do. Now, without further ado:


Instructions

  1. First, get a PandaBoard from DigiKey, Mouser or any other retailer. I also recommend a Serial-To-USB connector, since you'll need to use the PandaBoard's serial connection as well as a very fast SD Card.
  2. Get an Acer T230H or any other touch monitor which has working linux drivers.
  3. install minicom or similar serial terminal on your laptop. The pandaboard does not how to boot itself, so you'll need to connect to the serial port and paste some bootargs to tell the bootloader where to find the kernel.
  4. Get everything working with a keyboard and mouse: You can follow the instructions here on how to download and put the binaries onto the sdcard. Essentially, the SDCard will be formatted with 3 partitions: bootfs where you put the boot loader and linux kernel, rootfs where you put Android and data where you can store media files. To boot up the board, put the card in, connect the power and start the serial console. When you see the fastboot countdown on the console, interrupt it by pressing enter so you can get a prompt, then paste in the bootargs found here.
  5. Once you have Android up and running on the pandaboard using a keyboard and mouse, we can recompile the kernel to get our touchscreen working.
  6. Set up your computer and get the tools you'll need to download and compile the kernel by following these instructions. Next, follow the instructions here to download and compile the kernel without any modifications.
  7. Once you have everything set up (and patched, as per the instructions), try compiling the kernel and loading Android on the Pandaboard with it. The compilation, which should take 10 mins or less, will produce a file called "uImage", which is the entire linux kernel. Take that file and copy it into the bootfs partition on your sdcard and start the pandaboard as before.
  8. If everything is working fine and you can compile and load your own kernel, we're ready for the modifications to get the touchscreen working
  9. In your kernel dir, go to arch/arm/configs/panda_defconfig and search for "#CONFIG_HID_QUANTA is not set", which should be commented out. Change the line to "CONFIG_HID_QUANTA=y".
  10. Recompile the kernel, load it on the SD card and connect the USB touch port from the touchscreen into the pandaboard and disconnect the keyboard and mouse. Once the boot is complete you should have a fully operable, albeit single-touch, megapad!
  11. To get dual-touch working, patch the quanta driver using this patch. You can find the driver under drivers/hid/hid-quanta.c. Once again, recompile and reload. You should now have dual-touch fully working.
Tips
  • The pandaboard may appear slow, which may be due to Android's inability to write to the /data directory. Put the SDCard in your computer, go to the rootfs (Android) partition and do "chmod -R 777 /data". I found that this made performance on my pandaboard acceptable.
  • The pandaboard needs a weird 5V @ 20A power supply and most 5V supplies won't work. I suggest merely plugging in the miniUSB port into your computer and power it the way you would recharge any phone or tablet.
  • Getting adb working is much the same as any other device. Add the following (SUBSYSTEM=="usb", ATTR{idVendor}=="0451", ATTR{idProduct}=="d102", MODE="0666") to your udev rules, restart udev and adb and you're good to go

If you have any questions and comments, you can check me out on Google+ here:

Happy Hacking