40 Mile Range XTend 900 MHz RPSMA Configuration

Uncategorizedon February 9th, 2010

Our research group just bought a couple of these 40 mile range RF transmitters for our Everglades project. Doug Mann and I were tasked with getting them to talk to each other, and to our dismay, no tutorials existed on the interwebs. The documentation was little help because it kept on referring to the development board. Unfortunately, the dev board can’t be purchased separately, and we had already acquired two of these modules.

We tried a bunch of different ways to get them to talk serially to a computer, but let me just tell you what ended up working. After hours of frustration, I remembered something I read in the book Making Things Talk (great book, highly recommend) that explained a certain way to configure an XBee radio. This involved removing the ATMega chip from an Arduino Microcontroller which just turned it into a slightly more expensive – but easier to interface with – FTDI chip. An FTDI chip is used to interface with “old” communications protocols over USB. This chip is a part of every Arduino board, but can also be bought separately for a slightly more dedicated solution. I think this solution is pretty clever because Arduinos are ubiquitous these days.

Anyways, check out the final setup below. We have a breakout board for the transmitter, but we just wire wrapped it now for prototyping purposes. Aside – wire wrapping will change your life. You can see that the ATMega has been removed from the Arduino, and there are only 5 pins connected to 4 ports on the Arduino.

Check the data sheet because the pin numbering is a little weird, but we only connected the following:

Pin 1 – Ground
Pin 2 – 5 Volts
Pin 5 – Rx
Pin 6 – Tx
Pin 7 – 5 Volts

After doing this and plugging in the Arduino, we could send AT commands via any serial monitoring tool. Since you’re already using an Arduino, you can just use the serial monitor in the Arduino IDE, or use the “screen” command in Terminal for Mac OS X computers. Regardless, the X-CTU software is fantastic (albeit Windows only). I recommend finding a Windows machine to install X-CTU because it makes the process graphical and takes a lot of the guesswork out of it.

After configuring just two settings on the radios, we were sending data across the lake on campus at 115kbps! We’re going to do a longer range test soon.

This was a crucial step for us as far as the Everglades project is concerned. Check out our new $200 solar panel setup powering a Fit-PC:


Compiling HTK for Mac OS X Snow Leopard

Mac OS Xon January 22nd, 2010

The Hidden Markov Model Toolkit (HTK) is widely used in speech recognition research. Since I’ll be doing some multimodal speech recognition soon, I downloaded the HTK and tried to compile it for Snow Leopard. This didn’t work right away, and after scraping the bowels of the internet for help, I’ve finally managed to get it working.

Use the following option to configure the Makefile:

./configure – -build=i686-apple-macos

No space between the dashes in case you are copying and pasting this. And for one of my machines I had to add an option to the CFLAGS in the Makefile. Open the makefile with your favorite text editor and add the following to CFLAGS:

-I/usr/include/malloc

That’s an ‘I’ as in ‘eye’.

Also, don’t follow the instructions in the README for testing the installation. Instead, perform the following commands as found on the official HTK site for testing a Mac OS/Linux install.

cd HTKDemo
mkdir -p hmms/{tmp,hmm.{0,1,2,3}} proto acc test
perl runDemo configs/monPlainM1S1.dcf


HAID ‘09

Uncategorizedon September 12th, 2009
You can buy a bratwurst and a 0,5 liter beer for just 4,50 euros!

You can buy a bratwurst and a 0,5 liter beer for just 4,50 euros!

Guten Tag!

I’m posting this from my hotel in Germany. It’s my last night here after attending the Haptic and Audio Interaction Design conference at the Dresden University of Technology. I was presenting my work on the control of audio effects using head position estimation. I’ll have the PDF of the poster and paper in the portfolio section soon. There were many very interesting and fun people that I met on this trip. It was just a bunch of people that like to make cool things happen with technology!

Check out a few photos of the trip here:

http://gallery.me.com/pat_okeefe/100244

My apologies for the inferior white balance and focus of the iPhone camera. It did the trick though.

Getting Matlab 2008b+ to work with Mac OS X Snow Leopard

