Saturday, January 23, 2016

Sena SMH10R

Let's begin by way of explanation... I live in Utah. Almost everything is built on a grid square - it's one of the great things the pioneers did. Every major city settled by Mormons has a church building of some sort as its center--Salt Lake City's building is an LDS temple whereas many other cities were "centered" around a tabernacle - a large building (much larger than a standard congregational building). From there, streets were numbered in 100's for every block north, south, east or west. So someone who lived on, say, 52 South 400 East lived on the street 400 East, about a half a block south of the central building's cross-road. And 400 East runs north-to-south.

Confused? No matter - it's not the subject of this blog.

Not all of Utah is a snap to follow. For instance, who knew there was a Naples, UT--or a Bluff? Who knows how to get to Hovenweep National Monument (without a map)? I'm often fumbling for directions and I like to drive (and ride) as distraction free as possible, so I usually have Google Maps running (my car is 12 years old - fantastic sound system and a good navigation system, but the maps are old and missing a lot of more recent roads - my house, for instance, is not on a 'digitized road' as the navigation system likes to remind me). It's all the more important to me on the bike that I have good directions readily available. This is one reason I bought a Sena SMH10R Bluetooth headset.
 
 And I kid you not, I swear this thing is more complicated than the Space Shuttle... It has more options for pairing with other headsets, Bluetooth-enabled devices, etc. (there is even a Sena device that will connect to and control a two-way radio).

When I purchased my Sena, it connected with my Nexus 5x phone without any issue. Music was playing right off the bat, but I couldn't get turn-by-turn directions to play through the Sena device. Nor could I get it to work when I also connected my Nexus 7 tablet (which I intend to mount in the windscreen, just about the instruments, so maps are readily visible).

Some experimenting led me to the solution:
  1. Connected the Nexus 5x
  2. Went into settings for the Sena SMH10R bluetooth connection
  3. Enabled everything
  4. Went into settings for Google Maps
  5. Selected "Play Voice over Bluetooth"
  6. Shut down the device
  7. Powered back up
  8. Connected to the Sena SMH10R
  9. Bingo - turn-by-turn through the Sena

Next, I connected my Nexus 7 tablet (which is also running the latest Android OS). The first time I did it, I connected it as a multi-point device as per page 15 of the Sena owner's manual. I could never get turn-by-turn directions to come through the headset, though. Finally, I deleted the Sena device in the tablet's Bluetooth connection panel, then put the Sena into phone connect mode (not multi-point mode), and then connected. Once I enabled "Play Voice over Bluetooth" in Google maps, I was happily hearing maps through the Sena device again.

So, recapping
  1. Connect to the Nexus 5x phone as above
  2. Put the Sena into phone connect mode (first option in the Configuration menu)
  3. Connect the Nexus 7 tablet
  4. Go into Bluetooth connections and enable the Sena Bluetooth connection for everything
  5. In Google Maps' settings, enable "Play Voice over Bluetooth" 
Away you go...

Having trouble following that? No worries. This is the current Bluetooth connection settings dialog on Android OS:

And this is the options dialog for Google Maps:
 
Some people worry about the distraction of having a GPS connected to your helmet, but it's honestly not distracting. Having Google tell me well in advance where to turn, and in which direction, is actually quite settling. The voice is not intrusive, I can still hear traffic (if I'm not wearing ear plugs), and I'm not panicking trying to make a quick right across a lane of traffic. I call that safe.

Now - an electronic tablet will NEVER replace a good map--and I will always have a map with me. When I'm deep in the backroads, I'll also have an independent, battery-operated GPS unit to use with my map. The tablet's nice, but it's no guarantee. Nothing can replace good route-finding skills, especially the further you get from civilization.

The Sena offers 7 DAYS of 'standby' time (time where you're not talking), and 10 HOURS of talk time (which is great if you're paired with another rider in intercom mode). 

Tuesday, January 19, 2016

This is big... Crusher in the Tushar

So apparently the mind is a terribly weak thing, quick to forget the negative and prone to amplifying the positive. After a mediocre 2012 ride in the "Crusher in the Tushar," and a miserable 2013 ride during which I vowed never to return, for some reason I eagerly signed up again for the 2016 race.

This ride is, well, a little bit nuts. 70 miles. About 35 of those are on gravel (the rest is pavement--of which a lot is slurry seal). By mile 23, we will have gained 5000 vertical feet and passed 10,000 feet in elevation. From there it's a quick descent where we will lose all 5000 feet. But don't worry. After slogging through what seems like miles of sandy trail, we climb that 5000 feet again, averaging 8% and at some point hitting a 16% grade. And the suffering isn't over yet--a quick drop, some rolling hills and another long slog up are the reward. If we haven't given up yet, there's a roller coaster ride down and then a super-steep ascent to the finish line.

