Posts Tagged bluetooth

I lost my Fitbit… and found it

I have settled into a somewhat sedentary lifestyle.  My partner tries valiantly to get me involved in her personal training sessions, but I have a lot of inertia.  I know that I need to do something about being more active and increasing my fitness level, but have struggled to find a motivator.

While in Europe I succumbed to a bit of techno-craziness and bought a Fitbit One.  (The craziness wasn’t buying a Fitbit, it was where I bought it—the Apple Store in the Odysseum in Montpellier—and the resulting price I paid compared to if I’d waited and bought it at home, even from an Apple Store.)  I was enjoying the novelty of tracking activity, counting steps and calories, entering water consumption, and monitoring sleep.  I wore it almost constantly through France, in Amsterdam, and on the way back to Australia, thinking I might have finally found a way to motivate myself to exercise—that’s right: the path to a healthier life through good-old 21st century gamification!

I drove up to Brisbane a week ago for lunch with some work colleagues before picking up my kids; of course, the Fitbit was with me all the way.  The only problem was, my leather belt is too thick for the Fitbit’s clip so I instead clipped it into the coin pocket of my jeans.  It’s not so secure, and the Fitbit slid back and forth along the rim of the pocket, but I figured the seam along the edge of the pocket was thick enough to prevent the Fitbit from coming loose.

Almost over the jet-lag from coming back from Europe, I prepared for bed that evening looking forward to wearing the Fitbit to monitor my sleep—only the Fitbit was nowhere to be found.  Not on the jeans, not anywhere visible.  I decided that my method of clipping the Fitbit into the coin pocket was not so secure after all, and it had come loose during the day.

The next day I did the usual “retrace your steps, check behind the couch, blah blah” routine but still came up blank.  During Sunday however, for some reason I decided to start up the Fitbit app on my phone… and was rewarded with a message telling me it was “Syncing”!  I looked around where I was sitting, but still couldn’t find it.  By this time I had convinced myself it really was gone, and the sync message was the app on the phone syncing with the web site.

It got the better of me again today however.  I started the app again, and again was told it was “Syncing”.  I went to the “Devices” list, and sure enough beside my One it said it had synced just then.  Knowing that it had been over a week since I had last seen it, and that the battery was good but it wouldn’t last forever, I decided to pull out all the stops to locate it.

The BTLExplorer screen as it detects my Fitbit One.

The BTLExplorer screen as it detects my Fitbit One.

I figured there had to be an app similar to those I’d seen for scanning Wi-Fi and Bonjour but for Bluetooth, but searching for “bluetooth locator”, “bluetooth search”, and so on led to nothing helpful—there is a growing number of apps that help you search for headsets or objects to which you’ve attached a Bluetooth Low Energy (BLE) tag, but I couldn’t find anything that did a simple scan of Bluetooth devices in range.

I turned to Google at that point, and decided to search for “locate lost fitbit bluetooth”.  The second item in the results was this blog post, which turned up a free app called BTLExplorer.  I installed it, ran it, and straight away it detected my Fitbit!

What followed was an ultra-modern version of “Marco Polo” or “Hot or Cold”.  I wandered around the house watching the indicated signal strength rising and falling, trying to get closer to where it was hiding.  Eventually, I found the room where the strength was intermittently rising above -60dBm, and sure enough, under a cushion, was my Fitbit One!

Now I can resume the monitoring of my activity levels.  In addition, my fruitless searching of the Apple App Store has made me realise that the App Store app on the iPhone is pretty useless for searching for apps: turns out there are a few other apps similar to BTLExplorer, but because I didn’t search for “bluetooth scanner” or “bluetooth explorer” I didn’t find them.

So far I’m pretty impressed with the Fitbit technology, even though it’s not that much more than a fancy pedometer.  While the device is pretty cool most of the intelligence of the system is in the app and the website, which analyse and interpret the data gathered by the device itself.  It is pretty nicely integrated: the device itself gets the movement data and syncs to the phone, which you can use to do basic display of the data while entering additional data like weight measurements and food and water consumption; the phone app syncs all that data to the website which does additional analysis and provides more of the social aspects of the system.