Uncategorizedon August 31st, 2009

Being the nerd that I am, I pre-ordered Snow Leopard as soon as I could and also installed it on the same day it shipped. I did a complete reformat of my HD to get rid of all the junk I accumulated during the Leopard days. Much to my dismay, Matlab 2008b did not install properly because the Activation App wouldn’t work. I read the error logs and checked out some discussion on the mathworks website and determined it was a Java bug. Snow Leopard only comes with Java 6 and is 64-bit by default. Matlab, however, is written for Java 5 and 32-bit at that.

To get it to activate properly, navigate to /Applications/Utilities/ and launch “Java Preferences.app”.

Drag the 32-bit version of Java 6 to the top of both lists. Then, activate Matlab manually without using the internet (you’ll have to provide a license file). After the activation is successful, you can switch the Java back to 64-bit with no problems and launch Matlab normally. There is an exception thrown on launch, but I ran plenty of old scripts and even tried fdatool and whatnot with no problems.

Sweet.


Mac OS X Compilation for Heyu Home Automation

Heyu, Home Automation, Mac OS Xon June 26th, 2009

I suppose this will be much like my last post. If you don’t know much about Heyu, this is from the main website:

HEYU is a text-based console program for remotely controlling lights and appliances in the home or office. The complete source is made available under the free Heyu License.

Heyu uses the CM11A computer interface to send and receive X10 control signals over the AC power lines to modules which can turn On, Off, or Dim attached lamps or appliances. It can store a schedule of timed events in the CM11A memory for execution when the computer is turned off or disconnected.

Now it is written for Linux, and that worked for me for a long time. However, I want to be able to create a GUI and use my most familiar programming environment of Xcode and Mac OS X.

Unless my search skills are horrible, it takes a looooong time to find instructions on how to compile the Heyu libraries for Mac OS X and get it up and running. I finally found some stuff from 2002, and I will share my newfound knowledge here so that it can spread on the interwebs.

First, you need a USB to Serial adapter. Sorry. They are probably $15, but cheaper ones must exist. Next, you need to discover where OS X thinks the adapter is. Open up Terminal and type:

cd /dev
ls

This should show a whole bunch of stuff. Ignore the tty* stuff and look for something that sounds like our adapter. My terminal shows an item called cu.usbserial. Perfect! So write down (or remember) the location.

Download Heyu from the website linked above. ‘cd’ into the downloaded directory and type:

./Configure freebsd

Mac OS X has a Unix base built upon freeBSD, so this creates a makefile perfect for OS X. Even though it says “now run make as a normal user,” there’s one last change left. Edit the x10.h file (I just use ‘pico’ in the Terminal) and perform the following:

change

#else
#define LOCKDIR “/var/lock”
#endif

to

#else
#define LOCKDIR “/tmp”
#endif

Now go ahead and run ‘make’. Heyu will guide you through the rest of the install. At some point you ’sudo make install’ and give and option of where the config file should live. I chose the home directory so I could have easy access to it. (It will be a hidden directory so access through Terminal with ls -a). Also at some point, you’ll be asked to give the address of the CM11a interface, which you’ve connected to your USB to Serial port by now. Give it the location we found earlier. For what I found, this was ‘/dev/cu.usbserial’.

After the ’sudo make install’ everything is ready to go! You can use the standard Heyu command set. Here are a few to get you started.

heyu start
heyu info
heyu on a1
heyu dim a1 10

My next Heyu post will discuss how to execute shell scripts and commands from an Xcode project using NSTask.


OpenCV and Xcode

Uncategorizedon June 26th, 2009

OpenCV is really awesome. I’ve been using the library extensively in my summer research. For those who don’t know what OpenCV is, this is from the main website:

OpenCV (Open Source Computer Vision) is a library of programming functions mainly aimed at real time computer vision.

Example applications of the OpenCV library are Human-Computer Interaction (HCI); Object Identification, Segmentation and Recognition; Face Recognition; Gesture Recognition; Motion Tracking, Ego Motion, Motion Understanding; Structure From Motion (SFM); Stereo and Multi-Camera Calibration and Depth Computation; Mobile Robotics.

