• Using my Bluetooth knowledge

    In November, I saw that TI announced a product called SensorTag which is basically a development board for working with Bluetooth 4.0. I was immediately intrigued as iOS 5.0 supports Bluetooth 4.0 (LE) and lets me write apps that aren't certified by Apple via the Made for iPhone program. I ordered the device (it was $25 which I consider a bargain) and then in early December, it arrived.

    While I had no real use for it, I decided to learn how to write code to use Bluetooth LE and wrote a app that monitors all the sensors in the SensorTag and reports them. The TI app did this, but wasn't very elegant and I also wanted to add alarms for high/low temperature. A few weeks later (I worked on it an hour at a time in the evenings), I finished my code and had a working app. Since I don't have any plans to monetize my work, I've made all the code available under an MIT license. One of the comments I've received about my work is that my code is better than the code provided by TI! It might be that I've been writing Objective-C and iOS code for awhile or my goal was to produce an app that anyone could use. In any case, I may release it to the app store, but the audience is quite limited as it requires the SensorTag which is basically a developer/hacker tool.

    Now, where was I going? With all this Bluetooth 4.0 knowledge, what should I do next? I wanted to learn something new and I did that; I likely won't make any money from my new found knowledge, but it is fun playing around with it. However, today while I was running, I determined what I could do with the knowledge.

    Let's rewind a few months. When I run, I take my iPhone, use a pair of Motorola S10-HD Bluetooth headphones and a Wahoo Fitness Blue HR heart rate monitor. I use RunKeeper to log all the data. I have been using this combination successfully for many months and have been quite happy with it. When iOS 6 came out and I got an iPhone 5, things started going downhill. RunKeeper was no longer able to talk to my heart rate monitor and they blamed Wahoo Fitness as they use a Wahoo Fitness library to talk to the heart rate monitor (the library also supports ANT+ heart rate monitors via a Wahoo Fitness dongle). After a few app updates, RunKeeper appeared to support the heart rate monitor again.

    After hurting my foot and then being sick, I started running again on Sunday. During that run, I noticed that the heart rate monitor reported accurate results via RunKeeper, but my music kept cutting out periodically. I initially blamed the Motorola headset as I've already had to return one pair due to the buttons failing. Today I ran again and noticed the same problem. However, I decided to count how often the drop outs occurred. The drop outs occurred every 6 seconds. For anyone doing sampling of data, this should ring a bell. Every 6 seconds is 10 minutes per minute which is a reasonable period to be sampling data. I took off my heart rate monitor, put it in my pocket and after a few minutes when the Bluetooth connection disconnected, my music continued without drop outs!

    So now I knew the problem wasn't necessarily with the Motorola headset, but there were too many variables:

    • Switched from iPhone 4S to iPhone 5
    • Went from iOS 5 to iOS 6
    • Updated RunKeeper

    The only pieces of the equation that hadn't changed since everything was working smoothly were the Bluetooth Heart Rate Monitor (it is a Bluetooth 4.0 device) and the Motorola headset. Having worked with earlier versions of Bluetooth, I thought that maybe there was a conflict between the Bluetooth devices. However, the devices remained the same and only the phone had changed. How was I going to track down the problem? Since I now knew had to write a Bluetooth LE app, I decided to write an app to talk to the heart rate monitor and get readings. This turned out to be a simple task and took about an hour to write the app. I ran the app and played music through the headsets; I was expecting to hear dropouts, but no such dropouts occurred. So, this little test told me that the iPhone 5 with the Wahoo Bluetooth 4.0 Heart Rate Monitor and Motorola Bluetooth headset could all be operating at the same time without problems.

    So what next? I ran RunKeeper again and tried to duplicate my results from my run, but was unable to do so. Granted I wasn't running, but I expected to have dropouts. I'll go for a run tomorrow and see what happens. I'm a bit suspicious about the Wahoo Fitness library as Bluetooth 4.0 is quite simple to talk to the heart rate monitor. I turned on the option for the device to notify (and not poll) the heart rate monitor and received an update every 2 seconds. So if the Wahoo Library was using the notify option, I wouldn't have heard dropouts every 6 seconds.

    I think that this issue is worth a look as the Wahoo Fitness library is doing something funky and that RunKeeper can directly talk to the heart rate monitor without using the library. If the library is polling, it should be changed to use the notify feature of Bluetooth 4.0.

  • Streamlining Receipt Entry

    As many that read this blog know, I started scanning in all of my receipts over 6 years ago and pretty much every piece of paper (of some value) that comes into my house gets scanned and then shredded or filed (I'm still not sure why I file it; some places don't accept copies of receipts, but a lot of paper doesn't need to be saved). I use a Fujitsu ScanSnap scanner along with Mariner Software's Paperless to store everything. I've used a bunch of scanners and still have a few lying around my house.

    Yesterday I saw a tweet from Dan Frakes, an author at Macworld magazine about using an Eye-Fi card with a Doxie scanner to wirelessly scan. This got me thinking as I had an Eye-Fi card that was just lying around; my wife and I both have iPhones and use them for a majority of our pictures (the best camera you have is the camera you have with you). I also had a BulletScan M40 that was unused. Since the M40 takes an SD card, I thought this would make a great combination.

    My plan was to setup the M40 and Eye-Fi card to send all the images to my media center (it is on all the time) and then use Dropbox to sync the files back to my main machine. (If this sounds familiar, I setup something similar two years ago with my Brother scanner.) This morning, I went to set everything up only to discover that for some reason the M40 didn't recognize 8 GB cards, both the Eye-Fi one and one I had lying around. It didn't have a problem with the 256 MB cards. I reformatted the Eye-Fi and tried lots of tricks and basically gave up. However, after staring at it, I realized that the SD card reader that came with the Eye-Fi was lying on my desk. I plugged the Eye-Fi card into the card reader and then the card reader into the M40. Presto, everything started to work.

    To put the finishing touches on my new setup, I used Automator to setup a Folder Action that would rotate the images downloaded from the Eye-Fi and then move them to a folder on Dropbox. This offloaded the processing and saved me a step on my main machine.

    My 5 year old son was so mesmerized with the scanner, all he wanted to do was scan receipts and see them show up on my machine. He has no idea all the magic that goes into it; he just knows that the scanner is not connected to my computer and receipts show up. Now all I have to do is recruit him to scan in all of my wife's receipts!

    (Yes the ScanSnap is much faster at scanning in receipts, but this setup will be much easier to use for my wife and she doesn't have to take over my computer to enter her pile of receipts.)

  • Suggestions to SeaWorld

    Yesterday my family and I went to SeaWorld as it is now an annual thing for us to visit a theme park (last 2 years was LEGOland). I expected there to be some people (tourists and others that don't celebrate Christmas), but thought it would be a breeze to get into the park. We left our house around 9:40 for a 10 am opening of the park. We live less than 10 minutes away, so 10 minutes to get in, get parked and get to the gate did not seem unreasonable to me as we've done it before.

    We get to the parking lot and had to wait in a line. That's the first problem. The way SeaWorld does parking is they have multiple gate houses (that's what I call them) with 1 car lane on each side. Each gate house can accommodate 2 people, one person on each side. Well, SeaWorld decided to staff each gate house with 1 person meaning that instead of 2 cars going in at a time, only 1 went in at a time. You would think that this was done to slow down traffic in the parking lot, but there was practically no moving cars in the parking lot. I also noticed that one gate house was empty, so there were no cars at it.

    If that wasn't bad enough, the 1 person has to take your money or pass, go inside, ring it up on the computer and print out a receipt before returning. So with the great invention called mobile terminals, they should be able to collect money/credit cards/passes without having to go inside. Combine this with 1 person per lane and more cars could get in faster. If you were unlucky and pulled your car on the left hand side of the gate house, your passenger (or you if you don't have a passenger) has to hand everything through the passenger window. Putting a person on each driver's side window would make it easier.

    After we made it through that line, we had to park. At DisneyLand, there are people directing you to empty spots and basically don't let you park wherever you want. SeaWorld kind of makes it a free for all which causes empty spaces. So people cruise up and down the aisles looking for empty spots (we did that and found one pretty quickly).

    We thought we were home free and the long lines were people buying tickets. We were wrong; the long lines were to get in. They had 2 entrances open which meant that 4 people at a time could get in. Then when we got to the front of the line, the same problem they've had for ages showed itself again. That was their horrible ticket scanning machines. These machines require you to put your ticket on a platform and line up the X to read the barcode. They are slow and problematic. Then for pass holders (and presumably multi day ticket holders), you have to put your finger on the biometric scanner which seems to be flakey as well. Yesterday, the machines flat out didn't work, so the people at the entrance had to use handheld devices and scan the barcodes. While barcode scanning is a fairly fast process, lining up the barcode takes time especially if you're trying to hold the device and the ticket. Using a magnetic stripe on the ticket like they do on many transit systems would speed up the process. The downside is that people that printed tickets at home would have to exchange them for encoded tickets. Since there were a number of unused automated kiosks, this doesn't seem unreasonable. While this does shift the line, it only shifts the line for those that printed tickets at home.

    While this may sound like I'm complaining, a trip to a Disney theme part shows that these problems have been thought out and solved a long time ago. I'm not sure if the current owners of SeaWorld don't want to invest the time or just don't care. It could be the latter because people still come to the park and are just grumpy until they get inside and forget about the 40 minutes to actually get there.

    Suggestions on busy days

    • Staff each parking gate house with 2 people.
    • Open all parking gate houses.
    • Use mobile terminals for parking payment collection.
    • Put people on driver's side of each lane and not stay in gate houses.
    • Have people directing cars to fill in every spot.
    • Open more entrances to let people in.
    • Get more reliable ticket reading machines.
    • Use magnetic stripe tickets instead of barcodes.
  • Inaccurate speed tests

    One of the most popular ways to test Internet connection speeds is to use speedtest.net. The problem with using a site like this is that providers sometimes have a feature that increases the bandwidth for the initial part of the download. This allows for faster downloads of smaller files. Unfortunately this really messes with speed tests. For instance, I'm now getting 15 megabits per second down, but the tests are telling me that I'm getting 28-30 megabits per second. This would be fabulous if I got it, but I don't. A more accurate test is to download a large file from a fast host. In my case, I download stuff from Apple and get about 2 megabytes per second which is 16 megabits per second. This is more in line with what I'd expect.