Dec 31, 2010

Right Angle Header for Hacked Asus Router Serial Port

Buried somewhere in the comments in the mightyohm forum is a suggestion to use right angle headers instead of straight ones for the serial port. This allows a shorter connection.


If you make the adapter board for the FTDI cable as Jeff Keyzer suggests in the wifi radio build instructions, keep the PCB/perfboard small. You can then still insert it over a right angle header.


Alternatively, you can connect the serial port to the FTDI cable with female-to-male jumpers (available at sparkfun for example).

Dec 30, 2010

Formatting USB Flash Drives for ext3

Hit and Miss
Apparently, not all flash drives are created equal. Or, maybe it's my technique. I tried to format a Maxell 4GB nubbin (tiny, little bigger than the USB connector) flash drive for use in my hacked Asus WL-520GU router. This would hold the python-related files and my scripts for passing to an arduino-powered VFD.This is with Ubuntu 10.04:
  • unmount (previously mounted) drive
  • su -   ; fdisk -l to find the device, in my case /dev/sdb1
  • fdisk /dev/sdb1sdb; p = print partions      <====Corrected!
  • delete partition
  • add new primary partition, all available space, type 83 = ext3
  • write
  • mkfs.ext3 /dev/sdb1
  • remove drive from USB; insert drive into USB
  • mounts
In the case of the Maxell, issuing the mount command from terminal still identifies this as FAT32.
Tried this same thing with a PNY brand 4GB drive, also a nubbin. Worked fine. Go figure...

Tip: To add files to the new partition, from a terminal issue: gksudo nautilus. This will allow you to add files graphically as root. For working with OpenWRT on my hacked Asus WL-520GU, root ownership just worked.
Update 1:  DOH! You need to create the partition via fdisk /dev/sdb, NOT fdisk /dev/sdb1. What I was doing was creating a partition under a partition. Didn't know you could do that! The result was a partition named: /dev/sdb1p1.
This was from the (
"You have incorrectly created a partition table *on a partition* instead of on the device. You need to run fdisk against /dev/sdb NOT /dev/sdb1.
fdisk /dev/sdb
Use option o to create a new partition table. Then use n to create new partitions. When you're done, fdisk -l will show 2 partitions on sdb, not the 1 partition you have now."
Update 2:  After creating a new partition as /dev/sdb1, tried to automount the drive and got:
wrong fs type, bad option, bad superblock on /dev/sdb1
Did an fsck -y /dev/sdb1 and got the message:
*** journal has been re-created - filesystem is now ext3 again ***
Removed/inserted the drive and got the "bad superblock" message again. No luck.

Dec 20, 2010

Failure is a Good Teacher

When you start out making electronic projects, stuff is going to get broken, fried, melted and destroyed. Phil Torrone (Adabot on Ask An Engineer) has affirmed this - stuff is going to break, things are going to go wrong. That's just collateral damage on the road to victory.

What's your objective in doing a project? Is it purely to "scratch an itch" - fill a need, or something deeper, more long-lasting? Either way, you're going to have to keep driving yourself to achieve your objective. There'll be blind alleys, red herrings and ignorance to overcome, but you can do it if you keep trying.

And you'll learn things you never knew about. In fact, you almost can't help but learn new things, as long as you keep going.

Here's a video of geek god Jeri Ellsworth telling you to "Fail and Fail Often":

If you watch the video all the way to the end, you'll see a key point being made: be open to the unexpected results. Jeri had a failure that she set aside for awhile, then revisited it. She was open and aware that there was new data in the "failure" that she could use, turning it into a "win".

Dec 11, 2010

Create Arduino Bitmaps for Nokia 5110 3310 LCDs

Use xpaint to create a bitmap in the appropriate resolution for the LCD you are using. On the 5110, this is 84Wx48H.

Use Processing glcdbitmap.pde (included in the KS0108 library for arduino) to read the bitmap.
    • You'll need to insert the name of the bitmap into the sketch
    • The bitmap must be in the Processing folder
    • Run the sketch
    • The converted bitmap will be stored in the sketch folder (glcdbitmap_test in this example) as bitmapname.h

Place the bitmap information into your target sketch “.h” file. Use memcpy_P to copy the entry to the desired place in the screen layout.
To create a splash screen:
Find a grayscale (or monochrome) image of approximate size, can be slightly larger than your screen resolution depending on the image. I got a *.jpg file for the Noisey Cricket splash screen.
  • if larger, use a resizing tool to get the image to the appropriate size (say 84x48)in Ubuntu, you can do this by right-clicking the picture and choosing Resize Images

set the resize image to your screen resolution


Open the image in GIMP
  • Click Image from the Menu, choose Mode\Indexed
  • Click radio button for “Use black and white (1 bit) palette”
  • Click Convert