Cell Phone to Sound Board for only $20!


I have successfully finished yet another garage-shop electronics project that actually WORKS!

Tuesday, Pastor Mike at Rez announced that in two weeks, when they're on their short-term missions trip to India, they'll be performing yet another Skype call in to 6:33 pm. However, the last two or three times they've been anywhere, they've tried this, and every time it's been a rig. Here's how they did it: a laptop on their end runs Skype, the Mac computer on our end runs Skype, but the bandwidth is low enough that we can only manage video. The audio cuts in and out. So for audio, we do a regular cellphone call (and use the headphone jack on the phone to pipe it into the sound board at church). And on top of that, we relied on the built-in mic in the cell phone to pick up any audio for the overseas guys to hear. A really poor setup to say the least. And each time, I've promised to come up with a better solution for next time.

Well, I finally did. After 3+ skype calls, I finally broke down and built a phone to generic audio converter box. This basically takes the standard 4-conductor headphone jack that plugs into any modern phone for hands-free devices, and converts all three circuits into ¼" monoral TRS jacks. These jacks are left and right headphone audio out, and microphone in.

It took a little more than just straight wires on the microphone, simply because the output from nearly any audio device (except for a real microphone) are going to be a lower impedance than the input on the cell phone can handle, so I had to dumb it down with resistors. With some help from my dad making a few modifications to my schematic, I was able to solder and wire everything up yesterday, and then just an hour ago, I managed to find a workable solution to hook it up to my computer at home and make it all work. And yes, it did work! I called my mom on her phone while the box was plugged into mine, and I was able to speak into a big microphone and she heard me, and then I hooked the audio out to my computer and I was able to hear (and even record) her over my computer speakers. YES!!

One of my biggest goals for this particular project was making sure that all the connections were well insulated and well soldered in. I have made several projects that had pretty poor solder joints and were always giving out. I didn't want that to happen this time. So I made sure that all of my leads were long enough and that there were no nicks in any of the wires. It seems to be solid! Everything works beautifully and there are no shorts anywhere.

My BIGGEST problem was soldering up the 4-conductor surface mount headphone jack. This was one type of thing I could not for the life of me find instructions on how to do. Nor was I expecting it to be that difficult. But the device was I think ROHS-compliant and thus did not take regular solder all that well. Besides that, I didn't have a fine-tip solder iron, nor any fine-pitch solder. I don't have the money for a $400+ Weller. All I have is a 40 watt radio shack iron.

Well the solution I came up with was to just completely remove the plastic insulation from around the four conductors on the headphone jack and then just wrap around the single-strand cat5 wire around each of them and solder them into place. Once hot enough, the solder flowed fairly well and I didn't have any big problems after that.

Actually I did have one minor problem, but that's when I fell in love with hot glue. After soldering up those wires to the 4-conductor headphone plug, I found that I needed to insulate them from one another. But I didn't have any 1/8" heat shrink, so I decided to use what I saw one tutorial on the web use: hot glue! With a toothpick I was able to get a little glob of melted glue down between all of the leads on the headphone jack. But then the ground tab didn't want to bend back in all the way (and make room for the black plastic housing), so I just pushed the housing as far on as it would go and then glued that in place as well.

On top of using hot glue to pretty much epoxy the entire plug assembly shut, I also used it to stress-relieve the hole in the box where the wires for the plug were coming through. Since I used a drill to come through the main plastic project box, there were rough edges which would eventually have worn through the insulation on the wires. No longer. They're glued in!

Lastly, I used perfboard to wire in the microphone volume control and other impedance-matching components including a 1uF capacitor to remove DC offset on the line. Works great! The potentiometer I drilled into the side of the box opposite the headphone plug. Then on an adjacent side, I drilled in the three ¼" TRS jacks, 2 for audio out, 1 for audio in.

With all of this in place, I will be able to take three patch cables and connect them between my box and an audio input and output on the sound board. Since the group is going to do their thing in TWO weeks, I'll be able to go in next Tuesday and do a test run with Dad. I'll hook up either his phone or my phone and we'll test it out with the other in the other room/other end of the building. The goal will be to communicate with the remote phone via the large speakers and a hand-held mic, both of which feed into the big sound board.
 
Is this how they do it on radio with making calls in? Sure. But some company has probably made this sort of thing a lot cleaner and flawless. However, I made it myself and it works! And it only cost me $20. Well…besides the box, which I already had from another project years ago. But yes! It works!! And if I can get my own patch cables at home, I'll be able to record YOU when YOU call me! Or maybe phone interviews or anything else! So excited that this actually works. HA!