Here is the web site http://www.tusharcrusher.com and here is a map of the course:


The first year, it took 8:18 minutes to finish. I smiled the entire way, in spite of my almost dead-last performance. I had signed up to prove to myself that I can do really difficult things. I was just starting the training process, competing in a few triathlons but never rally riding enough to prep me for 70 brutal miles. Still I enjoyed the experience.

The next year found me very distracted, having fixed up a house, moved, and gotten married. I was miserable on the ride that year. Very little training, overweight, and simply dog-tired. It was hot and the hill was steeper. In 2012, I had at least done a few major hill climbs. In '13, I think I did 3.

So far, it has been different this year. I'm on the trainer at least 3x a week. My schedule is lighter so I can get in more training rides. I'm building a 26'er with a triple crank, which won't make me go faster but at least I can spin my way up even the 16% grade. I'm dropping weight (already at least 10 pounds lighter than in '13) and building !muscle and endurance. Above all, I am learning a lot about my fitness, peak output levels, etc. My goal is a 7:30. I'll blog on occasion about my rides, training progress, etc.


Meet Rever

I have been getting into adventure motorcycling. I bought myself a used Suzuki VStrom 650 right as the '15 season came to an end, and now I am planning for some trips next year. A coworker tipped me off to the Rever app--if Google Maps met Facebook and they had a child, it would be Rever. A very cool thing about Rever is that it is owned by the great folks at Butler Maps, makers of fine road and off-road back country Maps for motorcyclists--you'll see why that matters shortly.

When you think of Rever, think this way: you and some buddies want to ride somewhere fantastic together this summer. You're geographically dispersed, so you can't sit down face to face to discuss the route. Half the group want GPX tracks for the route, and the other half want to use a mobile device with offline capabilities. You want to build the trip easily, and you want some fantastic rides along the way. Rever does all that!
  • Rever is a social hub--invite your friends and make a group.
  • It features Google-quality street maps, with click-by-click route generation.
  • It exports GPX format, but can be used directly on a mobile device.
  • The mobile app tracks you on your route, with an offline map feature for remote rides.
  • Finally, it overlays Butler route info, so as you are planning you can see the best rides.
I'll blog some more on this later--for now, check out the screen grab from my Nexus 7 to get an idea of what a ride looks like. As you can see, its mobile app interface looks like a pretty standard Google Maps experience, with a few control bars above and below. What's awesome is, as a premium subscriber, you get access to Butler Maps route overlays. You can not only see standard map data, but any Butler rides are super-imposed (with the familiar Butler color codes). Very handy!

Currently route creation is a PC browser activity--the mobile app is used during travel. That may change, who knows. Building routes on any mobile device other than a 12" or larger tablet is a bit tedious, so it may not matter. Still, I am really looking forward to using Rever for my planning and traveling this season.

One nice feature in Rever is the ability to track your ride. This is a ride I planned, but it also tracked it and recorded it for me. This is good for going back and finding rides again later, for determining distance and such, and also participating in challenges (you have to check out the site to learn more about challenges - I gotta give you SOME reason to go there!).