Cameo – Reid Draper: roommate and programmer extraordinaire.

I wasted a lot of time trying to get the library to compile on OS X. Don’t make the same mistake! Download the pre-compiled Universal Binary from this site. Currently, it is version 1.2, but a huge 2.0 release is coming in August.

Back to the framework. Don’t waste your time try to add build phases and whatnot. I never managed to get that to work. Just copy OpenCV.framwork to /Library/Frameworks. Do not add it to ~/Library/Frameworks, but the root Library.

After that, when adding “existing framework to application” just navigate to it. Everything will link just fine. Now, do something awesome.


Arduino to Mac OS X Serial Communication

Uncategorizedon June 1st, 2009

I ran into a snag when trying to get an xcode project to talk to an Arduino in April. After a bit of researching, I finally got things working with AMSerialPort from Andreas Mayer. I had to tweak it a bit…the method to change the baud rate didn’t work at first, but it’s fixed now. Also, the part of AMSerialPort that waits in the background thread for incoming data was modified a bit to play nice with Arduino serial messages. I re-packaged everything into a new Xcode project with a simple interface that let’s a user select an attached serial device and then send messages to it as well. My code has the incoming messages just go straight to the console instead of being displayed in the view. I could have done otherwise, but each implementation of this will require vastly different interfaces when completed. I know that I will never need to display the incoming messages on the screen, so I didn’t bother.

The modification the background-thread-waiting is by my design. It waits for a newline character, or more specifically, a serial message that is sent with

Serial.println()

So Serial.print() can be used several times without the Xcode project reporting any incoming data. What it is really doing is storing up the data until a newline character. Just end your bout of serial messages with a Serial.println() for the message to come through to the console. If you’d prefer every message to come through, just always use Serial.println().

The project is hosted here on Google Code.


Arduino Mega

Uncategorizedon June 1st, 2009

It’s been a while since my last post, but now the semester is over and my summer schedule is in full swing. I just had to express my joy at the release of the Arduino Mega. For some reason, I’m still scared to enter into the realm of AVR and ARM, so I’ll stick with the Arduino for now.

I actually already have my hands on one from Sparkfun. It’s absolutely sensational. No longer do I have to worry about running out of analog ports.


Quadcopter On-Board Video

Quadcopteron April 9th, 2009

Success! Taking video from the quadcopter is about three weeks premature, but I couldn’t resist. I definitely should’ve waited for a roll-cage over the electronics, and this is made apparent by the fact that my front motor isn’t working after a few crashes today.

I wanted to take some aerial shots of Lake Osceola on campus, but I thought it would be more interesting to switch the camera into ‘video’ mode first. It worked out OK because the winds were too strong for me to attempt keeping the quad stable. The few pictures I took in the air turned out to be very blurry. I really need to do some solid testing of my PID parameters before I try anything this crazy again. Next time though, I will go much higher (with calmer winds).

Anyways here is the video that was captured (with an epic last crash) and two pictures extracted from the video.


Research and Creativity Forum and More Pictures

Quadcopteron April 8th, 2009

I presented my quadcopter work at the Research and Creativity Forum yesterday. It was a great time. A couple of my professors stopped by and the judges seemed very impressed. It’s always good to get some motivation to continue working on this. The poster that I had at the event is linked in PDF format on the right. It’s a good summary of the project so far with applications of the quad, hardware relationships, and a couple graphs generated by in-flight data. Last Saturday I flew it again and even had a three minute flight getting as high as 30 feet (slightly terrifying because I haven’t built a ‘roll cage’ yet). There seems to be a bit of a ‘fishbowl’ effect when transitioning from motion to hover. Maybe I’ll try to add some of the “I” to the PID controller to help with this. Right now I’m using these constants: P = 1.7, I = 0.0, D = -1.4, xMitFactor = 0.2. This weekend I’ll try to take some aerial photographs. Here are some pictures of the quad. I just added the XBee shield recently (turns out my first microcontroller was busted) and I’ll add some shots of that soon.