Panoramio

I've at last found a way to post my newest Panoramio photos places other than Google Maps/Earth and Panoramio proper: the API widget! With this, I can add an iframe to any page and display my own photos from most newest to oldest. Right now I'm testing it out on the sidebar. It takes a little bit of time and effort to load the thing, but it seems to be working wonderfully anyway! See if THAT works for ya.

Geotag Hack for Garmin Nüvi/Panoramio Photos

How to manually geotag photos for the Garmin Nüvi 1490
Does NOT require the Garmin Connect software.


Recently (yesterday) I was nominated to read up on and figure out the Garmin Nüvi 1490 GPS unit for a friend of the family. Well, looking through the features, I found that photos can be loaded into the unit and displayed in various locations, such as the bootup screen, a simple slideshow, or even as a navigate-to-photo feature!

Now, I assumed that somehow the unit would read out Geotagging meta data from any old photo you might tag in something like Picasa and copy to the unit. But this is not so. Actually, Garmin has signed a contract of some sort with Panoramio, an online photo-sharing site specifically for photos of general public areas, usually landscapes, historical photos, or any other pictures based mainly on a location. By connecting the Nuvi to the computer, one can navigate to http://connect.garmin.com/photos, browse the map for specific Panoramio photo, which, if they have geotag information loaded, will show up on the map, and add it to a separate dock area, which, by using the Garmin Connect software, can be downloaded directly to the GPS unit.

All well and good, except that in the last month and a half, I've uploaded about 20+ photos to Panoramio and NONE of them are showing up on the Garmin Connect map, though they specifically said in the Panoramio forums that they would after some time. And to top it off, a photo that my dad posted about four years ago is also not appearing! Not very on top of this little feature, are we?

Besides that, all of the other threads on Panoramio boiled down to "downloading Panoramio photos to your computer is illegal" and NONE of them gave any helpful information.

So, I decided to do some research and figure out just exactly how the Garmin Connect tool synchronized with the photos feature. When I plugged the unit into the computer via USB, two new drives were mounted: the Garmin Nuvi drive, which is the image of the internal memory, and a Removable Disk, which was accessing the Micro-SD expansion port.

Navigating into the Garmin Nuvi drive (on my machine, I:), there are a number of files and folders:
.System
Garmin
GPX
help
JPEG
keyboards
Reports
Screenshot
Text
Vehicle
Voice
.Volume.icns
autorun.inf
nuvi_drive.ico
Navigating into the GPX folder, I find three files:
Current.gpx
Panoramio_20110810T103416.gpx
Position.gpx
From my previous research using our own GPS unit, the GPSMAP 60CSx, I know that GPX files are an XML-based file that can be opened in any text editor, and record specific gps coordinates along with names of the locations, timestamps and sources. Knowing that the Garmin stored everything in GPX made decoding it so much easier! With this knowledge, I was able to determine that GPX/Current.gpx is the database that stored saved searches, tracks and tagged photos downloaded from Panoramio, GPX/Panoramio_20110810T103416.gpx is the list of geotagged photos downloaded from Garmin Connect/Panoramio, and GPX/Position.gpx is probably the unit's current position.

Assuming that the Current.gpx file is updated regularly based on what the the unit is detecting, I decided to decode the Panoramio_20110810T103416.gpx file. And it worked! The conclusion I came to was the following: photos downloaded from GC/Panoramio are not tagged in the unit using JPEG metadata, and the unit can't detect JPG location metatags. Instead, Panoramio also sends location data alongside the photos that the unit downloads, and injects this information into the Panoramio_*.gpx file. THEN when the photos are opened in the viewer, the proper location-based tools are activated.

Here is a waypoint for a specific Panoramio photo:

<wpt lat="40.615972" lon="-105.171969">
<name>Northwest of Fort Collins</name>
<src>Panoramio <link href="Garmin/JPEG/Panoramio_11075531.jpg">
<type>image/jpeg </link>
<link href="http://www.panoramio.com/user/965071">
<text>WildernessShots.com</text>
<type>text/html</type>
</link>
<link href="http://www.panoramio.com/photo/11075531">
<type>text/html</type>
</link>
<sym>Scenic Area</sym>
<extensions>
<gpxx:WaypointExtension xmlns:gpxx="http://www.garmin.com/xmlschemas/GpxExtensions/v3">
<gpxx:Categories>
<gpxx:Category>Photos</gpxx:Category>
</gpxx:Categories>
</gpxx:WaypointExtension>
</extensions>
</wpt>
With this information, I think it would be fairly self-explanatory to edit this file. I have yet to actually try it out, but when I figure it out, I'll get back with you!
------------
SUCCESS!!! I simply added a new <wpt> ... </wpt> section to the panoramio_20110810T103416.gpx file and when I rebooted the unit (unplugged it from the computer), the photo appeared in the list AND had the location tools in the lower corner, along with my username and all that!! WONDERFUL!