I’ll report back on how the Fitbit and its application environment helps me with my health transformation!

Tags: , ,

Asterisk chan_mobile fail

I’ve been struggling with setting up chan_mobile on my Asterisk system.  For those fortunate enough to actually get it working, chan_mobile provides an interface for Asterisk to treat a mobile phone like a PSTN or VoIP trunk–when someone calls your mobile phone it can ring your desk phone or softphone, or you can use your normal handset to make an outgoing call on your mobile.  It works by making the Asterisk system look like a Bluetooth headset or handsfree to the phone.  You can even connect Bluetooth headsets to Asterisk using chan_mobile and have them appear like an extension in your dialplan (although that capability doesn’t seem to be covered very much).

I figured this would be an ideal way to make use of an old Nokia 6230 with a broken speaker.  Somewhat foolishly, on the assumption that it would Just Work (and that all the troubles experienced by others would not beset me) I went and bought a two-pack of prepaid mobile SIM cards and went through the adventure of activating them.  One of these SIMs I threw into the 6230, the other I kept on hand for after I got everything working.  The plan, you see, was to be able to take advantage of free calls between the two accounts by taking one of the phones with me when travelling and leaving the other strapped to Asterisk at home.

I think it’s probably fair to say that I’ve had more success with it than a lot of other folk have.  The process of configuring Asterisk to use the Bluetooth dongle is quite straightforward, and it’s even quite easy to configure the chan_mobile driver to have calls enter your Asterisk system in a routable way.  When I dialled the “tethered” mobile from another phone, I was rewarded with the ringing of my desk phone–and at this point, I think I gave myself the kiss-of-death.  “Wow, that was easy,” I thought…

When I picked up the desk phone, I was rewarded with silence.  Not just the silence of the phone not ringing any more, but also the silence of no audio being passed either way over the call path.  Nothing put the pure, desolate sound of FAIL.

Things actually went downhill from there, believe it or not.  I have tried a total of four different Bluetooth dongles, with results ranging from the aforementioned signalling-but-no-audio to why-the-@#%$-won’t-this-thing-pair.  The three different phones I’ve tried elicited a similar spectrum of results.  “Make sure your dongle has a Cambridge Silicon radio, they definitely work” say the forum experts…  Sorry guys, one of the biggest failures I had–failure of Asterisk to pick up the call–was on the last dongle I tried and, yes, it was a CSR.  I’ve even had two different versions of the bluez stack and (I think) two different asterisk-addons versions.

The one thing that I’ve distilled from all the experiences I read through is that there is a ridiculously high level of sensitivity to particular phone and dongle features.  For example, great success has been reported with the Nokia 6230i.  I figured that I was lucky and that a 6230 would be close enough…  Doesn’t look like it.  There is one model of D-Link Bluetooth device–no longer in production, by the way–generally reported to give the most success.  Tweaking the device class reported by the bluez stack in the Linux host is said to give success too, but led to me being unable to get a connection to Asterisk.  Unfortunately, I have neither the time nor the patience to spend too much time trying to go through the motions of getting it working.  I tell you, if it really is that difficult to get two Bluetooth devices to talk to each other it’s no wonder that the majority of folks still use wired headsets!

Luckily all this little experiment has cost me so far is time.  The two-pack of SIM cards cost me the grand total of $2, and they had enough start-up credit on them to allow me to receive calls without a top-up.  The handsets are from that ever-growing pile of GSM hardware that just about every modern household is accumulating now (well, at least the ones that house a gadget-freak who can’t even bear to part with a broken one).  The kernel version I’m running on the system could be an issue, since I get ugly error messages from the btusb module when I take a call, so a kernel update might help.  After that though it’s likely to cost real money–buying a new/different Bluetooth dongle, for example.

If anyone out there has suggestions on something else to try, I’m listening (reading? watching?).  I don’t mean to complain, after all I am one that usually subscribes to the “it’s Open Source, it’s the hard work and dedication of others, you got it for nothing, you’ve got no right to complain” philosophy.  It is really frustrating to come away from a couple of days’ effort with nothing to show for it, though.

Tags: , , ,