Scoot on over to Rever.co (yes - that is http://rever.co and not .com), check out the features (and trust me - the Rever team is hard at work adding new features all the time) and sign up!

Tuesday, January 6, 2015

Virtual Audio Streaming

As mentioned in a previous post, I was struggling to use SDR to decode APRS. I needed a way to connect the incoming stream from SDR into an audio decoder. Windows supports a 'virtual audio device' in the sound control panel, but not all sound cards support this feature - mine does not. What to do?

Enter "Virtual Audio Streaming," an app from virtualaudiostreaming.net This app enables you to pick up sound from any application on your Windows system and pipe that audio into another application. It runs as a service, so the controller is in your task tray. When you open it, this is what you see:


On the left, set Virtual Audio Streaming as the default audio device (alternatively, pick VAS as the audio device in your application, such as SDR#). On the right, set it as the default sound recording device (or, alternatively, select it as the sound input device in the target application like Qtmm).

The tool installs easily--as with most low-cost applications, it can be bundled with other apps so pay attention when you're running the installer (if you don't want any other apps installed). Once running, it isn't noticeable at all and seems to have no effect on the host. A quick peek in Task Manager shows it takes on average between 2% and 4% resources:


From here on out, it's a snap to run with. If your source and target apps allow you to pick custom sound devices, you can run Virtual Audio Streaming without impacting any other audio settings (this is handy for me, because I spend up to 75% of my day in online meetings using a variety of conferencing tools). Overall, the install was easy, configuration is a snap, the tool is very flexible and it's had no noticeable negative effect on my computer.

Enjoy!

Thursday, January 1, 2015

APRS Decoding - Windows

I'm setting up to decode APRS on Windows with a simple RTL-SDR USB dongle. Here's what's needed:

Eventually I'd like this to all be self-contained--seems like a great add-on for SDR#. But that's for a later date... My first step is receiving and decoding APRS, but my next step will be to use my HackRF to actually send encoded APRS packets.

I've been fighting Windows and various Linux OS's trying to make this work. In this article, I'm taking a step back and moving slowly back to the point where it's working successfully. My eventual goal is to use a Raspberry PI with a DRA818* radio chip, in a weather-proof box at the base of my antenna mast. But I digress...

If you follow the steps here, you'll get this up and running quickly. I spent the better part of New Year's Day morning on this.

What You'll Need

  1. Install your SDR software of choice
  2. Install the RTLSDR USB driver (the HDSDR site gives some good info on installing the driver)
  3. Grab Qtmm from sourceforge

What to Do

  1. Start your SDR tool
  2. Connect to the RTL-SDR dongle
  3. Tune up to 144.39 (North America) or whatever your APRS frequency is.
You should start to see signal on your waterfall. It will look something like this:


Note that I prefer HDSDR to SDRSharp. That's just me...

Getting Audio into Qtmm

The trick here is to pump the decoded audio out of your SDR tool into the AFSK decoder. For some people, this will be easy because their Windows sound card chip supports "Stereo Mix" in the Sound Recording control panel. My chip does not, so I had to use "Virtual Audio Streaming," a virtual sound card too. I installed it, and set the "Rec. Play" device to the default device in the sound control panel:

Next, I set "Virtual Audio Streaming" as the output to speaker in HDSDR's sound card selection dialog:


Wide vs Narrow

I had some issues capturing the signal early on when I was using SDR#. Wide FM seemed maybe too wide, but narrow wasn't right. I messed with the signal bandwidth till I had something I liked. In HDSDR, I have bandwidth set to 18,205.

Qtmm AFSK Decoder

Next, just launch Qtmm AFSK decoder and select "Rec. Play (Virtual Audio Stream) for input and click the "Decode" (play) button:

You should begin to see packets streaming in!

Tuesday, December 23, 2014

Arduino EEPROM - Power Trip

I've continued to work on the rocket telemetry platform. One of my last issues (beyond frying my Nano by back-feeding power) was that the combination of GPS + IMU + microSD card was simply consuming more power than the little Nano could produce. Right now I'm working on a small instrument package for a model rocket payload, so I really didn't want to go to all the trouble of adding a power regulator and such.

Well, since I fried my nano and missed the launch date anyhow, that gave me some time to noodle over the issue. In reading one of my Arduino books (Exploring Arduino, by Jeremy Blum), I came across a discussion of EEPROMs. That led to a fair amount of research and I ultimately concluded that, for a rocket, using an EEPROM is a great idea!

What is an EEPROM? 

An EEPROM chip is a small non-volatile memory chip. Each Arduino has between 512k and 1024k EEPROM built in, and it's rarely ever used. For less than $5, you can buy an external EEPROM and use it for the same purpose, and the external EEPROMs are generally larger (I bought an 8k RCA chip from Ballard Supply (which just happens to be in my home town). I haven't used the chip yet, but the onboard EEPROM has worked like a charm.

This will work great for a rocket project, where I am gathering minimal telemetry data and the flight is short. For the balloon platform, I'm still planning to use the microSD reader along with a Mega - more memory, more expansion.

What's in a Structure?

With the storage issue solved, at least partly, my next challenge was writing data to the card. The built-in EEPROM.h library is a byte-by-byte read/write tool, and the data I'm storing is variable in length and format so I was stumped by how I could store and retrieve that data. My original thought was to store it as a long string, which is how I planned to do it with the microSD card. The challenge was that the string length would vary as numbers had more or fewer digits. Plus, building strings on Arduino can suck up memory. And along came... the struct. I've never really messed with structs before, but they are a sort of 'uber' datatype, which contains data within. In essences, it is a complex data type which includes datatypes within.

A struct looks something like this:
// Struct for storing a blog of data
struct store_t {
    float gpsLat, gpsLon;
    float gpsSpeed, gpsAlt;
    float imuX, imuY, imuZ;
    float imuPress, imuAlt;
  } storeBlob;

With the EEPROManywhere library from Arduino Playground, I can actually write an entire struct directly into the EEPROM. No mess, no fuss, no pointers or array indeces. Just write and read.

Writing to the EEPROM

With some research in the Adafruit GPS library, I realized every bit of data I'm writing is a float and, since floats have fixed length, my struct is a predictable 36 bytes, every single time. That means I have a predictable length and, therefore, a predictable starting point to read the next struct.

With a struct of 36 bytes, I can write 28 'blobs' to the Arduino's internal EEPROM, and 227 blobs to an 8K EEPROM chip. I anticipate about a 30-second flight, so I could write 7 times per second (if the Arduino could keep up). I intend to write 2 times per second, not much more.

Reading from the EEPROM

The EEPROManything library is dirt-easy to use. To write, you give it a starting location and the object (struct, in my case). To read, give it a starting location and an object to store the result in (again, a struct). So writing looks like this:
EEPROM_writeAnything(0,storeBlob);

And reading looks like this
EEPROM_readAnything(0,storeBlob);

The only challenge in all of this will be to keep track of the starting point, but it's actually straightforward, just have to careful of 0-based indexing.

Test Code

Here is some test code for writing and reading:
#include <EEPROManything.h>
#include <EEPROM.h>


// Struct for storing a blog of data
struct store_t {
    float gpsLat, gpsLon;
    float gpsSpeed, gpsAlt;
    float imuX, imuY, imuZ;
    float imuPress, imuAlt;
  } storeBlob;
  
  
void setup ()
{
  Serial.begin(9600);
  Serial.println ("Creating storeBlob");
  storeBlob.gpsLat = 4026.1162;
  storeBlob.gpsLon = 11202.8095;
  storeBlob.gpsSpeed = 141.2;
  storeBlob.gpsAlt = 1506.80;
  storeBlob.imuX = 13.2;
  storeBlob.imuY = 4.2;
  storeBlob.imuZ = 97.9;
  storeBlob.imuPress = 847.69;
  storeBlob.imuAlt = 1547.39;
  
  // Calculate length
  Serial.print("storeBlob length:" ); Serial.println(sizeof(storeBlob));
  
  // Now write to EEPROM
  Serial.println (EEPROM_writeAnything(0,storeBlob));
}

void loop ()
{
  
}



#include <EEPROManything.h>
#include <EEPROM.h>


// Struct for storing a blog of data
struct store_t {
    float gpsLat, gpsLon;
    float gpsSpeed, gpsAlt;
    float imuX, imuY, imuZ;
    float imuPress, imuAlt;
  } storeBlob;
  
  
void setup ()
{
  Serial.begin(9600);
  Serial.println ("Reading storeBlob");
  
  // Read from EEPROM
  EEPROM_readAnything(0,storeBlob);
  
  // Write to screen
  Serial.print("Lat:.. ");  Serial.println(storeBlob.gpsLat);
  Serial.print("Lon:.. ");  Serial.println(storeBlob.gpsLon);
  Serial.print("Speed: ");  Serial.println(storeBlob.gpsSpeed);
  Serial.print("Alt:.. ");  Serial.println(storeBlob.gpsAlt);
  Serial.print("X:.... ");  Serial.println(storeBlob.imuX);
  Serial.print("Y:.... ");  Serial.println(storeBlob.imuY);
  Serial.print("Z:.... ");  Serial.println(storeBlob.imuZ);
  Serial.print("Press: ");  Serial.println(storeBlob.imuPress);
  Serial.print("Alt:...");  Serial.println(storeBlob.imuAlt);
}

void loop ()
{
  
}

Saturday, November 15, 2014

GAPA Launch Facility

We took our Scout troop to the GAPA launch facility in northwestern Utah. The facility is reached by taking I-80 to exit 81, backtracking about a mile on a frontage road, then turning left. The site is snug up behind "Clean Harbor" which bills themselves as a waste management company.

What is GAPA?

In the late 50's the US Air Force tested surface-to-air missiles known as "Ground to Air Pilot-less Aircraft" build and designed by Boeing. Boeing built the GAPA launch site, which is now a Utah Historic SIte and on the national register of historic places. The site is on Bureau of Land Management land, although we did need special permission to camp there due to the historic status of the site.
Utah Historic Site Sign

Launch Bunker

 The site consists of a small bunker, which has been damaged by vandals (apparently someone exploded a large charge inside, blowing out the door and shattering the windows) and what remains of a launch tower: the pad and a few bolts for the towers.

Launch Pad

Tower Stanchion in Foreground

Panoramic view: there is NOTHING out here

Launching Rockets

We woke this morning to 28 degrees, a skiff of snow, and a stiff wind. We ended up scrubbing the launch but we had a nice trip anyhow!

Just a little snow