And just as I suspected, Current.gpx was also updated to reflect these changes, even though I didn't do a thing to them.

So all that needs to be done to add photos to your Garmin, and tag them without worrying about the Garmin Connect/Panoramio tool, simply copy the photos into one of the locations where pictures are kept on the unit. The tool downloads them to /Garmin/JPEG/, but I'm sure /JPEG/ will do just fine (/JPEG/ is where all the sample photos are kept).

Then edit the /GPX/Panoramio_<datecode>.gpx file and add a new waypoint using the <wpt> ... </wpt> tags as shown above. Or if you have a secondary program to save GPX files, I'm sure there is a way to just fix this up to save in this format. Also, the datecode in the filename is in the following format: yyyymmddThhmmss, so in my case, it was 20110810T103416. Just to keep up with the consistency, I also changed the filename to Panoramio_20110810T173100.gpx.

So in the end, here is the waypoint I manually and successfully added, along with the required XML and GPX definition tags:


<?xml version="1.0" encoding="UTF-8"?>
<gpx xmlns="http://www.topografix.com/GPX/1/1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.topografix.com/GPX/1/1 http://www.topografix.com/GPX/1/1/gpx.xsd" version="1.1" creator="http://connect.garmin.com/">
<wpt lat="40.631839" lon="-105.143142">
<name>Sunrise Over the Neighborhood</name>
<src>Panoramio</src>
<link href="Garmin/JPEG/56784165.jpg">
<type>image/jpeg</type>
</link>
<link href="http://www.panoramio.com/user/5873911">
<text>Daniel P</text>
<type>text/html</type>
</link>
<link href="http://www.panoramio.com/photo/56784165">
<type>text/html</type>
</link>
<sym>Scenic Area</sym>
<extensions>
<gpxx:WaypointExtension xmlns:gpxx="http://www.garmin.com/xmlschemas/GpxExtensions/v3">
<gpxx:Categories>
<gpxx:Category>Photos</gpxx:Category>
</gpxx:Categories>
</gpxx:WaypointExtension>
</extensions>
</wpt>
</gpx>
I'm sure if you wanted to add non-panoramio files, it would be just as easy. Just change/remove the few <link> tags to reflect something else and you'd be good to go!

Now to write a program to do this for me...


ISO vs. ZIP/RAR

What is an ISO file? An ISO file put simply is a perfect copy of a disc (usually optical) stored in one file on the hard drive of a computer. ISO is uncompressed and contains even free space of said disc.

According to Wikipedia, "An ISO image (International Organization for Standardization) is an archive file (also known as a disc image) of an optical disc, composed of the data contents of every written sector of an optical disc, including the optical disc file system." (Wikipedia, ISO Image, June 2011)

This varies from a compressed archive such as ZIP, RAR, TAR, GZ, BZ2, etc, in that an archive file contains only the files and all unused sectors are removed to save space. With this in mind, one would think that an ISO file was simply an uncompressed archive.

HOWEVER, this is not entirely true. Even uncompressed, an archive file still removes completely-empty bytes. There's no need to zip up the files of an entire 40GB disc and end up with a 40GB file, unless there was actually 40GB of data that was filling the entire thing up! If there was only 15GB on a 40GB disc and you archived the entire disc uncompressed, you would end up with a 15GB file.

This is not true in the case of an ISO file. When you create an image of a 4GB DVD, you will end up with a complete 4GB ISO file, even if half the disc was unused.

This is useful because the main point of ISO files is to be able to create a disc image file and re-burn it to another disc, thus making a copy. In this case, file locations are important in addition to file data, and an burning an ISO image, we are sure that all of the files are laid down on the surface of the disc in exactly the same configuration as the master. Of course, this would only REALLY matter if you were dealing with a raw DVD video that would be more reliant on the burning process than an MPEG-2 file burned to the DVD as data.

Ubuntu Server - Changing Screen Resolution with GRUB2

Recently I drug out my old Dell dinosaur (Dimension) from the closet and decided to try installing Ubuntu server onto it.

