Skip to content

Fixing a dead Proximity Sensor on a Nexus One with CyanogenMod 7

18-Dec-11

 

I’m not entirely sure if there is a bug in CM7 or if my proximity sensor in my Nexus One is cooked but the result is that when I get a call, the screen goes black and I cannot wake it. My only option then is to pull the battery.

The solution is to disable the sensor. To do so, push this file  using adb (Android SDK tools) to /data/local. This file basically disables the device by setting it’s permissions to 0.

I hope this helps someone.

Twilio and Google Talk

18-Dec-11

If you head over to XMPP Voicemail  there is a Google App Engine app written in Python that you can install in your own App Engine instance. The initial goal of the application was to send transcribed voicemail messages from Twilio to your Google Talk account using XMPP. But later functionality was added to allow for SMS messages to be sent to and from a representing Google Talk address.

As a Canadian who still can’t officially get access to Google Voice, this looked like a promising path. With some hackery, it is possible to get pretty well the same functionality but with a minor difference.

I’ve managed to figure out a hack to all of this. I am using the following:

So it’s a fairly complicated affair, one that could be simplified greatly if we Canadians had Google Voice, but alas, we don’t.

To get this working I did the  following:

  1. Get the Obihai hardware.
  2. Install the Obihai and your phone.
  3. Get a US number representing each telephone you own from voip.ms
  4. Setup the Obihai to connect to your voip.ms account.
  5. Open a Google Voice account by using your US based voip.ms number. The verification system will call your Obihai based phone.
  6. Get a Twilio Canadian based number.
  7. Configure and install the xmppvoicemail app in Google Engine.
  8. Have your Twilio number forward to your Google Voice number when new calls come in.
  9. Have Google Voice notify your voip.ms numbers when called.

You then give our out your Canadian based Twilio number to friends and family. When they call this number, it will forward to your Google Voice number which will then notify all the numbers you have associated with your Google Voice number. In my case it rings my voip.ms account to which I have my Obihai connected and I also have my Android phone using the simplesid (app), connected to my voip.ms account. So my cell also rings. If you are logged into Google Talk, it will also ring. Note, all of this is done using VOIP. There’s no airtime minutes involved.

The tricky part comes with SMS and this is where xmppvoicemail is required. It creates a bridge between your SMS Twilio number to your Google Talk account.

In terms of functionality, when I get a SMS, the SMS number appears in my GTalk friends list. I am able to reply to this Gtalk “friend” which then forwards to my instance of the xmppvoicemail app which then forwards to Twilio which then forwards to the phone. The same works in reverse. Each SMS number is represented as a Gtalk “friend”.

I know, quite a hack to get something pretty basic but it allowed me to learn a lot about Twilio and the Google App Engine and even some Python.

If you want the gory details on how to install this, drop me a line. It would take a 10 part series to explain it all.

Or, just wait for Google to finally bring Google Voice to Canada. But I suspect implementing the above will take less time. ;-)

Parsing simple JSON with Qt

03-Dec-11

I loathe to use 3rd party libraries when I think I can get away with it. I’m a longtime Java programmer and whenever I see the inclusion of another jar into my project, I break out in hives. I know that jar is going to cause me grief later on. Same goes with having to use 3rd party libs in your Qt code. It’ll work great on your machine, but when you have to distribute that binary, that’s where the fun begins. So generally, I try to avoid having to use them.

Which brings me to parsing JSON data in Qt. Qt actually has everything you need without having to resort to using 3rd party libraries.

Here’s a very simple example of some JSON that a server returns me:
{"message":login,"token":"3674c0c303b1a54903b2ede057184896b10972b2ea30138f","status":"success"}"
I need the token for later on. How do I get it ?

First, include the scripting engine in your qmake file:
QT += script
Next, include the header:
#include <QScriptEngine>
Next, the code:

void SomeObject::postLogin(QNetworkReply *reply)
{
    if (reply->error() == QNetworkReply::NoError)
    {
        QString response = reply->readLine();
        if(response.contains("token"))
        {
            QScriptValue sc;
            QScriptEngine engine;
            sc = engine.evaluate("("+response+")");

            if (sc.property("token").isString())
            {
                token = sc.property("token").toString();
            }
}

I think the code is fairly self explanatory and I could probably simplify it greatly but you get the picture.

If  you also take a look at the documentation for QScriptValue you will see that it supports arrays, integers, etc. So for most JSON parsing, you can get what you need without having to implement anything else.

Strava Integration into Golden Cheetah

23-Nov-11

I spent Sunday afternoon hacking up the ability to upload your ride from Golden Cheetah into Strava. The patch is here: http://bugs.goldencheetah.org/issues/519

 

This patch applies against the current master branch but it will be released only when 3.0 comes out. But if you want to use it now, you can by applying the patch and building it yourself.

It supports all GC data including data that isn’t “GPS’d”.

Trip to Banff

10-Oct-11

 

I’ve been to Banff 5 times now and each time I go the scenery leaves me breathless.. (it could be the high altitude too).

 

This was shot at the top of Sulfur Mountain. Which, after 4 previous visits to Banff never bothered to head to the top. My girlfriend was quite adement about seeing the top and this is what it looks like..

Sulfur Mountain

Sulfur Mountain

 

 

Moraine Lake is a 20 minute drive from Lake Louise and yet each time I visited Lake Louise, I never bothered to go. It was only after my mom told me she felt Moraine lake was prettier that we trekked up. It was a good 7c cooler here then at Lake Louise but worth the trip.

Moraine Lake

Moraine Lake

Updates to Golden Embed

18-Sep-11

I used Golden Embed (GPS) now for the entire summer of 2011. The only issue I encountered was a slowly but surely dying GPS. It took longer and longer to get a lock on enough satellites and when it did, it would drift by a considerable amount or sometimes flat out lose a lock.

I swapped it for another and problem solved.

The code has been updated. You can now upload your ride to Strava. A huge thanks to Mark Shaw co-founder and CTO of Strava in being very patient in helping me get this working. My knowledge of JSON was seriously lacking, especially with Java.

Here’s a quick update on all of the things you can do with Golden Embed (GPS)

  • Log all your ANT+ based data with support for Powertap, SRM and Quarq as well as speed and cadence and heart rate sensors.
  • Full GPS support including position and speed.
  • Elevation support using either the onboard barometric pressure sensor or support via the Google Elevation service.
  • Create a gnuplot of your ride
  • Create a Golden Cheetah ride file to allow importing into Golden Cheetah
  • Upload to Google Fusion Tables
  • Upload into Strava
I never quite thought this project would turn out to be so much fun. I’ve been working on Golden Embed since late 2009 and there’s always been something cool to add to it.

Fusion Tables

02-Mar-11

I have been mucking about with Google’s Fusion Tables.

It’s a very powerful and impressive web service that allows you to upload your own data and view it using Google’s Visualization API in a very simple manner.

 

I modified Golden Embed’s parser to be able to upload the data accumulated from either the GPS version or the original version so that rides are now viewable in Fusion Tables (FT).

 

In the example below, you are seeing last night’s easy spin. I collected this data using GE v1. It is also possible to create intervals or lap markers from the parser itself.

 


 

I have also modified the GPS version to now enable the barometric pressure sensor. The parser then converts this sensor data into actual elevation. Some say this is more precise then using the elevation from Google’s elevation service.  It will be interesting to see which is the case.

 

This is from a drive I took to go skiing. I had a HR monitor strapped on and I recorded GPS data (including speed) and uploaded it to FT. You will see a balloon marker indicating an “interval” This is simply to demonstrate what an interval in Google Maps would look like using FT.

This is really just the start. It was fantastically easy to do as well.

 
 

After nearly 5 years with the Golden Cheetah project, I have decided to take an indefinite break. The project had for me reached a point where I couldn’t see how adding more would make it _that_ much better. For me, GC did pretty well what I wanted, if anything, maybe too much.
 
I also felt like investing more time and energy into a project that is based off a non web, fat client, circa 1995 technology might not be the best use of my time. Super cool things are happening with web/cloud services and I want to be a part of that.
 
I wish everyone over at GC the best of luck.

 
 

Tracking ANT+ and GPS Data

06-Jan-11

I spent a chunk of the Holidays going back to Golden Embed GPS. It turned out to be nearly as difficult to tame as the original Golden Embed did. The ANT+ stuff was easy as I had lived it previously a year ago. But getting the GPS data and the ANT+ data to live together and not clobber each other leaving me with a wonky file proved to be a real challenge.

I did learn a few more things:

  • Always buy at least two devices. One to debug on and one to test on.
    • I ended up having to hook up an Arduino to the debug device and ran it for an entire night trying to simulate a bug. Having just a LED and a disk is never enough. Visual output is often key.
  • Embedded devices with low CPU power require very optimized code. I suppose this is obvious to many but for me it only became apparanent when watching streams of data get lost due to something sucking up precious CPU cycles.
  • GPS are great but don’t rely on them for time stamps.
    • When the ANT+ data is taking up all your CPU time and your poor GPS string hasn’t been parsed yet to get the time you end up losing a few timestamps.
    • This was fixed by using GPS to set the Real Time Clock and then just using the RTC for time.
    • This also permitted me to skip n GPS messages to give even more time to the chatty ANT+ serial port.
  • It’s super rewarding when it’s working. Not much code. Such a tiny little board. But when it works prefectly, it’s more rewarding then seeing a large website come into production.

Next will be to tackle altitude based off barometric pressure..

Golden Cheetah v2.0

01-Dec-10

Here’s a quick rundown of the New Features in Golden Cheetah v2.0

Golden Cheetah can be downloaded here: http://www.goldencheetah.org/download.html


  • Aerolab (Andy Froncioni)
Aerolab

Aerolab

  • View ride in Google Maps (Greg Lonnon)
Google Maps

Google Maps

  • Long Term Metrics (Mark Liversedge)
Metrics

Long Term Metrics

  • User configurable ride metadata (Mark Liversedge)
Meta-data

Meta-data

  • Ride editor and tools (Mark Liversedge)
Ride Editor

Ride Editor

  • HR Zones and TRIMP Metrics (Damien Grauser)
Performance Manager with TRIMP

Performance Manager with TRIMP

  • Twitter support (Justin Knotzke)

Internationalisation

  • Updates to French translation (Damien Grauser)
  • Japanese translation (Mitsukuni Sato)

New Logo and Icons

  • Golden Cheetah Logo(Dan Schmalz)
Logo

Golden Cheetah

Enhanced Ride Plot

Enhanced Plot

Enhanced Plot

  • Ride plot stacked view (Damien Grauser)
  • Scrolling Ride Plot (Mark Liversedge)
Enhanced Ride Plot

Enhanced Ride Plot

New Devices and File Formats Supported

  • Support for Joule BIN File Format (Damien Grauser)
  • Tacx CAF Ride File Format Support (Ilja Booij)
  • Garmin FIT ride file support (Sean Rhea)
  • Export to Google Earth 5.2 KML (Mark Liversedge)
  • Training Peaks PWX ride file support (Mark Liversedge)
  • Polar SRD ride file support (Mark Liversedge)
  • Racermate CompCS/Ergvideo .TXT ride file support (Mark Liversedge)

Numerous enhancements and bug fixes from

  • Julian Baumgartner
  • Robert Carlsen
  • Rainer Clasen
  • Gareth Coco
  • Dag Gruneau
  • Jamie Kimberley
  • Jim Ley
  • Patrick J. McNerthney
  • Austin Roach
  • Ken Sallot
  • Thomas Weichmann

Builds, testing and support

  • Robert Carlsen
  • Gareth Coco
  • Jamie Kimberley
  • Justin Knotzke

Golden Cheetah: Better Zooming Edit and Twitter support

28-Jul-10

New Zooming in Ride Plot

Three new features to Golden Cheetah. The first is a MUCH improved zooming feature in the ride plot.

Golden Cheetah Scrolling and Zooming from mark liversedge on Vimeo.

New Manual Ride Editor

Ride Editor

Ride EditorAlso added by Mark is a Ride Editor that allows you to manually edit out those nasty peaks or other outlaying data. This was one of our more requested features. Generally the philosophy is to not try to fix crappy input data but instead allows users to fix it themselves. Trying to fix crappy data is always problematic. So this feature fits in well with GC's generally philosophy regarding user data.

Tweet Your Ride

Finally, a little hack of a patch I create. You can now tweet your ride.  After choosing which Metrics, GC will tell you the total length of your Tweet and when pressing “Tweet Ride” GC will send your chosen ride metrics with your message and add a #goldencheetah tag. This will allow others to search for GC users via Twitter.

Tweet your Ride

Tweet your Ride