Well, all went well until I also attempted to add the Xubuntu-Desktop package, so I could better run around and do things in there. A quick update for an nVidia graphics driver froze the computer directly after login, and all the stuff I found in the forums didn't really help that much, except for possibly uninstalling all the packages that xubuntu-desktop stuck in there. Since there wasn't a lot on there (except for maybe the neat desktop backgrounds that seem to change with every version of any Ubuntu release), I figured a fresh install would be best.

After reinstalling the OS, I did a repository update, which screwed up my screen resolution. My monitor can handle 1280x1024, but the update had changed it to 640x480.

Note: This is Ubuntu Server 10.04.

How do you change screen resolution within a pure terminal interface? GRUB2.

Around version 9.04, Ubuntu upgraded the bootloader from GRUB to GRUB2. This is way more confusing, but can still be figured out.

For the sake of simplicity, there is no longer /boot/grub/menu.lst. It's just not there, nor will it be used if you create it. Instead, all the configurable options are now moved into /boot/grub/grub.cfg

The problem is though, with the command $ sudo update-grub or on a kernel update, this file is overwritten. Therefore, this file should not be editted.

But where does GRUB pull all this information when it DOES do an update?

All the config options are actually stored in the /etc/grub.d folder. This folder are 7 sub-files:

  • 00_header
  • 05_debian_theme
  • 10_hurd
  • 10_linux
  • 20_memtest86+
  • 30_os-prober
  • 40_custom

On grub-update, all of these files are executed and mashed together and copied into grub.cfg. But these files don't change ever. Therefore, you can change them yourself, adding entries and such.

I don't know all the details, but the process for adding more operating systems is much more complicated than before. They've decided to use some C-style function for each menu entry, rather than the old way of a simple list with tabbed sub-values.

You can see the way menu items are placed by looking directly at the /boot/grub/grub.cfg file and scrolling down to the 10_linux section.

In mine, a single final entry appears like the following:

menuentry 'Ubuntu, with Linux 2.6.32.32-generic-pae (recovery mode)' --class ubuntu --class gnu-linux --class gnu --class os { recordfail insmod ext2 set root='(hd0,1)' search --no-floppy --fs-uuid --set 0689cdb7-786d-4a68-b14b-634b85c9961b linux /boot/vmlinuz-2.6.32-32-generic-pae root=UUID=UUID=0689cdb7-786d-4a68-b14b-634b85c9961b ro quiet initrd /boot/initrd.img-2.6.32-32-generic-pae}

All this is somehow scripted into the 10_linux file. You won't see this exact entry anywhere in the file, but instead they've created a way for it to execute a 'find all options and translate them into this format' when you do sudo update-grub.

But anyway, back to the issue at hand. My screen resolution is messed up. I said GRUB2 was the solution to fix this. The options for screen resolutions are stored in /etc/grub.d/00_header.

Open the file in an editor, and scroll down until you see the if statement:
  if [ "x${GRUB_GFXMODE}" = "x" ] ; then GRUB_GFXMODE=640x480 ; fi

Simply change 640x480 to whatever your desired (and of course, possible) screen resolution is, save, update-grub and reboot.

Oh, and if it matters, a read through the Official Ubuntu GRUB2 Docs might help.




I just now decided to read further into that help file right there...apparently you can also change screen resolution in the /etc/default/grub file, as well as turn on countdowns and things to make sure that you can actually use the menu.

In /etc/default/grub:

GRUB_GFXMODE=640x480 - Change to something your screen can handle and that you want. Maximum is usually okay if you're good on small text. They say in the documentation, that you can comma-separate values also, in case one doesn't work. Just put them in a DESCENDING preferred order, usually high to low.

Also make sure you uncomment the line by removing the # symbol at the beginning of it.

The vbeinfo command in the shell should give you your valid resolutions.

Also, if you find that there is no menu displayed, you can turn on timeouts in this file.

if GRUB_HIDDEN_TIMEOUT is set to something above 0, a message will be displayed on bootup saying something like, "Press any key for the menu..", unless of course, the GRUB_HIDDEN_TIMEOUT_QUIET is set to true. Then you will see a black screen for that amount of time.

If GRUB_HIDDEN_TIMEOUT is empty (GRUB_HIDDEN_TIMEOUT=), GRUB_TIMEOUT will be used instead, and if this is a number greater than 0, the menu will be fully displayed every time you boot up.

Just remember to run sudo update-grub after editing.